Room Controls JSON - multiple parameters? | Community
Skip to main content
Newcomer
May 17, 2023
Solved

Room Controls JSON - multiple parameters?

  • May 17, 2023
  • 3 replies
  • 8 views

I'd like to create a Room Controls JSON file that turns on and off a Samsung display.  The hex string requires both a Power data field (0 is off, 1 is on) and a checksum; the checksum will obviously depend on the value of the Power data field.

 

If I wanted to use parameters in my methods definitions, how do I specify both the data and the checksum?

 

===

 

From Samsung:

 

All communications take place in hexadecimals. The checksum is calculated by adding up
all values except the header. If a checksum adds up to be more than 2 digits as shown below
(11+FF+01+01=112), the first digit is removed

 

 

    Best answer by shaneatzoom

    If you needed a different checksum at the tail of the command, you wouldn't be able to use the modulus sign, but you could just as easily build two separate full strings (one for each power state).  I think that's your question, but please feel free to clarify if not

    3 replies

    htolinoAuthor
    Newcomer
    May 25, 2023

    Any thoughts at all?  Or isn't this possible?

    shaneatzoom
    Community Champion | Employee
    Community Champion | Employee
    May 30, 2023

    If you needed a different checksum at the tail of the command, you wouldn't be able to use the modulus sign, but you could just as easily build two separate full strings (one for each power state).  I think that's your question, but please feel free to clarify if not

    htolinoAuthor
    Newcomer
    May 30, 2023

    That's exactly what I meant.  Thanks for the confirmation.

     

    Henry