Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Restful API for Thermometer with multiple probes

$
0
0

@everythings12 wrote:

I am trying to get readings from a Restful GET that has been successful in returning data but I’m not able to figure out how to separate them into 6 sensors. This is a Fireboard thermometer with 6 probes. I’d like to label them all separately so I’m certain I need to build a sensor for each probe but I don’t know how to break them out.

My sensor:

sensor:
  - platform: rest
    resource: "https://fireboard.io/api/v1/devices/UUID/temps.json" 
    headers:
      Authorization: "Token yadayadayada"
    value_template: '{{ value_json.temp.channel }}'
    name: Fireboard Temp
    json_attributes:
     - temp
     - channel

JSON response:
[{"channel":1,"created":"2020-02-11T05:06:14Z","temp":72.6,"degreetype":2},{"channel":2,"created":"2020-02-11T05:06:14Z","temp":72.7,"degreetype":2}]

I think it lies in the value_template but I can’t figure out how to build it for each channel. With that config I do get data back for the first channel.
temp: 72.7
channel: 1
friendly_name: Fireboard Temp

and If I need to go Command Line I’m assuming:

curl ... | jq '.[] | select(.component == "PM10") | .value'

Then my question becomes where to install jq (docker? which?), and if it’s in a container I’ll have to re-install every update?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>