I’ve been messing around with this clock.
It worked at one point. But now out of nothing it doesn’t anymore.
Problem seems to be that the trigger never gets to be true.
I use the following code as part of the trigger.
value_template: ‘{{ states.sensor.time.state == states.sensor.alarm_time.state}}’
When tested in templates while I now the times should match it still gives out a false result.
Looked at the single parts they both give the same value in that time frame.
What to do?
Found out what was wrong. Alarm Time Hours need to be in 2 digits format.
I use the alarm clock, but want to use several alarm clocks (one for me and one for each of the kids). How do I get it? Do I have to duplicate the entire code and rename the switches, script, input slider, input bolean … or can I use any of it as it is?
Programming is quite new to me so i need some help …
Yes, I believe renaming the entities is mandatory, but the good news is: you could automate it !
The template devtool is your friend in your exploratory operations, invaluable in code generation and substitution, every session is bountyful and likely to end with a quick copy and paste.
I found post#73 to be very informative at the time: a very nice rewording of the actual documentation on automation template and time triggers. tldr:
leverage the time_date platform in value_template just like yours: '{{ states("sensor.time") == states("sensor.alarmclock_lights_time") }}'
the other option is to trigger evaluation every ‘/n’ time unit with a time platform trigger since at: won’t take a template.
Relative time calculations can horribly complexify the template expression. I, for myself, try to stick to kiss approach, favoring decoupling in general and ultimately thinking packaging when it comes to my configuration.
I had the same problem with the time and changed the script from (now().strftime("%s") | int | timestamp_custom("%H:%M")) to as_timestamp (now()) | timestamp_custom("%H:%M") and now everything works fine.
@mbonani can it be the configurations of time zone being different between Home Assistant and Resin OS??
I’ve tried to gain access to Hassio core via ssh on port 22222 but it gives me an error using Putty “Disconnected: No supported authentication methods available (server sent: publickey)”. I’ve used this: https://home-assistant.io/developers/hassio/debugging/
Can you please confirm if the timezone configuration is different?
$ ssh -p 22222 [email protected]
root@hassio:~# date
Sun Aug 20 00:08:48 UTC 2017
$ ssh [email protected]
core-ssh:~# date
Sat Aug 19 20:09:55 EDT 2017