Dear All,
I found out what the problem was with getting the status of an switch
like underneath statement:
value_template: '{{ value_json.response.switches[4].status=="on" }}'
^
|
The numer between the brackets is not the number of the ID but it is the number of the place in the Array of the switches.
If you want to know what number you have to put between the brackets, go to http://IP/Homewizard_Password/get-status
You get the status of all devices connected to your home wizard.
I saw in my system the status of the switches if you look closely you see that the id numbers are not exactly adding up. See the example how you can see which array number you have to put between the brackets for which id:
“switches”:[ Array Numbers:
{“id”:0,“type”:“switch”,“status”:“off”}, 0
{“id”:3,“type”:“switch”,“status”:“off”}, 1
{“id”:4,“type”:“switch”,“status”:“off”}, 2
{“id”:5,“type”:“switch”,“status”:“on”}, 3
{“id”:8,“type”:“switch”,“status”:“on”}, 4
{“id”:9,“type”:“switch”,“status”:“off”}] 5
if i want to readout the status of ID 8 i put the underneath lines in my code:
command_state: curl "http://IP:Port/Homewizard_Password/get-status"
value_template: '{{ value_json.response.switches[4].status=="on" }}'
This is working perfectly,
Good luck with programming