Because it seems not possible to get the fanspeed directly in webserver I want to display the current percentage value of my fan component seperately.
But how I can get the current value and get a sensor with it’s value ?
Here is my created fan:
fan:
- platform: speed
id: the_fan
output: fan_pwm
name: $name Fan
speed_count: 100
on_turn_on:
- switch.turn_on: fan_power
- logger.log: "Fan Turned On"
- fan.turn_on:
id: the_fan
speed: 1 #turn on the fan with initially 1% instead of 100%
on_turn_off:
- switch.turn_off: fan_power
- logger.log: "Fan Turned Off"
/config/esphome/wr-lufter-dallas-sensor.yaml: In lambda function:
/config/esphome/wr-lufter-dallas-sensor.yaml:182:3: error: control reaches end of non-void function [-Werror=return-type]
^^^That part is pushing values into the sensor when the fan is on and speed changes, and the {} is just retaining the current value. It’s valid way to do it I think. Might be a cleaner way but I think it’s ok.