-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathexample_mod_chrg.yaml
75 lines (69 loc) · 1.41 KB
/
example_mod_chrg.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
substitutions:
friendly_name: Microfire Mod-CHRG
device_name: microfire-mod-chrg-espnow
esphome:
name: $device_name
esp32:
board: esp32dev
framework:
type: arduino
logger:
globals:
- id: sent
type: int
restore_value: no
initial_value: '0'
now_mqtt:
on_sent:
then:
- lambda: id(sent)++;
- if:
condition:
lambda: 'return id(sent) == 13;'
then:
- lambda: id(sent) = 0;
- deep_sleep.enter:
id: sleep_
sleep_duration: 5min
deep_sleep:
id: sleep_
# import the component
external_components:
- source:
type: local
path: ./esphome/components/
# https://esphome.io/components/i2c.html
i2c:
sda: 21
scl: 22
scan: true
sensor:
- platform: mod_chrg
id: chrg
update_interval: 10s
state:
name: Charge state
battery_temperature:
name: Battery temperature
battery_voltage:
name: Battery Voltage
system_voltage:
name: System Voltage
bus_voltage:
name: Bus Voltage
input_voltage:
name: VPMID Voltage
battery_current:
name: Battery Current
bus_current:
name: Bus Current
die_temperature:
name: Die Temperature
bus_fault:
name: Bus voltage Fault
battery_fault:
name: Battery Fault
system_fault:
name: System Fault
thermal_shutdown:
name: Thermal Shutdown