Airthings / waveplus-reader

MIT License
133 stars 61 forks source link

Python 3 and MQTT support. #7

Open stenjo opened 5 years ago

stenjo commented 5 years ago

I have created a fork that runs on python3 and also has support for publishing data onto an mqtt server. Would this be of interest to add to this project?

orjangj commented 5 years ago

Hi stenjo,

Great suggestion on adding python3 support.

I would suggest we do this by making the script compatible with both py2 and py3. E.g. by using the "six" python module, instead of having multiple scripts.

Anyway, I'm on leave until next week, so I wont be able to review your suggestions in more detail until then.

stenjo commented 5 years ago

Just tested my fork with both python 2 anf python 3 and both seems to be working. Should i make a pull-request so you could evaluate?

jjanderson commented 4 years ago

Hi,

Is this available yet? Specifically looking for MQTT support.

Thanks

stenjo commented 4 years ago

Have not had the time to update this PR according to orjangj's request but it works continuously in my apps at home. pulling info every 10 minutes or so. Have not managed to make it work with the latest 2nd Gen firmware - but otherwise OK. https://github.com/Airthings/waveplus-reader/pull/8

jjanderson commented 4 years ago

Thanks for hte update. Are you able to detail the MQTT message topics generated that one needs to subscribe to in order to get the sensor data?

stenjo commented 4 years ago

In the PR there is an waveplus.items file containing the openhab items definitions. There you will find indications on the topics the information is published on. The README.md file contains a more detailed description of the format.

jjanderson commented 4 years ago

any idea when this will be merged?

stenjo commented 4 years ago

Currently, I'm thinking most likely not. Python 2.7 is no longer supported, and the repo owner is not happy adding the MQTT support to this. In addition it seems to be an issue with Gen 2 devices - that I have not had time or the opportunity to fix. My suggestion is to use this PR as your source if it contains features you need - otherwise you are advised to use the original code.