I have a couple automations that are meant to trigger an Alexa Actionable Notification and put the house in “night mode” when my phone is plugged in between 12pm-6am. For about 4 days, it worked flawlessly. It didn’t matter if I’d touched my phone in hours, if I plugged it in my automations would run immediately. If anyone’s curious here is the config:
- id: '1614470588834' alias: Trigger night mode with battery state description: If iphone begins to charge after midnight, trigger night mode actionable notification trigger: - platform: state entity_id: sensor.merediths_iphone_battery_state to: Charging condition: - condition: and conditions: - condition: time before: 0:06:00 action: - service: script.activate_alexa_actionable_notification data: text: Meredith, would you like me to put the house in night mode? event_id: actionable_notification_meredith_bed alexa_device: media_player.echo_dot_2 mode: single
Then depending on whether I tell Alexa yes or no, it will run a script that turns everything off and arms alarms and such.
Yesterday the first automation just stopped triggering when I plugged in my phone. It works fine if executed manually.
I deduced that it’s the sensor.iphone_battery_state entity, it’s not updating at all anymore unless I’ve had the app open in the last 10 seconds. I’ve double checked that 20 second periodic updating is turned on and the HA app has permission to run in the background. I’m quite frustrated because I was really stoked about getting actionable notifications up and running and using it for this. But it doesn’t serve much of a purpose if I have to remember to open the app every night when I lay down for bed
Does anyone know a work around or maybe a suggestion for another way to trigger stuff like this? Maybe another app that will report state changes faster?
I’d love to rig up a bed occupancy sensor eventually but it’ll be a while before I can do that.