Yeah. That’s what I was trying to do. I have it setup currently like this:
body_on: {“on”: “true”}
body_off: {“off”: “true”}
I’m using Python 3 and sanic to try out the parsing and it keeps saying:
sanic.exceptions.InvalidUsage: Failed when parsing body as json
I dont get the same if I send the same json body with curl. That’s why i was thinking that it might not be sending data as I’d assume. Maybe I’ll just use command line & curl, but there seems to be some bugs (?) with the rest api or then only the documentation is not as understandable as I would need it to be
With quotes on place it is sending proper json. Maybe I’ll try and update the instructions on RESTful Switch - Home Assistant to add that as an example how to send proper json. So others won’t need to bang their heads on this
Edit: hmm. or then I just missed the quotes last night…
Not completely sure, but I’m suspecting that {“active”: “true”} is not the same as {“active”: true}, where the latter would produce true value from the template {{value_json.is_active}}