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

Configuration.yaml for rest platform

$
0
0

I have a PicoW that reads temperature and humidity from a DHT22 sensor. Readings are then put into json format.

I can make Home Assistant get the readings via two sensors configured as follows:

sensor:

  • platform: rest
    name: Temperature
    scan_interval: 4
    resource: “http://172.16.0.69:80
    value_template: “{{ value_json.temperature }}”
    unit_of_measurement: “℃”

  • platform: rest
    name: Humidity
    scan_interval: 4
    resource: “http://172.16.0.69:80
    value_template: “{{ value_json.humidity }}”
    unit_of_measurement: “%”

My question is: is this the right way to do this please?

I notice that Home Assistant connects to the PicoW twice in quick succession, presumably because I have created two separate sensors. Is it possible to set this up in a more “elegant” way so Home Assistant only needs to connect once?

Any other improvements please?

Many thanks.

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 106618

Trending Articles



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