Air Things View Plus

When I built the HPM package I just did an install without matching. Doesn’t hurt to replace the code with the same code, and then it registers the app so that you’ll be notifiied of updates.

1 Like

Ah! I thought it might add a second copy of the code, but since it was not the case, I’ll go ahead and do that! Thanks! :smiley:

I just wanted to thank you again for this great app and driver!

Where my home office is setup, my Air Things View Plus kept telling me the CO2 levels were too high. Now, I have a RM setup that will automatically set my whole house air exchanger to turbo mode (gets air from outside) and also turns on a fan that I setup in the wall. This quickly lowers the CO2 back to an acceptable (sub 1000) level.

4 Likes

Glad that it is working for you, was a fun exercise.

3 Likes

I will say many thanks as well.

I was able to save money and cancel my IFTTT subscription because the last think it did was set virtual Hubitat switches when CO2 or VOC levels became high and then back to normal. Sometimes there was this delay that is now gone thanks to your great work.

3 Likes

@thebearmay Thank you sooooo much for this!! Do you have a place to which we can donate?

A few things:
Searching for the App in HPM, I could not initially find it, because of the space added between Air and Things. I believe the official name is one word without a space...

For those of us still flailing around trying to figure out HE, here is a step by step:

  1. On the HE, in the Apps section, select Hubitat Package Manager (HPM)
  2. Click "Install a new package"
  3. Select search by keyword, enter "air" then click next
  4. Select the "Air Things ...API Integration.." then click next
  5. Once it says it has finished installing, go to the HE Apps section
  6. In the upper right corner, select "Add User App", and select "Air Things..."
  7. Click the "Link to AirThings for ID/Secret" which takes you to the AirThings site
  8. Log into your Airthings account, and you will be taken to a page titled "Create Client"
  9. Fill in the form as follows:
    a. Create a name for this client that you will recognize
    b. Short description
    c. Click the checkbox for "Resource Scope"
    d. Ensure the Access type radio button is selected for "Confidential"
    e. The only flow type option you have is "Client credentials (machine to machine)"
    f. At Enable, select "ON"
    g. Click SAVE
    h. Then click "Display Secret"
    i. Copy this resulting string of letters & numbers to somewhere you can retrieve it.
    j. Click Save and it will update your Airthings account
    k. At the top right of the Airthings page, also copy the "ID" string and save it to somewhere you can retrieve it
  10. Go back to the Hubitat page you were on in step 7
  11. Copy and paste both your save ID and Secret strings into the appropriate fields
  12. Click "Create Initial Authorization"
  13. Click Get Devices. If it returns "Found n devices" where n is the number of devices you have, you have linked your device to Hubitat!
  14. Click Done
  15. Go to Devices
  16. In the searchbar at the top, type "Air". You will see your Airthings device(s) show up by whatever it is you named them IN AIRTHINGS Click on that device.
  17. Click "Initialize". You should now see the values for ALL of the attributes your Airthings tracks on the right side of the screen under "Current States"
  18. In the Preferences section
    a. enter how often you want Hubitat to poll the Airthings server for updated information. Remember that if you have one of the old Airthings devices that downloads data via Bluetooth to your phone then uploads to Airthings, it is not pulling any data the entire time your phone is gone.
    b. If you are in the US, you may wish to revise some of the measurements in the preferences section, such as moving the sliders to "use fahrenheit" and "Use pCI/L for Radon"
    c. If you want to see the values on a tile, enter a name for the tile in the "Template for generating HTML for dashboard tile" field.
  19. Click Save Device
  20. Go Back to Hubitat Apps, select Hubitat Dashboard Configuration, Select the dashboard on which you wish to show the Airthings data, click on Choose Devices, and make sure your Airthings Device has a checkbox next to it (remember Device Name= what you named it in Airthings). Click Update
  21. Go to the Dashboard, select the plus sign in the upper right to add a tile.
  22. In the Add a Tile Window:
    a. Set location
    b. Tile Type = Device
    c. Pick a Device = Name of your device in Airthings, which should be on the dropdown list
    d. Template=Attribute
    e. Pick an Attribute = Select the attribute you want to display from the dropdown
    f. Save

You can repeat step 22 multiple times to get tiles with all the attributes you want to see on your dashboard.
@swade has figured out a way to list 5 attributes in one tile. I'm REALLY hoping @swade or @thebearmay will post a step by step set of directions on how to do that!

7 Likes

To use the custom tile template feature just copy the template text below and save in a .txt file on your computer. Customize the names and values for your liking. Then use the File Manager feature in the Hubitat Settings page. Click the "+Chose" button and go to the location where you saved your template and select it. Now select the "Upload" button to add your template file to the Hubitat File System.

Now go back into your AirThings Device and enter the file name you uploaded to the Hubitat File System as the value for "Template for generating HTML for dashboard tile" in the Device Preference Sections.

<table>
<tr><th>CO<sub>2</sub></th><td><%co2%></td></tr>
<tr><th>Humidity</th><td><%humidity%></td></tr>
<tr><th>Pressure</th><td><%pressure%></td></tr>
<tr><th>Radon</th><td><%radonShortTermAvg%></td></tr>
<tr><th>Temperature</th><td><%temperature%></td></tr>
<tr><th>VOC</th><td><%voc%></td></tr>
</table>

See Original Custom Tile message

Good Luck and feel free to ask if you need additional assistance.

2 Likes

Thanks @swade and @calinatl. One additional note, the same template can be uploaded once and then used for multiple devices if you like.

1 Like

Yes you can. But since I have 2 monitors, I wanted a different name for the header for each tile so I needed 2 templates.

<table>
<tr style="font-size:85%"><th>Basement</th><td></td></tr>
<tr style="font-size:85%"><th>Radon</th><td><%radonShortTermAvg%></td></tr>
<tr style="font-size:85%"><th>CO<sub>2</sub></th><td><%co2%></td></tr>
<tr style="font-size:85%"><th>VOC</th><td><%voc%></td></tr>
<tr style="font-size:85%"><th>Temp</th><td><%temperature%></td></tr>
<tr style="font-size:85%"><th>Humid</th><td><%humidity%></td></tr>
</table>
1 Like

I could probably add the device name, and room as options if it would help…

I bet less than 2% here own more than 1 AirThings device so I would think not necessary.

1 Like

Well, if you want to play with the new bundle (or just re-import the templateProcessing.groovy library):

<%@name%> - Device Display Name
<%@room%> - Device Room

1 Like

@thebearmay : I wonder if adding a device name option in HE would potentially confuse users...having the HE use the same device name as Airthings uses may help reduce issues...

You can potentially rename the device and assign it to a room within the HE Device Information section, which seems sufficient...

Also, I agree with @swade - there are probably a minimal number of users with more than one Airthings device

ETA: Oops - just saw you already did it. Thanks!

1 Like

@swade Sorry to bother you, but I do "need additional assistance..."

Followed your steps exactly, but now that I have entered the file name for the template as you directed above, what are the next steps to get that tile on a dashboard?

  • It does not show up in the template dropdown when adding a tile to a dashboard
  • I thought it might be a virtual device, but not really sure how I would set it up if it is...

Once you’ve given the air things device the template path, it should generate an html attribute for use with the Dashboard Attribute Tile Template.

1 Like

Did you add your AirThings device to devices allowed on your dashboard. Look under Apps for the dashboard section and then add your device. Then follow what thebearmay says above my message.

@swade : Yep. Did that in step 20 above

@thebearmay : AHH. I get it now. I was looking for the *txt file in the "Pick a Template" dropdown.
Instead, I did as you directed and in "Pick a Template" selected "Attribute" from the dropdown
Then, in "Pick an Attribute" selected "html" from the dropdown.
Works!

1 Like

I JUST received my Airthings view plus, received the secret and the ID (per instructions) and followed the excellent steps that Calinatl posted and the HTML template for a dashboard.....
A BIG thank you to both of you!!!!! It works great..
BUT (of course)
in the device page, the radon IS selected for pCi/L , but in the HTML text the units are Bq/m3.

Am I missing something? or is the text Bq/m3 hard coded? (the 3 is superscripted).

I am using the USB power supply also, so it is also a hub.
I gather the data is coming from the airthings servers and not locally? so if I turn off polling, the data will not update?

Thanks guys for this!

1 Like

The default is Bq/m3 and the first reading the device gets will more than likely occur before you set the switch to pCi/L -> should switch on the next reading after the switch is flipped.