I’m trying to set up some automations which give actionable notifications, but each time i get something wrong then restart hassio, the frontend won’t load, so i need some help on the configuration to get actionable notifications working how i want them.
I want a notification when my device leaves home with an option to turn all lights off (If any are still on)
I want a notification when my device arrives home with an option to turn all lights on
I want a notification if my usb webcam (using motion addon) detects movement with an option to raise an alarm (which will currently just be flashing my lights red), and I would like the notification to have the webcam stream as part of it’s content (i have seen on a hassio blog post that this is possible)
OK, I got it working and I get the options on my phone, however when I press the action nothing happes, and nothing in my log either…if you dont mind taking a look I would apprecaite it.
push:
categories:
- name: basement_lights
identifier: 'basement_lights' #this name has to match the category name
actions:
- identifier: 'Basement_ON'
title: 'Basement Lights On'
- identifier: 'Basement_Off'
title: 'Basement Lights Off'
- alias: basement action
trigger:
platform: state
entity_id: binary_sensor.basement_motion
action:
service: notify.ios_da
data:
message: "You need me to do somethin with the lights?"
data:
push:
badge: 0
category: "basement_lights"
- alias: 'basement lights on'
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: 'Basement_On'
action:
- service: homeassistant.turn_on
entity_id: light.bar
- service: homeassistant.turn_on
entity_id: light.game_room
- service: homeassistant.turn_on
entity_id: light.home_theater
- alias: basement lights off
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: 'Basement_Off'
action:
- service: homeassistant.turn_off
entity_id: light.bar
- service: homeassistant.turn_off
entity_id: light.game_room
- service: homeassistant.turn_off
entity_id: light.home_theater
As a side note, you can combine things like this all in one file and place it under packages. I haven’t done it as much as I should but it will allow you to combine automation, scripts, etc. in one file to make it easier for troubleshooting.
automation old:
####### THIS IS THE TRIGER #####
- alias: leaving home
trigger:
- platform: zone
entity_id: device_tracker.iphone
event: enter
zone: zone.home
action:
service: notify.ios_iphone
data:
message: "You have left home, do you want to turn the lights off?"
data:
push:
badge: 0 # this will remove the badge/app icon number
category: 'left_home' #this has to match with identifier name
############ this is the action when you click on button ####
#### button 1
- alias: turn off lights
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: LIGHTS_OFF
action:
service: light.turn_off
entity_id: light.bottom
but in the app the ios component and notify platform say they have not been loaded (even after pressing save again and updating push settings in the app)
any suggestions? also what’s the best way to have multiple actions as a result of the pressed notification, e.g. turning off multiple lights at once
ios:
push:
categories:
- name: left_home
identifier: 'left_home' #this name has to match the category name
actions:
- identifier: 'LIGHTS_OFF'
title: 'Turn Lights Off'
destructive: yes
- name: arrived_home
identifier: 'arrivedhome' #this name has to match the category name
actions:
- identifier: 'LIGHTS_ON'
title: 'Turn Lights On'
automation old:
####### THIS IS THE TRIGER #####
- alias: leaving home
trigger:
#- platform: zone
#entity_id: device_tracker.iphone
#event: leave
#zone: zone.home
platform: state
entity_id: light.bottom
action:
service: notify.ios_iphone
data:
message: "You have left home, do you want to turn the lights off?"
data:
push:
badge: 0 # this will remove the badge/app icon number
category: 'left_home' #this has to match with identifier name
############ this is the action when you click on button ####
#### button 1
- alias: turn off lights
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: LIGHTS_OFF
action:
service: light.turn_off
entity_id:
- light.bottom
- light.middle
- light.top
- light.bridge
- alias: arriving home
trigger:
#- platform: zone
# entity_id: device_tracker.iphone
#event: enter
#zone: zone.home
platform: state
entity_id: light.bridge
action:
service: notify.ios_iphone
data:
message: "You have arrived home, do you want to turn the lights on?"
data:
push:
badge: 0 # this will remove the badge/app icon number
category: 'arrivedhome'
- alias: turn on lights
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: LIGHTS_ON
action:
service: light.turn_on
entity_id:
- light.bottom
- light.middle
- light.top
- light.bridge
right so i’m just using the state of different lights as a trigger for testing, and I’ve found that it works perfectly for leaving home, turning the lights off. However with the arrived home, the notification shows but the action option doesn’t