Dealing With Window/Door Sensor 254 State

Just started rolling out some z-wave Window and Door sensors.

I get the state 22 when Open and 23 when Closed I made these wife friendly with a template sensor for each… e.g.

- platform: template
  sensors:
front_door:
  value_template: '{% if is_state("sensor.front_door_access_control_3_9", "22") %}Open{% else %}Closed{% endif %}'
  friendly_name: 'Front Door'

But when sleeping the sensors report 254 so when Open(22) for long enough falsely reports Closed(else).

How are you guys handling this in your set ups and ignoring the 254 state. Will changing the sensor to binary in OZWCP solve this? Or is there another more ingenious way?

You could have an automation that is triggered
from: 22
to: 254
=> then keep the state as open

and another automation
from: 23
to: 254
=> then keep the state as closed

This is because it depends on the state it is in when it goes to sleep

Then change your template sensor to elif is_state(“sensor.front_door_access_control_3_9”, “23”) instead of just else

…Or maybe just change to elif and it will just keep whatever state it was in before, so you wouldn’t need the automations. If that doesn’t work then do the automations above.

Use an elif before the else… {% elif is_state("sensor.front_door_access_control_3_9", "254") %}Sleeping{%else%}...

You can change sleeping to anything or nothing.

Changing the setting in OZWCP to binary sensor should solve your issue without templating. I don’t have a door/window sensor but did the same with a few motion sensors.

@stunts1337 Tried just changing he elif but it reports blank for the 254 state. I think your automation idea is the way I’m going to have to go. Although it feels a little dirty and iv never changed a sensor state via an automation before. Have you?

@PtP Thanks for the suggestion but this would cause all my sensors to reports ‘Sleeping’ the majority of the time .

@thrust15 Iv done this for motion sensors as well however unfortunately there doesn’t seam to be a way to change the strips to binary i think they may already be reporting that way.

I guess you’re using the Sensative Strips. You can definitely change their setting in OZWCP to binary sensor (change ‘notification report’ to ‘binary report’). If you then customize the device_class of the binary sensor to ‘opening’, you’re all set …

Yes sensitive strips!

I have set the sensor to ‘Binary Sensor Report’ seams it wasn’t sticking before because i neglected to wake it up first!
I now have a new sensor “binary_sensor.front_door_sensor_3_0” which reports On/Off. For open closed.

The previous “Access control” sensor is still present but permanently reporting 254. Is it usual for it to still be present?

Thank you so much for chiming in @pav

I guess it’s normal for the other sensors to still be present - at least that’s what happens with mine too. I just customize them to be ‘hidden’, as I don’t find them particularly useful. I assume all your automations can be based on the binary sensor’s state, as are mine … ?

Yes i can’t think of anything i intend on doing relying on the other values. I think ill hide them too. Im so pleased this is sorted. I take you’ve been using the binary sensor for some time and do not get any any other value other than on or off?

Thanks again @pav

You’re most welcome. But to be honest, I’ve only just begun with HASS, the strips and some more Zwave devices, so most of the time these devices have been sitting on my desk - makes the testing easier :slight_smile:
Regarding the strips: I haven’t seen them showing any other state than the on/off, BUT… I’m a bit suspicious because they seem to revert to the ‘open’ or ‘on’ state for no good reason after some time. I’m still in the process of finding out who or what is to blame : the product itself (hope not), or OpenZwave, or Hass …
Searching the net the only related mention I’ve found suggested this may have to do with their post-wakeup behaviour - or the way this was treated software-wise, so this made me not much wiser…

Been testing these since we last spoke. Iv had really good results so far i have 20 which report and keep status closed/off and 1 i left open which is still reporting open/on. This is after multiple restarts and a HASS update.