HTTP Device App - Post Action read the on or off action value
Posted: 08 Jan 2025 19:42
I am using the HTTP Device app to control on / off of something else
The end point for the other device is http://192.168.0.57/control
the Data to be pass is json
where the mode is 0 or 1 for on or off (yes I realise this is backwards, not my end point doing)
I would like to take the input from the HTTP Device button press and either send if on is set
or if off is pressed
I have it reading the status okay
end point http://192.168.0.57/status
Inline Javascript to parse incoming data to 'on'/'off' strings
any help much appreciated
The end point for the other device is http://192.168.0.57/control
the Data to be pass is json
Code: Select all
{"mode":1"}
I would like to take the input from the HTTP Device button press and either send
Code: Select all
{"mode":0"}
or
Code: Select all
{"mode":1"}
I have it reading the status okay
end point http://192.168.0.57/status
Inline Javascript to parse incoming data to 'on'/'off' strings
Code: Select all
$$.mode === 0 ? 'on' : 'off'