Dominik.W
(Dominik Weiland)
January 20, 2022, 4:09pm
1
Hello.
Who knows how can I expose a template sensor I created in ESP Home to Home Assistant?
this is my code :
sensor:
- platform: template
id: "pwmfan"
update_interval: 2s
accuracy_decimals: 0
lambda: |-
return id(fan).speed;
This shows me the % of my fan speed on the display connected to my ESP8266.
I want to show this in Home Assistant Lovelace, too.
Go into Configuration, Entities, and search for sensor.pwmfan. From there you can expose the entity information, and somewhere under there is an “Add to Lovelace” link, I believe.
Dominik.W
(Dominik Weiland)
January 20, 2022, 4:54pm
3
That´s my problem. There is no sensor.pwmfan. Only fan.pwmfan with that I can control it, but not the sensor entity…
Dominik.W
(Dominik Weiland)
January 20, 2022, 5:48pm
4
Okay. I got it!
I simply didn´t define a “name”
I added this and now the sensor is exposed to HA!
sensor:
- platform: template
name: "PWM Fan Speed"
id: "pwmfan"
update_interval: 2s
accuracy_decimals: 0
lambda: |-
return id(fan).speed;
1 Like
nickrout
(Nick Rout)
January 20, 2022, 6:45pm
5
IIRC if you don’t give a name, the sensor is internal only.