Sensors and customise

Hey guys,

For some reason my fibaro motion sensors changed name after upgrading. They went from:
fibaro_system_fgms001_motion_sensor_luminance_2 to
fibaro_system_fgms001_motion_sensor_luminance_2_3

which was weird by itself, but I took this as an opportunity to clean some code. So, I decided to use customise to get some friendly names in the future. Now for some reason my sensors are no longer working. I have some data_templates with the following code:

living_brightness:
friendly_name: ‘Living Brightness Level’
value_template: >-
{%- if is_state(‘input_boolean.nightmode’, ‘on’ ) %}
20
{% elif states.sensor.fibaro_system_fgms001_motion_sensor_luminance_2_3.state | float == 455.0 %}
50
{% elif states.sensor.fibaro_system_fgms001_motion_sensor_luminance_2_3.state | float > 400.0 %}
50
{% elif states.sensor.fibaro_system_fgms001_motion_sensor_luminance_2_3.state | float > 200.0 %}
100
{% elif states.sensor.fibaro_system_fgms001_motion_sensor_luminance_2_3.state | float < 200.0 %}
180
{% else %}
180
{%- endif %}

but after customising the sensors (e.g. sensor.fibaro_system_fgms001_motion_sensor_burglar_2_10 to living_burglar) the script no longer works. Checking the state in the development tool gives no numbers whatever I try (e.g. states.sensor.living_motion.state or states.living_motion.state, etc).

Can anyone shed a light on what’s going on?

Help is much appreciated.

Thanks!

Hey @jilsx,

Sounds to me like the behavior described in the release notes for 0.31.

Check the blog (can’t paste the link :frowning: )

1 Like

Thanks for pointing out. Must have missed it. This solves Q1. The behaviour of the customised name still baffles me though…

I tackled something on my system recently where the template dev tab would go blank. It turned out it was because I was comparing a sensor without converting it to a float first. What happens if you look just at the value of the sensor in the template dev tool? Is it returning the expected number?

Or are you saying that the template dev tool always “blanks” for you?