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.