[RELEASE] Foobot

Please See new and much improved version by @MichaelS here:

http://thingsthataresmart.wiki/index.php?title=Foobot_Air_Quality_Monitor

Old release:
Leading on from @Kristopher’s original Foobot integration. This is a new version based on their new API. It can be a little cumbersome to setup - but once you are done you’ve got your Foobot back with Smartthings which is very useful!

How to setup

  1. Get your unique Foobot API Key from here and save it: https://api.foobot.io/apidoc/index.html
  2. Save this Device handler below in the IDE using the standard method
  3. Create a new Device in the IDE for Each Foobot that you own and link it to this device handler
  4. Get the UUID of each foobot you own by using this URL (and inserting your API key at the end and your username (usually your email address) in the middle): https://api.foobot.io/v2/owner/your_username/device/?api_key=your_key
  5. Then go into the code of the device handler in the IDE and insert your API Key where it says: “ENTER YOUR API KEY HERE (KEEP THE QUOTATION MARKS)”.
  6. Then in the app go to the device itself and tap the settings button in the top right and enter in your username, and the UUID of the Foobot [FROM V2 onwards: you must also select your region US or EU].

That’s it - hit refresh to get your latest data. I’d also recommend setting it up with Pollster to poll every 7 or 8 min (not any more as Foobot has a 200 request per day limit on their API).

It’s early days for this DH - I’ll improve it as time goes on - but for the moment this should get the data you need into ST.

6 Likes

Does this have any features that the foobot IFTTT channel doesn’t? Or is it just a little faster?

Yes.

Aside from the fact that it makes an actual device in ST that you can view just like any other device in your house (which you cannot do with the IFTTT integration).

It also it lets you view the individual data points of the foobot (overall pollution, temperature, VOCs, Carbon dioxide etc etc), and the you can use these with whatever other apps you’d like in ST like CoRE or official ones.

The IFTTT integration only lets you trigger something if:

  • pollution is too high
  • there is a new air quality reading
  • you knock on your foobot

As far as I can tell it also only reports the GPI (overall pollution score) and nothing else. Let me know If I have this wrong

1 Like

Awesome Adam! I was considering buying one but I wanted to see if anyone had built in some SmartThings integration and you have, so in the cart it goes!

Hi Adampv, I have created the device handler and set it up per your instructions, but I can’t figure out how to add it into smartthings. I go to add a thing and it of course won’t find it, but I don’t see where to add it manually. it’s not an app it’s a device handler, so not sure how else to add it?

Ok so I added the device manually in the IDE, which I’m guessing is what you do. I’m in the app now and I added the UUID but no data seems to be coming through.

Also, I’ve directly copied and pasted so I don’t have a typo. I do know that it says it won’t let me set notifications for 6 days, etc, could that be it?

Ok have you followed the instructions to the letter? Or are there some that you are unsure about?

You said that you are in the app when you added the API key? You should be adding it in the code as per the instructions

Sorry I was referring to the UUID when I said in the app, but I’ve also done a direct copy/paste via the IDE, saved and hit refresh and it still doesn’t work.

PM me your code and username (foobot) I’ll see what’s going on

Thanks AdamV, will do.

Just wanted to follow up and make sure you got my pm. Hopefully it was private anyhow :slight_smile:

Make sure you save and also publish the code, otherwise it won’t work.

Btw, is there a way to have it to report F rather than C?

Thanks Gergor, I made sure to publish.

Hi Matt - I’m currently abroad, hence lack of contact. The API key that you sent me is invalid. I’m not sure if this is a typo because I do not get the UUID returned when I use the details that you sent me. Can you go to Foobot’s api page and request an api key again?

Actually I think you need to contact Foobot - when I make the request from their API page it works - but when I make the exact same request from Smartthings it comes back as unauthorised. No idea why. I think you need to contact them and get them to re issue a new API key the behaves properly!

Hmmm, I wonder why you guys having problems, but I installed this device type less than 12 hours ago, and it’s been working since.

(posted just to add a data point as a reference)

Ok, thank you very much for your help AdamV! I will contact them and let you know.

Gergor, in the instructions it says ‘use your API key’, but I’ve noticed when I generate the API key there are 2. The secret key, and the key ID. I was using the secret key, was I supposed to use the Key ID anywhere?

Hi AdamV, this is the response I got back;

Hi Matt,
Seems like your SmartThings integration should query api-us-east-1.foobot.io and not api.foobot.io which will resolve differently depending on where it is issued. When you execute your request from the API doc page, or from your computer it will work, since you’re located in a region that is associated with our US server. That doesn’t seem to be the case for your SmartThings integration, which is directed to api-eu-west-1.foobot.io when executed.
Hope this helps,
Antoine

Where do I go from here?