adapt espwater

This commit is contained in:
2025-02-03 14:52:47 +00:00
parent 3c694d2ee2
commit 6a9d5b686c

View File

@@ -3,23 +3,25 @@ esphome:
platform: ESP32 platform: ESP32
board: nodemcu-32s board: nodemcu-32s
logger: logger:
api: api:
# password: "feelhome123" password: !secret api_secret
encryption:
key: "pIj3rhf93C6iBLqk+rshFHkUed0bdJhtD1iE6pWkeUE="
ota: ota:
platform: esphome
# password: !ota_key
password: "5h4554h5x4th5x4d" password: "5h4554h5x4th5x4d"
wifi: wifi:
ssid: "lauIOT" ssid: !secret wireless_ssid
password: "superiot1" password: !secret wireless_key
domain: .home.cabestan.be domain: !secret wireless_domain
ap: ap:
ssid: "Espwater Fallback Hotspot" ssid: "ESPwater_Fallback"
password: "jTlMOFiFOzog" password: !secret ap_secret
captive_portal: captive_portal:
@@ -34,13 +36,19 @@ mqtt:
# password: sala45224 # password: sala45224
password: r5h4r65h4 password: r5h4r65h4
on_message: on_message:
topic: espwater/set_total_drop - topic: espwater/set_total_drop
qos: 0 qos: 0
then: then:
lambda: |- lambda: |-
// sprintf(id(lcd_line1),"|%s|%u|",x.c_str(),atol(x.c_str())); // sprintf(id(lcd_line1),"|%s|%u|",x.c_str(),atol(x.c_str()));
id(drops_absolute) = atol(x.c_str())*4; id(drops_absolute) = atol(x.c_str())*4;
sprintf(id(lcd_line1),"Set Total:%lu",id(drops_absolute)/4); sprintf(id(lcd_line1),"Set Total:%lu",id(drops_absolute)/4);
- topic: espwater/set_today_drop
qos: 0
then:
lambda: |-
id(drops_today) = atol(x.c_str())*4;
globals: globals:
# - id: software_version # - id: software_version
@@ -146,6 +154,9 @@ sensor:
lambda: |- lambda: |-
return id(drops_absolute)/4; return id(drops_absolute)/4;
update_interval: 60s update_interval: 60s
device_class: "water"
unit_of_measurement: "L"
state_class: total_increasing
- platform: template - platform: template
id: template_water_today id: template_water_today
name: "Water Today Liters" name: "Water Today Liters"
@@ -153,6 +164,8 @@ sensor:
return id(drops_today)/4; return id(drops_today)/4;
update_interval: 60s update_interval: 60s
state_class: measurement state_class: measurement
device_class: "water"
unit_of_measurement: "L"
#last_reset: 1970-01-01T00:00:00+00:00 #last_reset: 1970-01-01T00:00:00+00:00
binary_sensor: binary_sensor: