-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheconet-hpwh.yaml
48 lines (45 loc) · 1.54 KB
/
econet-hpwh.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
substitutions:
name: econet-hpwh
friendly_name: Water Heater
packages:
esphome-econet.esphome-econet: github://esphome-econet/esphome-econet/build-yaml/econet-hpwh-esp32s3.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
api:
encryption:
key: !secret api_enc
wifi: #test
ssid: !secret wifi_ssid
password: !secret wifi_password
sensor:
- platform: uptime #Uptime in Seconds
name: "${name}_wifi_uptime_seconds"
id: uptime_sensor
update_interval: 60s
internal: True
on_raw_value:
then:
- text_sensor.template.publish: # Lambda to adjust the time to be readable
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? String(days) + "d " : "") +
(hours ? String(hours) + "h " : "") +
(minutes ? String(minutes) + "m " : "") +
(String(seconds) + "s")
).c_str();
text_sensor: #Human Readable Uptime conversion
- platform: template
name: "${name}_wifi_uptime"
id: uptime_human
icon: mdi:clock-start
entity_category: "diagnostic" #If this is sti;l showing up in sensor category then device needs to be removed and re-added to HA