jbouwh / omnikdatalogger

Datalogger for Omnik solar power inverters with DSMR integration and output to Home Assistant, PVOUTPUT, InfluxDB and MQTT
https://jbsoft.nl/site/omnik-datalogger/
GNU General Public License v3.0
10 stars 3 forks source link

Using string for deviceclass `timestamp` #45

Closed jbouwh closed 2 years ago

jbouwh commented 2 years ago

Home assistant logs show message like:

2021-11-19 09:34:36 WARNING (MainThread) [homeassistant.components.sensor] sensor.laatste_statusupdate is providing a string for its state, while the device class is 'timestamp', this is not valid and will be unsupported from Home Assistant 2022.2. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

MQTT publishing must be updated to comply with the new standard.

jbouwh commented 2 years ago

This issue will be resolved with the coming version of Home Assistant. I wall change the MQTT value template for the timestamp type sensors and use the updated as_datetime filter as it gets support to translate UNIX timestamps to datetime. Link to PR: https://github.com/home-assistant/core/pull/60126

jbouwh commented 2 years ago

The issue in HA dev has been solved. So there is no sense or urgency any more. The as_datetime filter has been updated to support UNIX timestamps as well, so the value template change can be implemented later.