Get an indication if power to my ZSE70 is cut

Greetings,

I’ve got a ZSE70 motion sensor on the corner of my house, that via an automation in Home Assistant it works wonderfully.

As the thing is mounted a bit out of the way, I’ve got it plugged into an outlet on the corner of the house, and the batteries have been removed.

Unfortunately, this outlet is switched. And yes, the switch has already been inadvertently toggled.

So, I’m trying to develop an automation to send me a notification in the event the sensor is not seen for a set amount of time.

Thusfar, I’m not succeeding

This is my yaml:

alias: outdoor.motion_sensor_power_switch_off
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.node_3_last_seen
    attribute: Minutes
    above: 5
conditions: []
actions:
  - action: notify.e_mail
    metadata: {}
    data:
      message: The power to the motion sensor has been turned off
      title: Alert
      target: [email protected]
mode: single

Any ideas?

Thank you

You know this will only trigger when the sensor.node_3_last_seen changes from 00:05:00 to 00:05:01. You might want to switch to having as a condition and checking every 5 minutes or using a helper variable.

Put a child proof switch cover over the light switch.

Is it being recognized as a battery powered node or a line powered node?

There are a couple of other entities that I can look at. Will report back.

Ok.

The only entity that changes is: sensor.node_3_last_seen.

Just for fun, I created a dashboard to display the value:

Sorry to be pedantic, but HA YAML baffles me no end.

How in the world do I trigger something based upon this sensor > 5 minutes?

And yes, I will get a cover, but for now the engineer in me wants to make this work.

Thank you

Like this:

  triggers:
    - trigger: time_pattern
      # You can also match on interval. This will match every 5 minutes
      minutes: "/5"

But more importantly let me show you how to start fishing.

In google type

homeassistant trigger

or homeassistant condition

it should show you this

or this

there is alot of documentation that you can read online.

Hope this helps

Well,

I got help from Claude.ai.

Crafted this:

alias: outdoor.motion_sensor_power_switch_off.automation
description: ""
triggers:
  - for:
      minutes: 1
    value_template: >-
      {{ (now() - states('sensor.node_3_last_seen') |
      as_datetime).total_seconds() > 300 }}
    trigger: template
actions:
  - data:
      message: The power to the motion sensor has been turned off
      title: Alert
      target: [email protected]
    action: notify.e_mail
mode: single

Problem is, the value gets updated very irregularly. Since I stood this up, I’ve gotten 6 e-mails, even though the sensor is on.

Oh well.

So, a brilliant user from the zooz forum suggested this approach, which works beautifully:

alias: outside.probe.zwave.node.status.automation
description: ""
triggers:
  - trigger: time_pattern
    minutes: /5
conditions: []
actions:
  - action: zwave_js.ping
    metadata: {}
    data:
      device_id:
        - abd5f3a34395c11afa32983c081b6e66
  - if:
      - condition: device
        device_id: abd5f3a34395c11afa32983c081b6e66
        domain: zwave_js
        type: node_status
        status: dead
    then:
      - action: notify.e_mail
        data:
          message: ZSe70 is down!
          title: Alert
          target: [email protected]
mode: single

Let’s call this topic closed!