I use the next_alarm_sensor in my companion app to start an automation. This worked very well, but since a few days the automation does not start at the time the sensor is stored in but some hours later (or earlier; I could not find out exactly yet). The next_alarm_sensor triggers a shelly1pm which switches on a pump.
Does anyone face the same problem and knows how to help?
If you don’t share any code, it’s really hard to help you.
A helper named “Protected Switch” switches on a shelly relay (running the pump). The Protected Switch is triggered either by the next_alarm_sensor (id handywecker) or by a hardware-button (shelly1mini; id tasterbadtuer).
Switching on by hardware-button works perfectly. Switching on by next-alarm_sensor worked perfectly also until the day before yesterday. Since then, switching by next-alarm_sensor fails. My first observation is that the automation does start, but at a time which differs from the time of the next_alarm_sensor (about five hours earlier?). I don’t know the reason why. I always update the shelly relays. Maybe something changed the firmware settings of the shellys?
This is the code of the automation:
- id: '1xxxxxxxxxxxxxxxxxxx'
alias: Zirkulation mit dem Helfer Protected Switch einschalten
description: ''
triggers:
- trigger: time
at: sensor.sm_g751b_next_alarm
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
id: handywecker
- trigger: state
entity_id:
- switch.shelly1minig3_xxxxxxxxxxxxxxxxxxxx
from:
- 'off'
to:
- 'on'
id: tasterbadtuer
conditions: []
actions:
- action: switch.turn_on
target:
entity_id: switch.protected_switch
data: {}
mode: single
The helper switch checks, whether the pump has run since the last 30 minutes and blocks it if yes.
Ok, here is the solution!
The solution is: companion-app - settings - manage sensors - next alarm - allow list
Check the allow list and remove all entries but “Clock” (com.sec.android.app.clockpackage). This is the only entry which must be active, all other entries must be deactivated!