dkruyt / ginlong-scraper

A python script that scrapes PV statistics from the Ginlong monitor pages and outputs it to influxdb, pvoutput or mqtt
GNU General Public License v3.0
48 stars 29 forks source link

Sending to mqtt hangs on updateDate #5

Closed JeroenEeuwes closed 3 years ago

JeroenEeuwes commented 4 years ago

The script hangs on the mqtt output. In the mqtt topic I could see some of the values. I rearranged the values until I found out the problem was with the updateDate line:

msgs.append((mqtt_topic + "updateDate", int(updateDate), 0, False))

If I commented that line out, it worked OK. I managed to solve this by changing it to this:

msgs.append((mqtt_topic + "updateDate", int(updateDate / 1000 ), 0, False))

I took the cue from the niceTimestamp line:

niceTimestamp = time.ctime((updateDate) / 1000)

dkruyt commented 3 years ago

fixed in the docker version now, thanks for reporting.