Hello, my first question, hopefully I’ll do everything right
Context: I’m trying to get the information out of a VZUG tumbler to drive some lights to know the status.
From a terminal in VS Code connected to remote HA Server, I can run the following successfully:
sudo curl -s http://192.168.20.51/ai\?command\=getDeviceStatuscurl
and the results I got depending on the timing were:
{"DeviceName":"","Serial":"12011 XXXXXX","Inactive":"true","Program":"","Status":"","ProgramEnd":{"End":"","EndType":"0"}}
{"DeviceName":"","Serial":"12011 XXXXXX","Inactive":"false","Program":"Mangelfeucht","Status":"Beladungsmessung\n","ProgramEnd":{"End":"1h35","EndType":"2"}}
{"DeviceName":"","Serial":"12011 XXXXXX","Inactive":"false","Program":"Mangelfeucht","Status":"Trocknen\nTrockengrad Mangelfeucht","ProgramEnd":{"End":"0h03","EndType":"2"}}
{"DeviceName":"","Serial":"12011 XXXXXX","Inactive":"false","Program":"Mangelfeucht","Status":"Programmende (Türsieb reinigen)\nEcoManagement 0,1 kWh","ProgramEnd":{"End":"","EndType":"0"}}
Good starting I thought, integration works; now it is time to create a restful sensor to see something on dashboard.
Again through VS Code I added the following to the configuration.yaml:
sensor:
- platform: rest
unique_id: ff75d0d46a6c4c799c6c21bfd4e6f179
name: Tumbler
resource: http://192.168.20.51/ai\?command\=getDeviceStatus
value_template: "{{ value_json.Inactive }}"
json_attributes:
- Inactive
- Program
- Status
But this is what I get in the dashboard:
and if I check in Dev Tools - States, I can get nothing again:
I tried to go to template editor, adding this:
{% set value_json = {"DeviceName":"","Serial":"12011 XXXXXX","Inactive":"true","Program":"","Status":"","ProgramEnd":{"End":"","EndType":"0"}} %}
{{ value_json.Serial }}
{{ not value_json.Inactive }}
and result is as expected:
for the value template, just to try everything, I made many attempts:
value_template: "{{ value_json.Inactive }}"
value_template: "{{ value_json.inactive }}"
value_template: "{{ value_json[Inactive] }}"
value_template: "{{ value_json[inactive] }}"
value_template: "{{ value_json['Inactive'] }}"
value_template: "{{ value_json['inactive'] }}"
but none of them solved the issue.
Could someone please help me pointing me in the right direction to find what I am doing wrong?
Thanks