💬 Entity State Notification

I really appreciate the work done here! Thanks. I’m looking for something similar - where HA will notify me when windows/doors are open at a certian time. Maybe I only need to change this area?

    for_time_m:
      name: For Time
      description: Duration the sensor must be in state
      default: 0
      selector:
        number:
          min: 0
          max: 59
          step: 1
          mode: slider
          unit_of_measurement: min

While not a blueprint, if anyone is attempting to do what I mentioned, please see:

Hi, yes I will revise this blueprint and add a custom condition. I actually wanted to have implemented this much earlier. Shame on me.

Hello everyone, is there a possibility to get a message like “The Window X ist open since 10 Min” and in every reminder message “The Window X is open since 20 Min” and so forth. I also want to stop the notifications after 60 mins even if the window is still open.

1 Like

Try this:

The window {{ entity_name }} is open since {{ ((now() - [sensor] | expand | map(attribute='last_changed') | first).total_seconds() / 60) | int }} Min.

That works perfectly!
For the first notification. It seems, that for the periodic notification the values are not re-evaluated. So, I always get “The window is open for 10 minutes” and not “The window is open for 10 Minutes” and with the next “… open for 20 Minutes” etc.

@panhans It looks like, that the repeated messages are not set at all. The timestamp on the notification on my android phone does not change. When I swipe it away it does not reappear after 10 mins.

I have set up a new automation with this blueprint, added just one windows sensor and nothing else. Set “for time” and “periodical notification”
I received the first notification, but not the periodic one.

I used blueprint version 2.2.1 and latest HA.

Anyone else having the same issues?

Hey, I will check this after my holidays. Did you checked the logs or the automation trace if an error occurs?

I used another blueprint at it was able to send out repeated information. So in general it works.

@panhans any news here? I like your blueprint, and don’t want to switch to another solution. Just the repeated messages is missing.

For me it works. The time changes, too. Please, check your logs or the automation trace if there is an error.

Hi,

this is my YAML:

alias: Fenster offen Zeitraum
description: ""
use_blueprint:
  path: panhans/entity_state_persistent_notification.yaml
  input:
    sensor_entity:
      - binary_sensor.burofenster
      - binary_sensor.schlafzimmerfenster
      - binary_sensor.badezimmerfenster
      - binary_sensor.terrassentur
      - binary_sensor.esszimmerfenster_links
      - binary_sensor.esszimmerfenster_rechts
      - binary_sensor.gastezimmerfenster
      - binary_sensor.hauswirtschaftsraumfenster
      - binary_sensor.gastebadfenster
      - binary_sensor.barfenster
    notify_device: 6152c3d6a15cd34151a87fd05c860dd2
    message: >-
      {{ states[trigger.entity_id].attributes.friendly_name }} ist seit {{
      ((now() - [sensor] | expand | map(attribute='last_changed') |
      first).total_seconds() / 60) | int }} Minuten offen.
    for_time_m: 1
    period: 1
    stop_button_text: Erinnerung beenden
    persistent_notification: true

The first notification works and after that no more notifications are sent. I saw an error in the trace:

What is wrong here? :thinking:

Cheers

Try change it like this:

{{ entity_name }} ist seit {{ ((now() - [sensor] | expand | map(attribute='last_changed') | first).total_seconds() / 60) | int }} Minuten offen.
1 Like

Oh yes, that’s it. Many thanks @panhans! :smiley:

Is it possible to define a period in which you want to be notified? It would also be cool if you could make the period dependent on the outside temperature. :innocent:

The stop notify function not working for me on iPhone…it is keep notifying me…

Or based on the ext and int temp…

Is there still the plan to add custom actions and conditions?

@viruz
@Korte
@Bastian007

Just updated the blueprint. Now custom conditions and custom actions are supported. Feel free to test and give some feedback.

Hi, Thank you for the update.
But when i create a new automation, i receive error 500 when try to save it.