-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component: Airthings Wave integration #9
Comments
Probably not exactly what you want but my HA server is not within BTLE range of my Airthings Wave nor does it have bluetooth, so I'm running this on a Pi0w and publishing to HA's MQTT server: https://github.com/hpeyerl/airthingswave-mqtt
How many story points do I get? |
hpeyerl: Can this be adapted to include the upcoming Wave Plus due this month? It adds CO2, VOC and Pressure. I might order one tomorrow. |
I don't know. I'm guessing probably but I don't have one nor have I ordered one.
…On July 12, 2018 2:43:57 PM MDT, Cavemanz ***@***.***> wrote:
hpeyerl: Can this be adapted to include the upcoming Wave Plus due this
month? It adds CO2, VOC and Pressure. I might order one tomorrow.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#9 (comment)
|
Ok, is the integration you made working as it should? How have you presented the data in Home Assistant? |
It publishes to MQTT.
…On July 12, 2018 3:37:01 PM MDT, Cavemanz ***@***.***> wrote:
Ok, is the integration you made working as it should? How have you
presented the data in Home Assistant?
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#9 (comment)
|
Ooh, I like! Very nice job, thanks for sharing, you definitely deserve a 🍺 at the retro! 😃 Indeed, having such a dedicated bridge that can be located closer to the AirThings Wave looks like a much better idea than trying to rely on a sometimes less ideally placed Home Assistant Pi host. And it's mode modular to boot. I am definitely trying out your code ...and updating my documentation to link to your repo. 👍 |
I just put in an order for the Wave Plus which is supposed to ship 19th of July. Please report back on your experiences. According to Wave Plus specs it requires minimum BT 4.2. Only the Pi 3 B+ meets this, but Ill test with my regular 3B first.. |
Airthings is not an open source friendly company. I asked for documentation so I could implement a python API and was told they don't have any documentation but pointed me at their two example scripts. I just wrapped a simple API around one of those and added some MQTT publishing. Unfortunately, all of my readings are coming in with a date stamp of 2010 because I've never installed their Android app and mated it with my phone. So I subsequently contacted them to see if they could tell me what UUID and format so I could set the date from my API and was told they wouldn't release that information. So I wouldn't hold my breath hoping to get any information on the Wave Plus out of them unless they decide to get around to updating their example script. |
Indeed, I dont have very high hopes that they will somehow open up very much. HeatIt (Norwegian company selling various Z-Wave products) were cooperating with Airthings on a Z-Wave version of the Wave. That was supposed to launch right about now but was cancelled entirely in May. The likelyhood of Airthings being the one to say no is 99%. If theres no way to get any meaningful data out of this Wave Plus, I have a deal to sell the unit on to a friend who has real issues with radon. |
I would encourage you to ask them to be more open-sourcey... I sent mail to their sales channel. |
Several Norwegians into home automation have tried, but they dont seem to care at the moment. I can understand their take with a hub in a commercial setting. However, being based on BT is a bad design decision to begin with. |
I ended up cancelling my order. It was pushed back to september, so I didnt wanna wait. |
How do i set the path to the config file? |
@grangemd You can set the path as a command-line argument, for example: python -m airthingswave-mqtt ~/config.yaml |
maybe i am doing this wrong because i am getting an error of
Not sure if I put the file in the wrong location or if I have done something else wrong |
From the instructions: https://github.com/hpeyerl/airthingswave-mqtt waves:
|
I guess what I am trying to do may not be correct. I am trying run this directly from a python file from HA from my Unraid server using the custom components. I am sure I am doing this wrong but not sure how to do this or if I can do it this way. |
Oh, that's different. I can't help you with that because I have no experience with the HA custom components mechanism.
Sorry, you're on your own.
…On December 7, 2018 1:26:10 PM MST, grangemd ***@***.***> wrote:
I guess what I am trying to do may not be correct. I am trying run
this directly from a python file from HA from my Unraid server using
the custom components. I am sure I am doing this wrong but not sure
how to do this or if I can do it this way.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#9 (comment)
|
Maybe this is the wrong place to put this but I can't find anywhere else to direct message so I will see if I can get help here. I set up a pi to do this. What exactly do I need to do? I can download the zip file and extract it to a folder. Then do I need to setup a cron job and call what file? Also do I need to create a conf.yaml file and how or where do I put the path to this conf.yaml file? Does it get called out in airthingswave.py? Sorry this is new to me. |
@grangemd: A quick and easy way to install airthingswave-mqtt on a Raspberry Pi is to use this project I've uploaded lately. It uses @hpeyerl's code, is based on balena (an open-source Docker-compatible stack for IoT) and creates a stand-alone, plug-in, secure bridge that's easy to manage: https://github.com/renemarc/balena-airthingswave I've been using this solution for a few months now and it's clicking along fine. Hopefully the included README.md should be useful to get you going, and your you prefer to go the manual route then the Dockerfiles and simple shell scripts should help you in any case. It is Alpine-based for simplicity and has a relatively small size; a Debian-based alternative is also available here for reference, but I've done fewer tests on it and am no longer using it. If you prefer a more manual approach:
Each project above uses either cron (Alpine) or systemd (Debian). Enjoy! 😃 |
@renemarc I am trying to follow the readme and I get to the Installation Section. When I enter the line
I end up getting an error
Any advice would be appreciated. |
Sorry i just updated the file as I noticed it was hard to read. I ended up trying a different docker that I wasn't planning on using and it seemed to push correctly so I don't know what is wrong with this one. |
@grangemd: That was a weird bluez compilation bug. Which Pi were you using? |
@renemarc I am using a Raspberry Pi 3 Model B+ |
Regarding Airthings Wave Plus: I'm integrating the sensor into my Domoticz, still testing but it seems that it is possible to read meaningful data with RPi from the device. I'll post the BluePy script here is somebody is interested. Need still a b it time to check if the script works ok. |
@renemarc Any thoughts on the bluez compilation bug? |
Forgive my intrusion but are you really trying to compile this under Windows? |
Yes. Sorry this is new to me. Should i be doing it somewhere else? |
The balena-airthingswave package is for a RaspberryPi3 which is an ARM processor running Linux and Bluez is the Linux Bluetooth stack. Your windows machine is almost sure to be an x86 machine. So, unless you're cross-compiling, you are almost certainly doing the wrong thing. Based on your comments, your expertise level may not be sufficient to undertake this project. Maybe this isn't the project for you? I'm just a spectator here. |
I agree my knowledge may not be sufficient enough but I am trying to learn. So I get the image loaded on my raspberry pi then where do I need to run the git commands for installation. Is the done on the pi? Because if I run them from the terminal window within Balena Cloud I get an error
This is why i tried compiling it on a Windows PC but obviously that is wrong as was pointed out |
I also tried to run this on a Mac and I get a very similar error. |
I can take a Pi 3 B (not B+) offline to test the build on it, but likely not before tomorrow at the earliest. |
That sounds good. I appreciate it. I tried putting it on a Raspberry Pi 2 B+ but i couldn't get balena working for some reason. It was most likely my issue |
@renemarc Just for completeness I got a raspberry pi 2 B+ up and running and I get the same error. I don't know if I am compiling it the wrong way or what. I am know using the Mac to compile the code. |
Got some free time to test earlier than anticipated. Compilation was actually skipped on Raspberry Pi (used an existing binary I presume), and I had not tested the Alpine version on a RPi 3B where it needed to be compiled. Oops! I've added the missing package and pushed the update. I've only tested the balena Dockerfile. Just do a |
@renemarc That seemed to work perfectly. I will try to connect to my airthings device tonight. I don't know if you would know but is there a way to get this docker image to work with unraid? My server is right next to the airthings device so it would allow me to cut out the raspberry pi if I was able to do this. |
@renemarc So it appears to be working at least for the first run however I never seem to get a second message to send. I am getting this error...
Update: Everything seems to be working now. I rebooted the device and all seems well right now. Thanks for all the help. |
If you're comfortable compiling in the Arduino IDE and have a spare ESP32 board lying around, I wrote a sketch you could use to read data from the Airthings and publish it to an MQTT server. I'm using this to get my radon levels into the HA instance. |
@sabeechen Cool project! I like your approach of using simple, power-sipping dedicated hardware. 😃 I've added it to the list of community projects on balena-airthingswave. |
Hey Everyone! I ran into a bunch of issues trying to setup a RPi Zero W as a hub for my AirthingsWave. @renemarc had some great instructions for the manual method, but it still failed for me. I couldn't seem to find a simple how to guide anywhere. I've updated @renemarc instructions below with my observations and tips. Hope this helps for whoever is trying to figure this out. This is the "Manual Approach" running Raspbian Stretch on a Raspberry Pi Zero W
Note: This is in Raspbian's Home Directory (~), but you can place this wherever you want. Include the config below with your details and the MAC address recorded in Step 2.
Note: Username: Keep the quotes used above for "YOURMQTTUSERNAME", otherwise it will error out with "has no len ()" Password: Keep the quotes used above for "YOURMQTTPASSWORD", otherwise it will error out with "has no Len ()" Name: Keep the quotes used above, "name it whatever you want", for this example, I used "radon" Addr: This is the MAC recorded earlier. It shouldn't matter, but I still had problems, keep the letters lowercase. Again, keep the quotes!
If you are successful, you'll see it search and find your Airthings Wave, and report Radon, Radon Long Term, Temperature, Humidity.
Note: replace "radon/ " with whatever you chose to name it.
|
Hey that's terrific. Do you feel like modifying the README.md for airthingswave-mqtt and send a merge request.
…On February 12, 2019 1:08:33 PM MST, curt7000 ***@***.***> wrote:
Hey Everyone! I ran into a bunch of issues trying to setup a RPi Zero
W as a hub for my AirthingsWave. @renemarc had some great instructions
for the manual method, but it still failed for me. I couldn't seem to
find a simple how to guide anywhere. I've updated @renemarc
instructions below with my observations and tips. Hope this helps for
whoever is trying to figure this out.>
>
This is the "Manual Approach" running Raspbian Stretch on a Raspberry
Pi Zero W>
>
1. Setup your RPi Zero W w/ Raspbian Stretch Lite>
>
**Note:** Python 2.7, PIP and Bluez are pre-installed>
>
2. Follow the instructions at Airthings (
https://airthings.com/raspberry-pi/ ) to be able to "find" & "read"
your Airthings Wave with your RPi Zero W. Make sure you can "find" and
then "read" your Airthings Wave. Keep the MAC address you use to
"read", you'll need it later.>
>
3. Install airthingswave-mqtt on the RPi Zero W, more information on
this gem is available at https://github.com/hpeyerl/airthingswave-mqtt>
>
```shell>
pip install airthingswave-mqtt>
pip install pyyaml>
```>
>
4. Create a yaml configuration file for airthingswave-mqtt on the RPi
Zero W, we'll call it airthingsconfig.yaml>
>
```shell>
nano /home/pi/airthingsconfig.yaml>
```>
>
**Note:** This is in Raspbian's Home Directory (~), but you can place
this wherever you want. Include the config below with your details and
the MAC address recorded in Step 2.>
>
mqtt:>
broker: xxx.xxx.xxx.xxx>
port: 1883>
username: "YOURMQTTUSERNAME">
password: "YOURMQTTPASSWORD">
>
waves:>
- name: "radon">
addr: "cc:78:ab:00:00:00">
>
Note:>
>
**Username:** Keep the quotes used above for "YOURMQTTUSERNAME",
otherwise it will error out with "has no len ()">
>
**Password:** Keep the quotes used above for "YOURMQTTPASSWORD",
otherwise it will error out with "has no Len ()">
>
**Name:** Keep the quotes used above, "name it whatever you want", for
this example, I used "radon">
>
**Addr:** This is the MAC recorded earlier. It shouldn't matter, but I
still had problems, keep the letters lowercase. Again, keep the
quotes!>
>
5. Try running it with the command>
>
```shell>
python -m airthingswave-mqtt /home/pi/airthingsconfig.yaml>
```>
>
If you are successful, you'll see it search and find your Airthings
Wave, and report Radon, Radon Long Term, Temperature, Humidity.>
>
6. Now to make sure Home Assistant is setup properly to receive these
MQTT messages, add the following to your HA configuration.yaml>
>
```>
sensor 1:>
platform: mqtt>
name: "Radon 24HRS">
state_topic: "radon/Radon-Day">
unit_of_measurement: "pCi/L">
>
sensor 2:>
platform: mqtt>
name: "Radon LifeTime">
state_topic: "radon/Radon-Long-Term">
unit_of_measurement: "pCi/L">
>
sensor 3:>
platform: mqtt>
name: "Temperature">
state_topic: "radon/Temperature">
unit_of_measurement: "°C">
>
sensor 4:>
platform: mqtt>
name: "Humidity">
state_topic: "radon/Humidity">
unit_of_measurement: "%">
>
```>
Note: replace "radon/ " with whatever you chose to name it.>
>
7. Before restarting your HA, I recommend you watch Home Assistant and
make sure the MQTT messages are properly received by enabling the
following in your HA configuration.yaml. Once you've validated
everything is working, you can Disable/Remove this from your config.>
>
```>
logger:>
default: warning>
logs:>
homeassistant.components.mqtt: debug>
```>
>
8. tail your HA log file>
>
```shell>
tail -f home-assistant.log>
```>
>
8. Restart your HA>
>
9. Issue the command in Step 5 on your RPi Zero W, if all is working
you should see HA listening on the MQTT instances you created and
successful reports coming in from your RPi Zero W>
>
5. Once everything is working, set the Step 5 command as a cron job>
>
-- >
You are receiving this because you were mentioned.>
Reply to this email directly or view it on GitHub:>
#9 (comment)
|
Thanks! Yea, I’ll give it a try. |
As a user, I want to access the output of an Airthings Wave radon detector so that I can get a overview of indoor radiation hazards.
Acceptance criteria
References
The text was updated successfully, but these errors were encountered: