Good Morning,
I have been looking in forum and I couldnt find the response for the problem I have.
First I have to say my level is JS is very low, but in other cases I could do what I needed.
In this case I created a HTTP request switchBinary. The URL for actions On and Off works perfectly, but in the URL to get value I have http://192.168.45.126/relay/0 that respond the value: {"ison":true, "has_timer":false} if the relay is on and {"ison":false, "has_timer":false} if the relay is off
I try many combinations for "Inline Javascript to parse incoming data to 'on'/'off' strings" but i must be doing something bad, for example $$.ison === 'true' ? 'on' : 'off'
if you could help me I would be very grateful. Thank you in advance.
HTTP request
Re: HTTP request
Your code looks ok. Make sure your reply has a correct Content-Type application/json
Re: HTTP request
Ah, sorry, remove '' around true. You are using typed equal and string !== boolean
Re: HTTP request
Thanks Poltos
3 days trying and now works thanks to you
Regards
3 days trying and now works thanks to you
Regards