I’ve done so far…
In HA, settings > device & services > helpers, I’ve defined my input numbers:
setpoint_humedad
name: Setpoint Humedad
icon: mdi:water-percent-alert
initial: 30
min: 30
max: 70
step: 1
In HA, developer tools > template, I’ve defined my sensor template using the
previous input_numbers:
- platform: template
sensors:
setpoint_humedad:
value_template: ‘{{ states.input_number.setpoint_humedad.state | int }}’
Lastly, in ESPHome, (my wemos D1 mini pro device, edit yaml), I’ve defined
the homeassistant sensors:
- platform: homeassistant
name: “Setpoint Humedad”
entity_id: sensor.setpoint_humedad
Then as last part, i"ve to use the sensor in my ESPHome automation:
*** this is non-direction issue, I can not go further, so far I’ve see entity status
change and relay on/off, I would like to setup an setpoint wich define my humidity
fan start/stop.
Here’s part of the esp code (yaml)
switch:
- platform: gpio
pin: D6
id: "relay"
name: "Extractor Ducha"
inverted: true
sensor:
- platform: dht
model: "DHT11"
pin: D3
temperature:
id: "temperatura"
name: "Temperatura Ducha"
humidity:
id: "humedad"
name: "Humedad Ducha"
on_value_range:
- above: 60.0
then:
- switch.turn_on: "relay"
- below: 50.0
then:
- switch.turn_off: "relay"
update_interval: 10s
- platform: homeassistant
name: "Setpoint Humedad"
entity_id: sensor.setpoint_humedad
id: setpoint
internal: true
i2c:
sda: D2
scl: D1
font:
- file: 'NunitoSans-Regular.ttf'
id: font1
size: 17
- file: 'NunitoSans-Regular.ttf'
id: font2
size: 22
- file: 'NunitoSans-Regular.ttf'
id: font3
size: 40
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
address: 0x3C
lambda: |-
it.printf(0, 0, id(font2), "%.1f°C %.f%%", id(temperatura).state, id(humedad).state);
it.printf(0, 25, id(font1), "Setpoint");
it.printf(0, 42, id(font1), "Humedad");
it.printf(80, 20, id(font3), "60"); #### number 60 harcoded in order to see how it looks ####
Thing is that I cannot use either for SSD1306 display (just to replace the number 60, and to compare
the input_number value with id: “humedad” in order to turn on/off the switch “relay”
switch:
- platform: gpio
pin: D6
id: "relay"
thanks in advance
this is how it looks so far