I have two DS18b20 sensors on an esp01, they work very well so far. Additionally I need another template sensor, which gives me the average value of the two sensors. But I can’t get any further with the configuration.
Post what you have.
Hey,
now I have two sensors:
- platform: dallas
address: 0xF501192A17D2D628
id: left_side
name: "Sensor1"
- platform: dallas
address: 0xBC01192A0FF24928
id: right_side
name: "Sensor2"
what I have, to create 3rd sensor, which give me the overage of Sensor1 and Sensor2
I hope so is ok?
Try
value_template: "{{ (states('sensor.Sensor1') |float + states('sensor.Sensor2') | float ) / 2}}"
That’s for home assistant. Look at the post category, an ESPHome template is required.
Try this Diddlik:
sensor:
- platform: template
name: "Average Temperature"
lambda: |-
return (id(left_side).state + id(right_side).state)/2;
update_interval: 60s
ups sorry :-X
1 Like
It works fine!!!
1 Like
Don’t feel bad. I made the same mistake ukro, then Sneaky edited my post
ahah haha