The values that i get back is as follows
{“success”:true,"@yyyy":“NOT_SUPPORTED”,"@xxxx":{“type”:“RELAY QS-R-S5”,“firmware”:“32”,“epoch”:“1560592193”,“rssi”:“41%”,“value”:1}}
So Value:1 is on and if value:0 its off.
I tried a couple of things but I cant get it to work correct.
You need to count the spaces carefully and replace with the full stops otherwise it won’t match the output of the GET, so try without the grep first (as you have done) and count the number of characters between the switch id (@yyyy) and the value field to be replaced with the full stops. It works for me, but if you find a more elegant way please let me know!