Binary_sensor on/off

I rarely have some zwave sensors that, after triggering the binary_sensor remains in the “on” state.
I would like to create an Automation that sets the state “off”, how can I do it?

Try the following:

  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.mysensor

or
service: input_boolean.toggle
service: input_boolean.turn_on

the binary_sensor.mysensor does not work with input_boolean!

Have not tried it myself on binary_sensor, but give it a go

the problem is that, I can’t find anything that changes the state of binary_sensor on/off
I only find posts that suggest links that lead to other links that do not lead to the solution of changing the STATUS of binary_sensor
the Phython installation refers only to “sensors” and not to binary_sensors

Is this possible? A sensor is a sensor, not a switch. If it remains in the “on” state doesn’t that point to a problem in the device or template that creates the state?

1 Like

I tried the Python script above on binary_sensor, for you and sadly it does not work on binary_sensors.
Maybe a solution is to use your binary_sensor to set a toggle helper, and then use the helper in your logic. Then you can turn the heper on and off.

First it’s a sensor not a switch. You don’t update it the integration does. If it’s not working we figure out why and fix THAT

Let’s go back to this. It sounds like a problem with either your sensors or the ZWave network. Some older ZWave sensors need to be told to send status updates back to the coordinator by polling and sometimes the lifeline comms back to the coordinator gets messed up and sometimes it can just be bad communications

Has it ever beenn100% or has it acted as described since day 1?
Have you tried to repair the route for that one sensor (don’t do the whole network)
what is the make/model of the sensor? (exact model number matters)
what ZWave integration are you using
do you see any errors in the ZWave logs?

Devices with these sensors should have a button entity that allow you to manually reset the status - which effectively resets in current state in zwavejs.

I have seen some situations where I’ve used this:

  • zwave network is down because I’m doing maintenance and hence some motion sensor that hadn’t cleared are stuck in the on position. So you can press this to clear or walk around and retrigger the sensor.
  • I have an eco link alarm detector, which has a firmware bug, that causes it to remain on if I self test the smoke detectors. Before this button feature, I’d have to unpair/pair the device to get it to reset or shutdown zwavejs and edit the database file where it retains state.

That said I agree with @NathanCu - that these are all workarounds and it would be best to fix the root issue.

You are a lucky camper. Turns out I made a mistake testing the Python script. It works:

service: python_script.hass_entities
data:
  action: set_state
  entity_id: binary_sensor.ha_mode
  state: "off"

Remember to write this “python_script:” into your configuration.yaml and create folder the “python_scripts” folder.

Just be aware using this technique on a HASS restart this value will get overwritten when it reestablishes communication to zwavejs. Using the button however, does not have that issue.

Thanks for the help, I thought it would be easier, since it’s the some thing you do from State in Developer Tools. I had difficulty installing python script but, now it works.
The problem rarely occurred on some sensors, which remain active due to signal or low battery, rarely but, it happened when I armed the alarm.
Now, when I arm the alarm, it checks the batteries and ensures the Off State to all the sensors before Arming them.
Thanks again to everyone