📍 State Notifications & Actions

@chesedro

Hi Tom, welcome to the community.

I just tested it here on a iPhone and Galaxy S8 and it is all working fine. Make sure you understand channels if you are using them.

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :smiley:

Thanks for your help on this. This is a test automation I created to troubleshoot. Nothing fancy. I feel like it’s something simple. maybe even on the phone itself. I did test with “High Priority” “Sticky” and “Notification Channel” same result. they all work fine until I enable the Start action button. Thanks again for your help on this.

To add: I created a quick automation manually but this time I used the Call Service Notification: this does work and presents the button in the notification just fine. Not sure what is different between the two methods.

`alias: Test-Notify
description: ""
use_blueprint:
  path: Blackshome/state-notifications-and-actions.yaml
  input:
    entity_a_trigger:
      - switch.living_room
    entity_a_state: "off"
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 0cb6a2d576dfe8bbf2d25d7bcc4cdb2b
    start_title: Not sure
    start_message: Will this work
    start_notify_data:
      - high_priority
    include_start_action_buttons:
      - enable_start_action_button_1
    start_action_button_1: Work Please
    include_start_auto_actions: []
    start_action_1:
      - service: switch.turn_off
        metadata: {}
        data: {}
        target:
          device_id: e32dcfd1b314bcc632dbb603dfb35d85
    start_time_delay:
      hours: 0
      minutes: 1
      seconds: 0
    include_start_action_button_confirmation: disable_start_action_button_confirmation
    start_notify_interruption_level: active`

@chesedro

Hi Tom,

I can see the problem now. It is not really a bug, but I will need to address it. With Android if you don’t put a name in the cancel button it will not work :pensive:. With iOS it will work :person_raising_hand:. So others don’t have this problem into the future I will have to add a default in. Below is your YAML. Copy and paste it in as I also saw there were quotes that shouldn’t be there, I think it was when you pasted it into this forum :face_with_diagonal_mouth:

Thanks for reaching out and letting us know as this will help other in the future :+1:

Your YAML below, copy it and replace your YAML.

alias: Test-Notify
description: ""
use_blueprint:
  path: Blackshome/state-notifications-and-actions.yaml
  input:
    entity_a_trigger:
      - switch.living_room
    entity_a_state: "off"
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 0cb6a2d576dfe8bbf2d25d7bcc4cdb2b
    start_title: Yep Working!
    start_message: Your Welcome, Blacky :)
    start_notify_data:
      - high_priority
    include_start_action_buttons:
      - enable_start_action_button_1
    start_action_button_1: Work Please
    include_start_auto_actions: []
    start_action_1:
      - service: switch.turn_off
        metadata: {}
        data: {}
        target:
          device_id: e32dcfd1b314bcc632dbb603dfb35d85
    start_time_delay:
      hours: 0
      minutes: 1
      seconds: 0
    include_start_action_button_confirmation: disable_start_action_button_confirmation
    start_notify_interruption_level: active
    start_action_button_stop: Cancel?

Let us know how you go.

Blacky :smiley:

Blacky,
That worked perfect. such a simple thing. Thanks so much. I do appreciate all your help with this.

T

Tom,

No problem your welcome, it is updated with a warning now. Push the update and you will receive it.

Blacky :smiley:

New Update 1.4

:toolbox: Maintenance

  • Updated descriptions warnings on action buttons that may prevent the automation from functioning correctly and could result in not receiving the notification.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

is there a way to show the action button direct, without expand the notification manuelly?

thanks for sharing...

1 Like

@stephanschleichstr13

I am assuming this is for iOS devices. To my knowledge no :pensive: I wish there was… and I also wish there was an option to keep it there when you tap on it and it just doesn’t disappear. Android allows this but iOS doesn’t.

Blacky :smiley:

1 Like

Im using Android :slight_smile:
But no problem, its only nice to have, blueprint works great thanks for that.

1 Like

I am getting the following error in the System Log:

Error initializing 'Notify: Family Room Presence Stuck' trigger: In 'numeric_state' condition: entity binary_sensor.family_room_presence_presence state 'on' cannot be processed as a number

I wonder what I have configured wrong?

Here is my YAML:

alias: "Notify: Family Room Presence Stuck"
description: ""
use_blueprint:
  path: Blackshome/state-notifications-and-actions.yaml
  input:
    entity_a_trigger:
      - binary_sensor.family_room_presence_presence
    time_delay_a_state: 60
    start_notify_device:
      - 8fa2ea63fcc3370f9a13b4adabc08a60
    start_title: Stuck!
    start_message: Family Room Presence Sensor Stuck - been Detected for 1 hour!!
    entity_a_state: Detected
    entity_b_trigger:
      - binary_sensor.family_room_presence_presence
    entity_b_state: Clear
    time_delay_b_state: 0
    include_start_notify: enable_start_notify_options

@clowgg

Thanks for the info, I will have a look at it when I get back for holidays.

Blacky :smiley:

Hi @Blacky

is there any way to notify devices that are in a specific zone? for example, devices inside of “home”

@eerison

Welcome to the community.

If you are only notifying one device it easy as you just use the custom conditions and add the device as a condition.

I am going to look at adding this feature.

Blacky :smiley:

1 Like

Hey @Blacky
Thank you for your quickly answer.

Well i would like to notify all users that are at home.

Maybe a field on notification called zone. And there i could specify the zone that i want.

Note: in case I could pass a list of zones, it would be amazing, if not one helps a lot.

@eerison

Thanks for your input and your suggestions.

You will probably see it in my :loudspeaker: Notifications & Announcements BP first and then it will flow out to all the others.

Blacky :smiley:

@clowgg

I will be working on this error log but one thing I noticed in your YAML, your state is Detected. Not sure if that is working for you but have a look at the state in developer tools and match it. I may say on, note it is also cap sensitive.

Blacky :smiley:

I’ve checked the sensor in Dev Tools and it currently shows as ‘on’.
So I’ve changed the setting in the Automation to ‘on’.
I assume the clear state will be ‘off’ - so I set that in the End Trigger - Fixed State Option too.

Then I checked the System\Logs and saw this:

Logger: homeassistant.components.homeassistant.triggers.numeric_state
Source: components/homeassistant/triggers/numeric_state.py:153
integration: Home Assistant Core Integration (documentation, issues)
First occurred: August 30, 2024 at 2:45:00 PM (12 occurrences)
Last logged: 10:55:13 PM

Error initializing 'Notify: Family Room Presence Stuck' trigger: In 'numeric_state' condition: entity binary_sensor.family_room_presence_presence state 'off' cannot be processed as a number
Error initializing 'Notify: Family Room Presence Stuck' trigger: In 'numeric_state' condition: entity binary_sensor.family_room_presence_presence state 'on' cannot be processed as a number

@clowgg

Yes thank you… I can see it too but I thought I get you going first and then fix the problem. It is only a log issue and the automation will work.

Blacky :smiley:

Thanks for the help Blacky.

1 Like