Closed 2bbe closed 2 years ago
I think its related to following:
Thanks for diving into the documentation. The "Epoch sec in local time" is an important clue on what is probably implemented wrongly.
I will also need to investigate how the Timezone register influences the time that is reported.
This bug was already present in the other huawei_solar integration (not yours). So, is probably related with modbus library and not with the integration.
The bug is actually in this integration, as the timezone conversion is done correctly (as seen in the example the datetime shown in HA is in UTC, which is 2 hours behind your local time, which is exactly the difference you see).
The problem is that the entity is missing the proper device class for datetimes and therefore gives you the string representation of the date in UTC. If the device class is changed to timestamp
the value is shown correctly.
Thank you for your contribution. Greatly appreciated!
System Health details
System Health
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4333 Installed Version | 1.24.5 Stage | running Available Repositories | 1032 Downloaded Repositories | 34cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | oklovelace
dashboards | 3 -- | -- resources | 16 views | 36 mode | storagespotify
api_endpoint_reachable | ok -- | --Huawei Solar Setup
Inverter: SUN2000-6KTL-M1 - V100R001C00SPC14 Sdongle: Yes-V100R001C00SPC126
Describe the issue
Startup time and shutdown time is displayed in wrong time zone. From HA huawei_solar: From Fusion Solar:
Modbus register 32091 & 32092: 25180 & 65336 -> 1650261818 Epoch seconds
-> Monday 18 April 2022 06:03:38 in readable format.
Reproduction steps
...
Relevant debug logs