The following is causing errors and I can’t figure out what’s wrong. I’m sure it’s something stupid I’ve done. The value template works fine in the Templates Developer tool. I’ve tried different combinations of things with no success. I’ve come up with a different way of doing what I want, however, I’d like to know WHY this didn’t.
- platform: mqtt
name: "camera_status"
state_topic: "home/livingroom/camera/message"
- platform: template
sensors:
camera_capture_time:
value_template: "{{ states.sensor.camera_status.name }}"
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/config_validation.py", line 441, in validator if key in config:
TypeError: argument of type 'NoneType' is not iterable
So you can get the status: {{ states.sensor.camera_status.state }} -> ‘unknown’
the friendly_name: {{ states.sensor.camera_status.attributes.friendly_name }} -> ‘camera_status’
or the last changed timestamp: {{ states.sensor.camera_status.last_changed }} -> ‘2018-01-25T11:57:05.377965-06:00’
There is no state ‘name’
EDIT: I have to correct this post. {{ states.sensor.camera_status.name }} works and returns the friendly_name. ???
I didn’t know and have never seen this.