#Window Sensor Timer: If 10min open, then notification or sound

1 messages · Page 1 of 1 (latest)

sage crag
#

I have a Zigbee sensor that allows me to see, if a window is open or not.

Now, how do I create logic, that notifies me when the window is open for longer than X minutes?

sullen wadi
sage crag
#

oohohohhoh, okay nice. Where do i find this window?

sullen wadi
#

add a state trigger

sage crag
sullen wadi
#

yeah

sage crag
#

I have no targets tho

sullen wadi
sage crag
#

On my tablet that is being used as an always-on console

#

HA is currently open on it

sullen wadi
sage crag
#

ah okay, what if i want to have HA just make a sound and change the color of the field to a bright red?

#

Can i send a message on my PC via hass agent?

sullen wadi
sullen wadi
sage crag
#

imma see what chatgpt says and if i have some issues, I come back :)

sage crag
#

yeah okay i need some help.

#

The info from Chatgpt is very outdated.

mellow badger
#

I have this automation, which sends me and my girlfriend a push notification to the phones via pushover. after 20, 30, etc. Minutes

alias: Bathroom Window Alert
description: Alert if bathroom window open 20+ min during night hours
triggers:
  - entity_id:
      - binary_sensor.badezimmer_fenster
    to: "on"
    trigger: state
conditions:
  - condition: time
    after: "20:00:00"
    before: "06:00:00"
    enabled: false
actions:
  - delay:
      minutes: 20
  - condition: state
    entity_id: binary_sensor.badezimmer_fenster
    state: "on"
  - action: notify.pushover
    data:
      message: ⚠️ Bathroom window has been open for 20 minutes 🪟
      data:
        priority: 0
  - delay:
      minutes: 10
  - condition: state
    entity_id: binary_sensor.badezimmer_fenster
    state: "on"
  - action: notify.pushover
    data:
      message: "🚨 URGENT: Bathroom window still open for 30 minutes! 🪟❄️"
      data:
        priority: 1
        sound: persistent
  - repeat:
      while:
        - condition: state
          entity_id: binary_sensor.badezimmer_fenster
          state: "on"
      sequence:
        - delay:
            minutes: 10
        - condition: state
          entity_id: binary_sensor.badezimmer_fenster
          state: "on"
        - action: notify.pushover
          data:
            message: >-
              🚨 REMINDER: Bathroom window still open! ({{ 30 + repeat.index *
              10 }} min) 🪟❄️
            target: 11_hermine
            data:
              priority: 1
              sound: persistent
mode: restart

@sage crag

sage crag
#

i want the notification be send via MQTT tho

#

into my PC

mellow badger
#

You could also set up a discord webhook probably

sage crag
mellow badger
#

I dont think its good for notifications, but if you already found a program/software for ur pc to show the mqtt notifications you can use the MQTT Notify instead of my pushover notification
https://www.home-assistant.io/integrations/notify.mqtt/

Home Assistant

Instructions on how to integrate MQTT notify entities into Home Assistant.

mellow badger
sage crag
#

i think it can be done way simpler

#

HASS.agent has some notification configuration

#

but

#

I don't know how i can select it in HA

#

wait

#

i have actually not restarted HA yet

#

.....

#

maybe i should do that

sage crag
#

Does that mean when x and x then do y OR when x or x then do y?

mellow badger
cursive quiver
sleek bane