forked from ginkage/MHI-AC-Ctrl-ESPHome
-
Notifications
You must be signed in to change notification settings - Fork 2
/
mhi-woonkamer.yaml
106 lines (89 loc) · 2.83 KB
/
mhi-woonkamer.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
# Version 2.0
substitutions:
# Unique device ID in HA
deviceid: "mhi-woonkamer" #deviceid: "mhi_woonkamer"
# Unique device name in HA (sensor names will be prefixed by this name)
devicename: "MHI-Woonkamer" #devicename: "MHI-Woonkamer"
esphome:
name: mhi-woonkamer #name: mhi-woonkamer # Unique name (only change in small letters)
platform: ESP8266
board: d1_mini
platformio_options:
# Run CPU at 160Mhz to fix mhi_ac_ctrl_core.loop error: -2
board_build.f_cpu: 160000000L
includes:
- mhi_ac_ctrl.h
- MHI-AC-Ctrl-core.h
- MHI-AC-Ctrl-core.cpp
# Enable this for current units, supporting the larger framesize
# Comment if you encounter mhi_ac_ctrl_core.loop error: -2 errors and uncomment the legacy_framesize file
<<: !include conf/large_framesize.yaml
# Uncomment this to allow for a working configuration on floor units or older units
# <<: !include conf/legacy_framesize.yaml
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
#ssid: "Auchie IoT"
#password: "wuort023"
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${devicename}"
password: "configesp"
captive_portal:
logger:
level: DEBUG
baud_rate: 0
ota:
web_server:
port: 80
climate:
- platform: custom
lambda: |-
auto mhi_ac_ctrl = new MhiAcCtrl();
App.register_component(mhi_ac_ctrl);
return {mhi_ac_ctrl};
climates:
- name: "${devicename}"
id: ${deviceid}
api:
reboot_timeout: 0s
services:
# Call the set_api_room_temperature service from HA to override the room temperature
# If a new value has not been received after room_temp_api_timeout seconds, it will fall back to internal sensor
- service: set_api_room_temperature
variables:
value: float
then:
- lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->set_room_temperature(value);
# Call the set_vanes service from HA to set the vane position
# Needed because the ESPHome Climate class does not support this natively
# Possible values: 1-4: static positions, 5: swing, 0: unknown
- service: set_vanes
variables:
value: int
then:
- lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->set_vanes(value);
binary_sensor:
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_binary_sensors();
binary_sensors:
- name: ${devicename} defrost
text_sensor:
- platform: version
name: ${devicename} ESPHome Version
- platform: wifi_info
ip_address:
name: ${devicename} IP
ssid:
name: ${devicename} SSID
bssid:
name: ${devicename} BSSID
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_text_sensors();
text_sensors:
- name: ${devicename} compressor protection status