Closed yonz2 closed 8 months ago
I don't see myself adding this to the core program. One of my design principles has been to limit the dependencies as much as possible.
I believe I'm currently only dependent on c++ std libraries and libbluetooth.
You could probably achieve what you want by monitoring the log directory for updates, then using a stream text editor (sed?) to manipulate the logged data and submit it to MQTT. E.g. "tail -f /var/log/govee/gvh-xxxxxx.txt"
I just thought of the tail -f
command as an example of monitoring a text file for updates. I'm sure there are better methods in a language such as Perl that are designed to handle text better than C/C++.
Hi,
I see your point. It does make sense to keep the code clean and simple.
I created a Python script to do exactly what you suggested, with the addition of dynamically create the HA Devices when the GoveeBTTempLogger encounters a new device (writes to a new log file)
My script is here: Datalogger
Hi,
I'm working on a remote data logger, that logs data from my Govee sensors. I would like have the RPI put the values read at a certain interval on to a MQTT queue.
I'm not a CPP developer, so I can't implement it myself and submit a pull request for a patch.
I did look into it, though, and using the Eclipse Paho Library and a few new parameters this should be a straight forward thing to do...
Parameters
The routine should then every
MQTT_INTERVAL
seconds send the latest reading from each device as a JSON payload to the MQTT Topic:MQTT_TOPIC_PREFIX/<<Mac Address of Device>>
(or use the filename prefix used for the log files, for consistency)JSON Payload
On the other end we can then use e.g. Home Assistant's MQTT Sensor to process the data
Example Home Assistant configuration.yaml entry
(Note: This config is just a basic template, needs to be tuned to the respective HA installation)
Just a thought.....
Best regards, Yonz