Johboh / hassalarm

Android app for integration with Hass.io as a sensor for the next scheduled alarm on the device
MIT License
62 stars 6 forks source link

Can't get to automatically trigger #10

Closed TheOnlyMunk closed 3 years ago

TheOnlyMunk commented 4 years ago

The app broadcasts fine and hass updates the next alarm. I can manually trigger the automation, and it does what it's supposed to. But the value template does not seem to work?

I implemented it from the UI and edited until it looked correct (for easier editing in the future) Here it is:

image

Restarted hass without luck.

Johboh commented 4 years ago

@TheOnlyMunk Hello! What if you try the statements separately in the template editor/viewer under development tools in hass? E.g. try:

{{ states('sensor.date_time') }}
{{ state_attr('input_datetime.next_alarm', 'timestamp') }}
{{ state_attr('input_datetime.next_alarm', 'timestamp') | int | timestamp_custom('%Y-%m-%d, %H:%M', True) }}

And see what they yield. For me they output:

2020-02-04, 19:08
1580876280.0
2020-02-05, 05:18
TheOnlyMunk commented 4 years ago

apparently it works - when I was testing by setting an alarm 1-2 minutes ahead of the current time, I didn't fire, but overnight it did.

Johboh commented 4 years ago

@TheOnlyMunk yes it can take up to an hour until the time is synchronised after the next alarm is changed.

TheOnlyMunk commented 4 years ago

@TheOnlyMunk yes it can take up to an hour until the time is synchronised after the next alarm is changed.

Ahh so that's the thing you meant in the readme. I was confused since i thought it was the app that didn't post within an hour

Johboh commented 4 years ago

@TheOnlyMunk Can I close this one?