Hi,
I've got sirens that will take this payload to sound the siren:
And this payload to silence the siren:
I'd like to make two buttons for these two payloads, in the same device. One named "Alarm" and the other "Avstill". The device has been setup with "Avstill = 0" and "Alarm = 1"
I've tried using Replace(x,y,x), but I've had no luck so I must be messing up something with the formatting. I'm struggling to find the right way to do it.
Here is my attempt, but it results in an invalid JSON. I've tried a lot of moving bracket / quotes etc around, but still with no luck. I'm able to replace a single value, but the nested function has me beat.
That template results in the following payload, no matter which button I use:
Please advice, thanks
I've got sirens that will take this payload to sound the siren:
Code:
{"warning": {"mode": "fire", "level": "high", "strobe" : false, "duration": 30}}
Code:
{"warning": {"mode": "fire", "level": "low", "strobe" : false, "duration": 30}}
I've tried using Replace(x,y,x), but I've had no luck so I must be messing up something with the formatting. I'm struggling to find the right way to do it.
Here is my attempt, but it results in an invalid JSON. I've tried a lot of moving bracket / quotes etc around, but still with no luck. I'm able to replace a single value, but the nested function has me beat.
Code:
{"warning": {"mode": "fire", "level": "<<Replace(<<Replace("$$VALUE:","0","low")>>,"1","high") >>, "strobe" : false, "duration": 30}}
Code:
{"warning": {"mode": "fire", "level": ","1","high")>>, "strobe" : false, "duration": 30}}
Comment