I have an automation that switches stuff off at night, and sends a iOS notification when it’s done (last line in the action block) but for some reason it seams to execute several times.
For example last night it sent me 60(!) notifications and no errors or warnings were logged…
- alias: 'Switch Everything Off'
trigger:
- platform: time
hours: 1
minutes: 0
condition:
- condition: state
entity_id: device_tracker.iphone
state: 'not_home'
action:
- service: shell_command.phue_livingroom_off
- service: shell_command.phue_bathroom_upper_off
- service: shell_command.phue_bathroom_lower_off
- service: shell_command.phue_kitchen_off
- service: shell_command.phue_bedroom_off
- service: shell_command.phue_lounge_off
- service: shell_command.phue_office_off
- service: shell_command.phue_guestroom_off
# - service: media_player.sonos_unjoin
- service: media_player.turn_off
entity_id:
- media_player.bathroom_lower
- media_player.bathroom_upper
- media_player.bedroom
- media_player.kitchen
- media_player.living_room
- media_player.lounge
- media_player.office
- media_player.office
- service: notify.iOSapp
data:
message: 'Music and lights were switched off, good night.'
title: 'House is sleeping'