Hello everyone:
I use Scrape to get the Temp from an ESP8266 Webserver
- platform: scrape
resource: http://192.168.178.161
name: dht22ez_h
select: ".sensorh"
unit_of_measurement: '%'
It works, The State returns the Humidity.
i would like to use a template:
- platform: template
ez_h:
friendly_name: 'Luftfeuchtigkeit Esszimmer'
value_template: '{{ state.sensor.dht22ez_h }}'
device_class: humidity
unit_of_measurement: '%'
The state is always unavailable.
what am I doing wrong ?
You are missing the .state
off the end of your template
value_template: '{{ state.sensor.dht22ez_h.state }}'
Aren’t you just making a copy of a sensor using the template ?
Thanks for your replay.
But it doesnt work.
sz_h:
friendly_name: 'Luftfeuchtigkeit Schlafzimmer'
value_template: '{{ state.sensor.dht22sz_h.state }}'
device_class: humidity
unit_of_measurement: '%'
State is still aunavailable
![image](https://community-assets.home-assistant.io/original/3X/0/0/002d91cfe8a313472c2ca56c976899a53b12cd8d.png)
First one should be states
value_template: '{{ states.sensor.dht22sz_h.state }}'
1 Like
many thanks ! It works now.
tom_l
6
And if you don’t want to get errors in your log when the sensor is not ready (during start up) use this format:
value_template: "{{ states('sensor.dht22sz_h') }}"