Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: display-meteo
- esp32:
- board: esp32dev
- framework:
- type: arduino
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- encryption:
- key: "the encryption key given by ESPhome/la chiave di cifratura data da ESPhome"
- ota:
- password: "the ota password given by ESPhome/la passord ota data da ESPhome"
- wifi:
- ssid: yourssid
- password: yourpasswrd
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Display-Meteo Fallback Hotspot"
- password: "w2sZz0b4ynIE"
- captive_portal:
- i2c:
- sda: 21
- scl: 22
- time:
- - platform: sntp
- id: my_time
- sensor:
- - platform: homeassistant
- id: temperatura_esterna
- entity_id: sensor.temperatura_esterna
- internal: true
- - platform: homeassistant
- id: umidita_esterna
- entity_id: sensor.umidita_esterna
- internal: true
- - platform: homeassistant
- id: vento
- entity_id: sensor.velocita_del_vento
- internal: true
- - platform: homeassistant
- id: pressione
- entity_id: sensor.pressione_esterna
- internal: true
- - platform: homeassistant
- id: pioggia
- entity_id: sensor.pioggia_giornaliera
- internal: true
- - platform: dht
- pin: 23
- temperature:
- name: "Temperatura soggiorno"
- id: tempint
- humidity:
- name: "Umidità soggiorno"
- update_interval: 10s
- text_sensor:
- - platform: homeassistant
- id: dir_vento
- entity_id: sensor.direzione_vento
- internal: true
- binary_sensor:
- - platform: homeassistant
- id: backlightdisplay
- entity_id: input_boolean.retroilluminazione_display
- on_press:
- then:
- - binary_sensor.template.publish:
- id: backlight
- state: ON
- on_release:
- then:
- - binary_sensor.template.publish:
- id: backlight
- state: OFF
- - platform: template
- id: backlight
- on_press:
- then:
- - lambda: |-
- id(mydisplay).backlight();
- on_release:
- then:
- - lambda: |-
- id(mydisplay).no_backlight();
- display:
- - platform: lcd_pcf8574
- dimensions: 20x4
- id: mydisplay
- address: 0x27
- lambda: |-
- it.strftime(" %H:%M %d.%m.%Y", id(my_time).now());
- it.printf(0, 1, "T: %.1f C", id(temperatura_esterna).state);
- it.printf(10, 1, "IN: %.1f C", id(tempint).state);
- it.printf(0, 2, "%.1f Kmh", id(vento).state);
- it.printf(9, 2, ">%s", id(dir_vento).state.c_str());
- it.printf(0, 3, "P: %.0fhPa", id(pressione).state);
- it.printf(11, 3, "R: %.1f mm", id(pioggia).state);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement