#Binary Sensor Notification

1 messages · Page 1 of 1 (latest)

chrome island
#
alias: Grid Notifier
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.grid_power_status
    attribute: sensor_value
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 0
      seconds: 15
conditions: []
actions:
  - action: notify.notify
    metadata: {}
    data:
      message: Grid Now Offline
mode: single

hey, I have this basic notification to try to basically notify me if the grid goes down. the trigger doesnt seem to go off properly though. What am I missing here?
Here's the history for the sensor, usually it's either on/off, but sometimes it does go to unknown.

sand dragon
#

remove the line with attribute: sensor_value

#

you want to trigger on the state itself, not on an attribute value

chrome island
#

🤔 i see. what would be an example of where i would use sensor_value?

sand dragon
#

no clue, I don't have any binary sensors which have that attribute

fast hamlet
#

To be clear, you use the attribute option only when you want to trigger on a sensor’s attribute and not its state.

Placing sensor_value in the attribute option looks like something AI would make up.

sand dragon
#

based on the metadata: {} line in the action it looks GUI made.
I assumed it might be a binary_sensor based on a sensor value, so e.g. on if sensor_value is above 5. So it could put that sensor value in an attribute as reference.

#

@chrome island using notify.notify is not really reliable, it uses the first notify service it can find. You'd better select a notify service belonging to a device, to ensure you know where it will end up

chrome island
chrome island