I have the following automation to notify me if garage door left opened for more that 7 minutes.
I do get the message in my android phone but when I push the notification button (in phone) to close the door won’t do do anything.
Does anybody know if it’s something wrong in the automation or in my phones setup?
Now that I am posting it I wonder if it would be better to use service: switch.toggle ?
`#Garage Door Opened for sometime
- alias: Notify apps when Garage Door open
trigger:
platform: state
entity_id: binary_sensor.openclose_18
from: 'off'
to: 'on'
for: '00:07:00'
action:
service: notify.mobile_app_sm_g955f
data:
message: The garage has been left open
data:
actions:
- action: close_garage
title: Close Garage Door
- alias: Close the garage when notification action is tapped
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: close_garage
action:
service: switch.turn_off
entity_id: switch.sonoff_100082f95b
Sorry, mine stopped working too but I don’t know when. Maybe there was a code change? If I monitor the events for mobile_app_notification_action in the developer console and I push the action button on the message, nothing happens. There seems to be a lot of chatter about this but no one with a solution. Here is one of my actions which used to work. Code not changed since deployed but HA upgraded to 0.111.4.
- alias: Turn on foyer lamp when notification action is tapped
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: foyer_on
action:
service: light.turn_on
entity_id: light.foyer_front_light
not sure what you are talking about
but
in the events / event type
if I add “mobile_app_notification_action” and fire the event my garage door is opening?
is that right? I don’t think it should open it
I get nothing (in events monitor with *) when I push the notification but the app says “Failed to notify HA of picked option”. Maybe my image URL formatting is not right? It was working when I first set it up.
automation:
- alias: Notify apps when the lamp if left on
trigger:
platform: state
entity_id: light.family_room_lamp
to: 'on'
for: '0:01:00'
action:
service: notify.mobile_app_nokia_7_1_app
data:
message: "Lamp was left on for one minute"
data:
image: http://10.0.1.200:8123/local/lamp.jpg
actions:
- action: "lamp_off" # The key you are sending for the event
title: "Turn off Lamp" # The button title
I changed before a while to toggle, but I have to test it later or tomorrow when I got out of home.
I don’t really understand why the "mobile_app_notification_action”
toggles my garage door though when I just fire the event.
in the automation we have to point the service we want
eg
Nope, does not work without the image either. Anyone see anything wrong below?
automation:
- alias: Notify apps when the lamp if left on
trigger:
platform: state
entity_id: light.family_room_lamp
to: 'on'
for: '0:01:00'
action:
service: notify.mobile_app_nokia_7_1_app
data:
message: "Lamp was left on for one minute"
data:
# image: http://10.0.1.200:8123/local/lamp.jpg
actions:
- action: "lamp_off" # The key you are sending for the event
title: "Turn off Lamp" # The button title
- alias: Turn off lamp when notification action is tapped
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: lamp_off
action:
service: light.turn_off
entity_id: light.family_room_lamp
When you wrote the automation, you defined an action (above) called close_garage and this is being used as a reference to invoke your garage door toggle in the secondary automation where again close_garage is defined.
The trigger has 2 parts, first the event_type “mobile_app_notification_action” and second the action in event_data. So it will only fire if the action intheevent data matches the trigger in your automation.