Stuck automation + z-wave plus door sensor

have HA running 0.94.x on rpi3.

installed zwave usb + added device in HA /dev/xx > installed eco link door sensor on door> paired sensor with HA. pic below.

i made an automation based on the changing state of the sensor.( state changes on/off when i open and close)

My issue is the automation wont trigger when the door closes. BUT if I trigger the automation manually it does(i get an email). what am i doing wrong ? (state> entitiy>sensor.ecolink_door_window_sensor_access_control: [on|off])

PS the values that change in the screenshot when the door closes or opens are
Window sensor sensor goes from OFF if the door is closed to ON when it opens
Window Sensor Access Control from 23 when closed to 22 when opened

Need to post the automation

  alias: test
  trigger:
  - entity_id: sensor.ecolink_door_window_sensor_access_control
    from: '23'
    platform: state
    to: '21'
  condition: []
  action:
  - alias: ''
    data:
      message: Intruder alert at apartment!!
      title: Intruder alert
    service: notify.homeass

22 maybe?

alias: test
  trigger:
  - entity_id: sensor.ecolink_door_window_sensor_access_control
    from: '23'
    platform: state
    to: '22'
  condition: []
  action:
  - alias: ''
    data:
      message: Intruder alert at apartment!!
      title: Intruder alert
    service: notify.homeass

Why are you using this entity?

You should be using the binary sensor for the device. You didn’t post the entity_id’s for the device but going by your picture above you should be using the entity_id for the last thing on the card (the entity that shows “On”).

assuming the entity_id for that is “binary_sensor.ecolink_door_window_sensor” then change your trigger to:

trigger:
  - entity_id: binary_sensor.ecolink_door_window_sensor
    platform: state
    to: 'on'

@ tmjpugh yea i noticed and it started working with that # change. was waiting for mod to approve the config when i realized it. BUT ill have to look at what
finity said because that may be better practice. Thank you

It’s definitely the better practice because that is literally the point of the binary sensor. There is no other reason for that binary sensor outside of telling you the status of the thing you are monitoring.

lol what are the other entitys for then? several seem redundant ? also on the Overview page what does the switches do ? i get for like lights or music but seems weird to turn on a door sensor

In a normal users home automation setup the rest of the sensors are definitely useless. Most of them will never ever change state. The access control, alarm level and/or burglar sensors might change (or they might not) depending on the state of the binary sensor and the report type that is selected. I’ve seen some sensors that either weren’t set up correctly or didn’t offer a binary sensor and the alarm level could be used to create a template binary sensor because the state of that sensor when the sensor was “on” was 255 and something less than that when it was “off”. But that sensor also could be other values depending on some other status of the device.

Sometimes those other sensors might tell you if the device has been tampered with because the cover is removed. or it detected vibration, or… who knows what else you will never really need to know.

But Like I said, the binary sensor will never tell you anything other than whether the monitored parameter (in your case) is open or closed.

Most of the time I just hide all of the other entities except the zwave.xxx entity and never look at them. That zwave.xxx entity will show the overall state of the device (ready, initializing, dead, etc)

I’m not following you here. What overview page and/or what switches? If you’re talking about the screenshot above I don’t see any switches in there.

I remember why i didn’t use this before because it would not work with the automation. but the integer value entity would. verified by no longer receiving emails. The switches I’m referring to are shown below

you 'll have to point out the switches you are referring to in that screenshot. there are several and I don’t know which ones you are asking about.

It probably wouldn’t work in the automation because you were using the wrong entity_id and state.

the nobs that turn blue when you slide them to the right ??? the things next to the names of devices or w.e, on the right-hand side ??? i know I’m not crazy.


im choosing the entity from the drop-down(no other binary sensors). used the correct to and from state. nothing

Alright then let’s take each box individually…

ex

the switch at the top is there because there is a switch called “backyard” in the card. Any card that has a switch in it will have a switch in the header by default that then controls the state of all of the switches in the card. You can remove that top header switch in the lovelace config.

ex2

The switch in the header is there for the same reason as the one above - there is an entity that has a switch associated with it. In this case it is a switch to turn the “Back Door” automation on or off (enable or disable it). It can also be removed.

ex3

this is the one I’m not sure about. Maybe there is some strangeness in the code that detects the door sensor’s binary sensor as a switch. But I’m pretty positive it has no real purpose for either of the entities in the card. you can remove that there as well.

Did you save the automation when you made the change and then reload your automations?

the other thing I see is that you have to make sure that you are using the correct syntax on the options and remember that capitalization is important. try changing the “On” & “Off” to “on” & “off” and it should work after you reload the automation.

thank you for clarifying the switches thing. im copying and pasting from the entity pop window directly. ill be sticking with the original entity because the integer 22-23 seems to work and not the binary sensor. not the end of the world but will consider it if i get diff brand sensors in the future. Thanks again

yes and that won’t work.

the front end cards show a “pretty” formatted version of the true state of the entity. For example a device tracker entity will show “Home” or “Away” on the frontend but the actual entity state is “home” or “not_home” if you look in the states page for that entity. the displayed format depends on the device class. In your case the device class is a binary sensor so it will display “On” or “Off” on the front end to make it “pretty” for you to look at. but in actuality the true state is “on” or “off”.

try it. I’ll bet it will work.

EDIT: I guess the only other thing that would make it not work is if the binary sensor isn’t actually not changing state when you open or close the door. If that’s the case then you have a defective device and has nothing to do with the automation config.