NSPanel Time is Out by 1 Hour

Hi All

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);

Any ideas?

1 Like

I am in CET, have exactly (!) the same setup and with me no issues. So must be coming from HA
What does your HA ‘Home’ setting show?

Its set as London, which should include the Daylight Savings Correction for summer, right?

I am on GMT+01:00 / Paris and never had issues with daylight savings

Just changed the timezone in HA and it had no effect on the time displayed on the NSPanel…
Very confused!

No clue too… try raising (changing) this in the esphome category, or join their discord group

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)

sensor:
  - platform: homeassistant
    id: current_time
    entity_id: sensor.date_time
    attribute: time_attribute
    on_value:
      then:
        - wait_until:
            switch.is_on: nextion_init
        - lambda: id(disp1).set_component_text_printf("Home.time", "%02i:%02i", id(current_time).now().hour, id(current_time).now().minute);

I got the same problem. Any solution?

Please set proper timezone in container that running appdaemon.
By adding to docker run command line “-e TZ=Europe/London”

Thanks for the hint - which container is this? Here I have

  • homeassistant
  • mqtt
  • zigbee2mqtt
  • esphome

It seems like my Docker host killed all the TZ variables during startup - even when creating them, they don’t show up in the running container :frowning:

Now I am working through [BUG] Timezone config not working · Issue #991 · joBr99/nspanel-lovelace-ui · GitHub