Ok, I am back again. This template stuff has me baffled. I can’t seem to get my head around it. I am now dealing with a cover entity, my garage door. As before the physical device is a Go Control Zwave garage door controller that is setup as device in Homeseer. I have exposed it to the MQTT broker and successfully monitor messages both subscribed and published by Homeseer and Home Assistant. Additionally the up arrow icon (for open) and the down arrow icon (for close) in an entity card for lovelace work. I click on either and the messages sent via MQTT cause the garage door to physically open and close. My problem is I can’t get the entity card to display the correct status.
Pertinent details are:
Platform: Raspberry pi 3b+
OS: Hass.io version 4.12
Home Assistant: version 0.114.3
Node-Red Add on: version 7.1.0
MQTT Add on: version 5.1
Please see the following:
- platform: mqtt
name: "Garage Door"
device_class: garage
unique_id: "GarageDoor"
state_topic: "CRUD-06/mcsMQTT/Garage/Access_Control/Garage_Door"
command_topic: "CRUD-06/mcsMQTT/Garage/Access_Control/Garage_Door/Control"
payload_open: "open"
payload_close: "close"
state_open: "open"
state_opening: "opening"
state_closed: "closed"
state_closing: "closing"
value_template: '{{ value.status }}'
qos: 0
optimistic: false
Homeseer works on value/status pairs as follows for this device:
0/close (control)
0/closed (status)
1 to 99/Stopped at Position x% (status)
252/closing (status)
253/stopped (status)
254/opening (status)
255/open (control)
255/open (status)
I can have it publish “$$VALUE:” which would be strings representing the numerical value or “$$STATUS:” which would be strings with the alpha content i.e “close”, “closed”, “closing”. Currently it is publishing “$$STATUS:”
For commands either 0/close or 255/open work interchangeably.
The documentation in their example uses:
value_template: ‘{{ value.x }}’
This as written didn’t work. After doing a bunch of googling I came across a post that said to use ‘{{ value_json.status }}’ this also didn’t work. In templating I found a reference that said you could use just “value” instead of “value_json”. This also didn’t work. Also I figure out the “x” had to be replaced with something other than “x”. I tried “status”, “state”, and “Garage_Door”, none of which worked. Like I said I am having a hard time getting my head around this.
I am sure it is me! I just can’t find the guide I need to understand this. Once I get this behind me I have one other device to setup and that will be my Trane Z-wave thermostat. Then from there (I will have control of all of my devices) I can then start to automate things.
As always a big thanks in advance to anyone willing to help.
Chuck
Edit: 8/31/20
Anyone out there have any suggestions? @123 you have helped in the past can you help this time? I would appreciate any suggestions anyone has. Also if anyone can suggest a specific guide or written documentation that I could read and learn from it would be much appreciated.
Chuck