Hi,
I’m stuck on building a template sensor to show battery-life of Fibaro Motions Sensors (fgms001zw5_motion_sensor). Can anyone guide me on what I’m doing wrong here?
I am serving this from sensor.yaml that I load in configuration.yaml.
Thanks for your help so far. I am making a little progress.
The sensor finally showed up, but few errors which I’ll post below my code. Basically I believe I had some indenting issues, and then sensor began working. But I tried your approach by adding INT, and see some ‘mappingproxy object’ errors.
- platform: template
sensors:
fibaro_battery:
friendly_name: "Fibaro Battery Status"
unit_of_measurement: '%'
value_template: '{{ states.zwave.fibaro_system_fgms001zw5_motion_sensor.attributes.battery_level | int }}'
- platform: template
sensors:
fibaro_battery_2:
friendly_name: "Fibaro Battery Status_2"
unit_of_measurement: '%'
value_template: '{{ states.zwave.fibaro_system_fgms001zw5_motion_sensor_2.attributes.battery_level | int }}'
- platform: yr
2018-06-25 15:52:53 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-06-25 15:54:01 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Fibaro Battery Status, the state is unknown.
2018-06-25 15:54:01 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Fibaro Battery Status_2, the state is unknown.
2018-06-25 15:54:02 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Fibaro Battery Status: UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
2018-06-25 15:54:02 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Fibaro Battery Status: UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
2018-06-25 15:54:05 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-06-25 15:54:09 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Fibaro Battery Status_2: UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
2018-06-25 15:54:10 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Fibaro Battery Status_2: UndefinedError: 'mappingproxy object' has no attribute 'battery_level'