Help decoding Foobot input

Hi there!

I managed to connect my Foobot air quality sensor to Homeassistant using rest, but now im blocked trying to decode the JSON to show the actual data (temperature, humidity and so on). I tried to take a look at the templates but I cant seem to get it to work…

The JSON looks like this:


Thanks for your help!

The processing of incoming data is described in the “Processing incoming data” section.

You will only be able to get one value per sensor. According your data it’s a nested list which requires a little bit more, e.g, for the temperature {{ value_json.datapoints[0][2] }}


that did the trick, thanks! However, now im faced with a new issue…the Foobot API limits the number of queries to 200 per day, which by default is reached in a couple hours in homeassistant, can i edit this frequency somehow?

Thanks very much!

In the configuration variables of the RESTful component, you can specify the poll interval in seconds (scan_interval). So for Foobot, which is limited to 200 queries per day, you should specifiy something higher than (24x60x60)/200 = 432 seconds, for instance:
scan_interval: 450

Do you mind sharing the FooBot integration code?

I have one and this would be really useful :slight_smile: .

Happy to :slight_smile: Here’s the configuration.yaml part:


platform: rest
name: foobot
value_template: ‘{{ value_json.datapoints[0][2] }}’
unit_of_measurement: ‘C’
scan_interval: 450

you can get your name and api key from As mentioned, only the temperature works so far

Thanks mate! This did a great job.

I’ve updated it a bit in order to get multiple values with single REST call. This requires additional platform named jsonrest. Here is the config I’ve used for that:

  - platform: jsonrest
    name: FooBot
    scan_interval: 600
      X-API-KEY-TOKEN: '{token}'
      Accept: application/json

  - platform: template
        friendly_name: PM
        value_template: '{{ "%.1f" | format(states.sensor.foobot.attributes.datapoints[0][1]) }}'
        unit_of_measurement: 'ugm3'
        friendly_name: Temperature
        value_template: '{{ states.sensor.foobot.attributes.datapoints[0][2] | int  }}'
        unit_of_measurement: 'C'
        friendly_name: Humidity
        value_template: '{{ states.sensor.foobot.attributes.datapoints[0][3] | int  }}'
        unit_of_measurement: '%'
        friendly_name: VOC
        value_template: '{{ states.sensor.foobot.attributes.datapoints[0][5] | int  }}'
        unit_of_measurement: 'ppb'
        friendly_name: Polution
        value_template: '{{ states.sensor.foobot.attributes.datapoints[0][6] | int  }}'
        unit_of_measurement: '%'

I made a component for foobot, it’s working so far but I have some cleaning up to do before making a PR for integration into HA mainline. Mostly related to the python package for the API and documentation, not the component itself.

In the meantime, if anyone here want to test it, it would be appreciated to get some feedback before publishing it.

It’s available at:

Just copy this file to your ~/.homeassistant/custom_components/sensor and add the following to your configuration:

  - platform: foobot
    token: <API Key>
    username: <username>


It works fine in my HA 0.65.1!

Thanks :slight_smile:

But when more than 200 API call…impossible to connect again :worried:

The component is now integrated into 0.66.

And it is working fine!


Thank you :slight_smile:

I am a newb to Hass and installed it on Ubuntu. I am trying to get Foobot working and added the device and token to my config but it doesn’t appear to be doing anything and I am not seeing anything in my logs either. I have a few devices working but not the foobot. Looking at the API, it is also not seeing any call from Hass. I verified that I have 0.66 and the is present in the python folder. I am running python 3.6. Not sure what I am missing… The username is the email address correct?