-
Notifications
You must be signed in to change notification settings - Fork 7
/
ESP8266.yaml
125 lines (104 loc) · 3.04 KB
/
ESP8266.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
esphome:
name: esplinky
platform: ESP8266
board: d1_mini
# déclaration du fichier source du composant custom (déposer la fichier my_tic_component.h à la racine de ESPhome)
includes:
- my_tic_component.h
wifi:
ssid: "XXXXXXXXXXXXX"
password: "XXXXXXXXXXXXX"
# facultative web server, enable if you need it
web_server:
port: 80
# Example configuration entry
#debug: # When enabled, logger must be at least debug (default) below.
# Logger configuration
logger:
baud_rate: 0 # disable logging via UART, help to avoid numerous crash with ESP_LOGD
level: INFO # INFO for less log, put DEBUG to view all the linky's "étiquettes" received in the logs
esp8266_store_log_strings_in_flash: False # recommanded for ESP8266 https://esphome.io/components/sensor/custom.html
# Enable Home Assistant API (set a password here for more security)
api:
password: ''
# Enable OTA (set a password here for more security)
ota:
password: ''
# ajout du composant uart pour la communication série avec la sortie TIC du compteur
# GPIO13 = Pin D7 sur Wemos D1
uart:
# tx_pin: GPIO15
rx_pin: GPIO13
baud_rate: 1200
id: uart0
parity: EVEN
data_bits: 7
stop_bits: 1
# alias pour accéder l'instance du composant
substitutions:
name: "TIC"
init: 'MyTicComponent::instance(id(uart0));'
# déclaration du composant custom
custom_component:
- id: my_tic
lambda: |-
auto my_tic = ${init}
App.register_component(my_tic);
return {my_tic};
# déclaration des sensors numérique
# les sensors doivent être déclarés dans l'ordre de la fonction lambda
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
unit_of_measurement: dB
accuracy_decimals: 0
force_update: false
icon: mdi:wifi
- platform: uptime
name: "Uptime Sensor"
update_interval: 60s
unit_of_measurement: s
accuracy_decimals: 0
force_update: false
icon: mdi:timer
- platform: custom
lambda: |-
auto my_tic = ${init}
return {my_tic->sensor_IINST, my_tic->sensor_ISOUSC, my_tic->sensor_PAPP, my_tic->sensor_BASE};
sensors:
- name: "EDF-Intensite"
unit_of_measurement: A
accuracy_decimals: 0
icon: mdi:power-plug
- name: "EDF-Intensite souscrite"
unit_of_measurement: A
accuracy_decimals: 0
icon: mdi:power-plug
- name: "EDF-Puissance"
unit_of_measurement: W
accuracy_decimals: 0
icon: mdi:power-plug
- name: "EDF-Index"
unit_of_measurement: kWh
accuracy_decimals: 0
icon: mdi:home-analytics
# déclaration du sensor texte, c'est juste l'identifiant du compteur
text_sensor:
- platform: custom
lambda: |-
auto my_tic = ${init}
return {my_tic->sensor_ADCO};
text_sensors:
name: "ADCO"
binary_sensor:
- platform: status
name: "NodeMCU Status"
# switch permettant de stopper les mises à jour
switch:
- platform: custom
lambda: |-
auto my_tic = ${init}
return{my_tic};
switches:
name: "Receive"