· 10 months ago · Feb 24, 2025, 11:00 AM
1substitutions:
2 devicename: climate-mhi
3 mhi_device_id: climate_mhi
4 device_id: "climate_m"
5 upper_devicename: "Climate-MHI"
6 brand: "MHI"
7 model_name: "Climate"
8
9esphome:
10 name: $devicename
11 friendly_name: ${upper_devicename}
12 comment: ESP32C3 for $model_name
13 project:
14 name: "$brand.$model_name"
15 version: "ESP32C3" #hardware
16
17external_components:
18 - source: github://hberntsen/mhi-ac-ctrl-esp32-c3/esphome
19 components: [ MhiAcCtrl ]
20
21esp32:
22 board: airm2m_core_esp32c3
23 framework:
24 type: esp-idf
25
26wifi:
27 networks:
28 - ssid: !secret wifi_ssid
29 password: !secret wifi_password
30 - ssid: !secret my_phone_ap_ssid
31 password: !secret my_phone_ap_password
32
33 # Enable fallback hotspot (captive portal) in case wifi connection fails
34 ap:
35 ssid: ${devicename}
36 password: "12345678"
37
38captive_portal:
39
40# Enable logging
41logger:
42 baud_rate: 0 # disable serial logging;
43# level: VERY_VERBOSE
44
45# Enable Home Assistant API
46api:
47
48ota:
49 - platform: esphome
50
51
52status_led:
53 pin:
54 number: GPIO8 # Blue LED
55 #inverted: True
56
57# optional binary sensor to monitor serial connection:
58binary_sensor:
59 - platform: status
60 name: "Status"
61
62button:
63 - platform: safe_mode
64 name: Safe Mode Boot
65 entity_category: diagnostic
66 - platform: restart
67 name: "Restart"
68
69MhiAcCtrl:
70 id: ${mhi_device_id}
71 # Optional PIN config
72 # The default values are:
73 mosi_pin: GPIO6 #GPIO7
74 miso_pin: GPIO5 #GPIO2
75 sclk_pin: GPIO4 #GPIO6
76 cs_in_pin: GPIO7 #GPIO10
77 cs_out_pin: GPIO10 #GPIO9
78
79climate:
80 - platform: MhiAcCtrl
81 mhi_ac_ctrl_id: ${mhi_device_id}
82 id: ${device_id}
83 name: "$devicename"
84
85select:
86 - platform: MhiAcCtrl
87 mhi_ac_ctrl_id: ${mhi_device_id}
88 vanes_ud:
89 name: $devicename Vanes Up Down
90 id: ${device_id}_vanes_ud
91 vanes_lr:
92 name: $devicename Vanes Left Right
93 id: ${device_id}_vanes_lr
94
95sensor:
96 - platform: MhiAcCtrl
97 mhi_ac_ctrl_id: ${mhi_device_id}
98 integrated_total_energy:
99 name: $devicename Energy
100 filters:
101 - throttle: 60s
102 power:
103 name: $devicename Power
104 frame_errors:
105 name: $devicename Frame errors
106 # Special sensor to filter out bursts of (small) temperature changes. When
107 # this sensor is present, the current temperature in the climate component
108 # will use the filtered value from this sensor..
109 #
110 # Use case: filtering out temperature jitter. See
111 # https://github.com/hberntsen/mhi-ac-ctrl-esp32-c3/issues/5
112 climate_current_temperature:
113 # Only id, no name so it won't be sent to home assistant as separate sensor
114 id: climate_current_temperature
115 filters:
116 # Check for new temperatures every 10 seconds
117 - heartbeat: 10s
118 # Home assistant does not show decimals
119 - round: 0
120 # The climate component will only send updates if the value is different
121
122
123switch:
124 - platform: MhiAcCtrl
125 mhi_ac_ctrl_id: ${mhi_device_id}
126 active_mode:
127 name: $devicename Active mode
128 id: ${device_id}_active_mode
129
130