plantgateway icon indicating copy to clipboard operation
plantgateway copied to clipboard

Missing TZ in timestamp

Open theOrakle opened this issue 5 years ago • 1 comments

Add module:

pip3 install python-dateutil

Simply added/modified the following to plantgw.py:

Added import: from dateutil.tz import tzlocal

Modified now() to include tzlocal(): MQTTAttributes.TIMESTAMP.value: datetime.now(tzlocal()).isoformat(),

data['timestamp'] = datetime.now(tzlocal()).strftime(self.config.mqtt_timestamp_format)

theOrakle avatar Sep 01 '19 02:09 theOrakle

Thanks for this. The 2021.12 update officially broke all of my timestamp entities that didn't have a timezone, including Plant Gateway's. This helped me resolve manually. Would be nice to see something like this change enter the source.

jonathantidwell avatar Dec 28 '21 10:12 jonathantidwell