I’ve been tackling this for a few months (since daylight saving came in to effect) and have sort of lived with it…
The time on my NSPanel is out by an hour, showing UTC/GMT, and NOT BST (as it currently is here in the UK).
So right now, the time is 17:45, by the NSPanel displays 16:45.
HA is running in Docker
The host PC time is correct.
The time I can view within HA are correct.
But the NSPanel remains -1Hr.
Code for Time display on NSPanel is below:
# Time component that fetches time from Home Assistant and updates the display once a minute and when the display is ready at bootup (and time is available).
time:
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: 0
minutes: /1
then:
- lambda: id(disp1).set_component_text_printf("Home.time", "%02i:%02i", id(homeassistant_time).now().hour, id(homeassistant_time).now().minute);
- lambda: id(disp1).set_component_text_printf("Home.date", "%i-%02i-%02i", id(homeassistant_time).now().year, id(homeassistant_time).now().month, id(homeassistant_time).now().day_of_month);
on_time_sync:
then:
- wait_until:
switch.is_on: nextion_init
- lambda: id(disp1).set_component_text_printf("Home.time", "%02i:%02i", id(homeassistant_time).now().hour, id(homeassistant_time).now().minute);
- lambda: id(disp1).set_component_text_printf("Home.date", "%i-%02i-%02i", id(homeassistant_time).now().year, id(homeassistant_time).now().month, id(homeassistant_time).now().day_of_month);
Is there a way to view the value of home.time in the below?
Alternatively, can I reconfigure this to use sensor.date_time instead?
# Time component that fetches time from Home Assistant and updates the display once a minute and when the display is ready at bootup (and time is available).
time:
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: 0
minutes: /1
then:
- lambda: id(disp1).set_component_text_printf("Home.time", "%02i:%02i", id(homeassistant_time).now().hour, id(homeassistant_time).now().minute);
- lambda: id(disp1).set_component_text_printf("Home.date", "%i-%02i-%02i", id(homeassistant_time).now().year, id(homeassistant_time).now().month, id(homeassistant_time).now().day_of_month);
on_time_sync:
then:
- wait_until:
switch.is_on: nextion_init
- lambda: id(disp1).set_component_text_printf("Home.time", "%02i:%02i", id(homeassistant_time).now().hour, id(homeassistant_time).now().minute);
- lambda: id(disp1).set_component_text_printf("Home.date", "%i-%02i-%02i", id(homeassistant_time).now().year, id(homeassistant_time).now().month, id(homeassistant_time).now().day_of_month);
I’d personally aim for getting the proper time represented so continue to suggest to ask around, this as the time is used on the device too.
You can of course use other sensors if you only aim to display time…something alike this (not sure what sensor you have and how the data is in attributes)