home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.3k stars 30.61k forks source link

Hive climate component schedule an hour out in Home Assistant #26569

Closed captaindaveman closed 4 years ago

captaindaveman commented 5 years ago

I’m running HA 0.98.5 on HassOS 2.12 and have been having an issue with my hive integration (I use the basic integration (hive: in configuration.yaml). What I’ve noticed is that everything works fine, I have some hive plugs and the thermostat, plugs all work fine (although I don’t use schedule) and the thermostat works fine e.g. it heats my home at the right time when temp is below target and schedule comes on. What’s not right is how this is represented in HA, it seems to report schedule changes to the Hive component an hour after the actually happen whereas the actual temperature reports fine. I thought this might be a British Summertime issue, but where? If you look at the screenshots from the history component you can see the issue. My schedule is as follows: During the night (until 06:00) the temp is set to 19c At 06:00 until 07:30 it is set to 21.5c Then at night it turns back down to 19c at 22:30, you can see the target temp change occurs an hour late in HA but the actual temperature clearly shows that the heating has come on or gone off. Puzzled, any ideas? 8092F8CB-24C4-4E8E-BFBB-3BAC2F55EEA7 9723C48A-4E6C-4885-B105-CBAC21797367 F92CFA2C-C8B0-4B89-A5EB-BAC931792C03

probot-home-assistant[bot] commented 5 years ago

Hey there @Rendili, @KJonline, mind taking a look at this issue as its been labeled with a integration (hive) you are listed as a codeowner for? Thanks!

Rendili commented 5 years ago

@captaindaveman, I think I had this same thing a long while ago on a manual Linux installation of HASS, I am sure the solution then was that the timezone was not set correctly in the OS and using the following command resolved this issue: sudo dpkg-reconfigure tzdata

Also, if you use add the custom component from my GitHub then you get a few more sensors which add more data to see heating and hotwater information. You can then click on the Heating Mode or Hot Water Mode to check the current and next two schedules and see if the api library is picking the schedule up correctly. image (I don't have my heating turned on yet so I cant show a screenshot of the heating schedule)

captaindaveman commented 5 years ago

@Rendili thanks for the quick response, the custom component looks great, a job for the weekend me thinks! how do I run the code you mentioned on home assistant? I think it is a difficult window to spot and fix this, as the timezone issue only appears for a short period when its offset by one hour and you need your heating on, the clocks change again next month so I need to fix it before then to be sure!

Rendili commented 5 years ago

@captaindaveman, sorry, but I don't know how you would go about doing this in hassOS or HASS.IO. From what I gather this OS is locked down and you I didn't think you could do something like that. For my situation I used putty to get on to my Linux installation then just run that command

captaindaveman commented 5 years ago

@Rendili I tried to run the command via ssh, but there seems to be only limited functionality, its a shame there is a) no way to change the OS TZ to GB and not UTC, or get the hive component to look at local not OS TZ

Rendili commented 5 years ago

@captaindaveman Do the grep commands in this post help (or anything else)? https://community.home-assistant.io/t/showing-time-in-utc-but-timezone-is-correct/129863/11

Rendili commented 5 years ago

@captaindaveman or this : https://community.home-assistant.io/t/alerts-dont-alert-after-first-time/118891/18

captaindaveman commented 5 years ago

@Rendili unfortunately these don't work with Hass io. How is your custom component configured, does it use local time (from configuration.yaml) or system time (UTC)?

Rendili commented 5 years ago

@captaindaveman I thought one of those was specific to hass.io and / or some links off of one was?

The custom component does not handle time directly, it just receives the time variables from the pyhiveapi library. There is nothing special going on in the library to manipulate the time for timezones. If it needs a current time then it gets this from the context it is run, which with normal Home Assistant I believe comes from the OS timezone. Any timestamps from Hive it just stores and uses as is

Rendili commented 5 years ago

@captaindaveman , in fact I think the Hive data when using datetime stamps now uses UTC everywhere, if this is the case then we will need to update the library to convert the Hive datetime stamps to local time

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.