I implemented reconnecting to deconz, which is working nicely.
I also made event parsing more robust by checking for sensor events, and only parsing those. In my setup I have several groups and switches, which were sending "group" events, which were being parsed as sensors, and in some cases the ids matched existing sensors causing 0-valued sensor readings to be logged to InfluxDB.
I had to refactor the code a bit to enable reconnection. I moved the goroutine and web socket handling into SensorEventReader and Reader, so that reconnects can be part of the sensor-reading loop. I hope the code is understandable.
It has been running without problems for a week now:
Hi,
I implemented reconnecting to deconz, which is working nicely.
I also made event parsing more robust by checking for sensor events, and only parsing those. In my setup I have several groups and switches, which were sending "group" events, which were being parsed as sensors, and in some cases the ids matched existing sensors causing 0-valued sensor readings to be logged to InfluxDB.
I had to refactor the code a bit to enable reconnection. I moved the goroutine and web socket handling into SensorEventReader and Reader, so that reconnects can be part of the sensor-reading loop. I hope the code is understandable.
It has been running without problems for a week now:
Regards from Vienna,
Richard