Can I change the displayed state of the sensor?

Is that a zero or the letter O before 5?

@petro I am sure that there is a number 0 in front of 5, but, in any case, I tried to copy it from the output to my template and it did not help.

@Mariusthvdb, I will try it, thank you.

Send me more suggestions if you have any, but I am leaving on the business trip shortly and will not be back until Friday. I will try it all when I come back.

And guys, thank you very much for your help!!

In the dev tool template editor type in the following and see what the result is:

{{ states.sensor.alarm_panel_display.state }}
{{ is_state(‘sensor.alarm_panel_display’, ‘FAULT 05’) }}

The first line of the template editor will show you the actual status of the sensor and the second line will show you the result of the ‘is_state’ test. when you get a ‘FAULT 05’ for the status of ‘sensor.alarm_panel_display’ the result of the test in the template editor should show as True. Otherwise, for all other values of ‘sensor.alarm_panel_display’ you should get a response of False.

Open and then close the door that should give you a ‘FAULT 05’. you should see things changing in the template editor result area.

I am not home, but I found that my zone 3 was opened, so I tested it with Zone 3. Interesting result.

First, I tried this:

{{ states.sensor.alarm_panel_display.state }}
{{ is_state('sensor.alarm_panel_display', 'FAULT 03') }}

The output was FAULT 03 and False.

After that, I notices that it looks like there are some spaces in the end of FALSE 3. I copied the full line with FAULT 3 and pasted it as is:

{{ states.sensor.alarm_panel_display.state }}
{{ is_state('sensor.alarm_panel_display', 'FAULT 03                        ') }}

This gave me
FAULT 03 and True.

I guess, I have to find exact number of spaces after FAULT numbers and use them.

Thank you for your help.

just do this:

{{ states('sensor.alarm_panel_display').strip() == 'FAULT 03' }}

It will remove leading and trailing whitespace. Personally, I’d write a bug against the component. You shouldn’t have to strip whitespace.

1 Like

It worked. Thank you for your help.