-
Notifications
You must be signed in to change notification settings - Fork 44
/
hp-debug.yaml
204 lines (174 loc) · 4.66 KB
/
hp-debug.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
substitutions:
name: "hpsejour"
friendly_name: Climatisation Séjour Debug
esphome:
name: ${name}
friendly_name: ${friendly_name}
esp8266:
board: esp01_1m
# mqtt:
# broker: homeassistant.local
# username: heatpumpSejour
# password: !secret mqtt_password
# discovery: true
# Enable logging
logger:
hardware_uart: UART1
level: DEBUG
logs:
CN105Climate: DEBUG
sensor: DEBUG
chkSum : INFO
WRITE : DEBUG
READ : DEBUG
Decoder : DEBUG
# Enable Home Assistant API
api:
services:
- service: reboot
then:
- logger.log: "Redémarrage en cours..."
- lambda: |-
ESP.restart();
- service: set_remote_temperature
variables:
temperature: float
then:
- lambda: 'id(clim_seb).set_remote_temperature(temperature);'
- service: use_internal_temperature
then:
- lambda: 'id(clim_seb).set_remote_temperature(0);'
encryption:
key: !secret encryption_key
ota:
- platform: esphome
password: !secret ota_pwd
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
#networks:
#- ssid : !secret wifi_ssid
# password: !secret wifi_password
#- ssid: !secret wifi_ssid2
# password: !secret wifi_password2
#- ssid: !secret wifi_ssid2
# password: !secret wifi_password2
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Heatpump-Sejour Fallback Hotspot"
password: !secret ota_pwd
captive_portal:
#web_server:
# port: 80
time:
- platform: homeassistant
id: homeassistant_time
# Chemin vers les fichiers C++ personnalisés
external_components:
- source:
type: local
path: components
#external_components:
# - source: github://echavet/MitsubishiCN105ESPHome
# refresh: 0s ## to force refresh sources every compile time
# Text sensors with general information.
text_sensor:
# Expose ESPHome version as sensor.
# - platform: version
# name: ${name} ESPHome Version
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: ${name} IP
ssid:
name: ${name} SSID
bssid:
name: ${name} BSSID
# Sensors with general information.
#sensor:
# Uptime sensor.
# - platform: uptime
# name: ${name} Uptime
# WiFi Signal sensor.
# - platform: wifi_signal
# name: ${name} WiFi Signal
# update_interval: 60s
uart:
id: HP_UART
baud_rate: 2400
tx_pin: GPIO1
rx_pin: GPIO3
# Configuration pour l'objet 'climate'
climate:
- platform: cn105 # remplis avec la plateforme de ton choix
name: "Clim Seb"
id: "clim_seb"
update_interval: 4s
# Ajoute d'autres paramètres spécifiques à ton matériel et tes besoins
# Configuration pour l'objet 'select' pour choisir un baud_rate
select:
- platform: template
name: "Baud Rate Select"
id: baud_rate_select
entity_category: DIAGNOSTIC
#setup_priority : -100.0 ## late
options:
#- "400"
#- "1200"
- "2400"
- "4800"
- "9600"
#- "19200"
#- "38400"
#- "57600"
#- "115200"
optimistic: true
on_value:
- lambda: |-
int baud_rate = atoi(x.c_str());
id(clim_seb).set_baud_rate(baud_rate);
#id(baud_rate_select).publish_state(x);
# extra_components in the code automatically add them
# sensor:
# - platform: template
# name: Operating (Clim)
# lambda: |-
# return(id(clim_seb).is_operating());
# - platform: template
# name: Compressor Frequency (Clim)
# lambda: |-
# return(id(clim_seb).get_compressor_frequency());
# Configuration pour l'objet 'switch' (bouton)
switch:
- platform: template
name: "UART Setup Switch"
id: uart_setup_switch
entity_category: DIAGNOSTIC
#setup_priority : -100.0 ## late
optimistic: true
turn_on_action:
- lambda: |-
// Appelle la méthode 'setupUART' quand le switch est activé
id(clim_seb).setupUART();
turn_off_action:
- lambda: |-
// Appelle la méthode 'setupUART' quand le switch est activé
id(clim_seb).disconnectUART();
- platform: template
name: "Send 1st packet Switch"
id: send_packet_switch
entity_category: DIAGNOSTIC
#setup_priority : -100.0 ## late
optimistic: true
turn_on_action:
- lambda: |-
id(clim_seb).sendFirstConnectionPacket();
- platform: template
name: "Send request Info packets"
id: build_and_send_requests_info_packets
entity_category: DIAGNOSTIC
#setup_priority : -100.0 ## late
optimistic: true
turn_on_action:
- lambda: |-
id(clim_seb).buildAndSendRequestsInfoPackets();