Skip to content

Commit

Permalink
Merge pull request #3 from RoboMagus/cleanup_confs
Browse files Browse the repository at this point in the history
Move all entities related to AC-ctrl into conf files and anything unr…
  • Loading branch information
RobertJansen1 authored Mar 22, 2024
2 parents 1590f41 + 8668c20 commit 839c46b
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 19 deletions.
36 changes: 29 additions & 7 deletions conf/large_framesize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,32 @@ globals:
- id: room_temp_api_timeout
type: int
restore_value: no
initial_value: '120'
initial_value: "120"
- id: frame_size
type: byte
restore_value: no
initial_value: '33' # 20 for legacy, 33 for new
initial_value: "33" # 20 for legacy, 33 for new

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}

binary_sensor:
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_binary_sensors();
binary_sensors:
- name: ${devicename} defrost

sensor:
- platform: uptime
name: Uptime
- platform: wifi_signal
name: WiFi Signal
update_interval: 60s
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_sensors();
Expand Down Expand Up @@ -96,6 +110,14 @@ sensor:
id(fan_control_3Dauto).publish_state(false);
}
text_sensor:
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_text_sensors();
text_sensors:
- name: ${devicename} compressor protection status

select:
- platform: template
name: Fan Control Left Right
Expand Down
36 changes: 29 additions & 7 deletions conf/legacy_framesize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,32 @@ globals:
- id: room_temp_api_timeout
type: int
restore_value: no
initial_value: '120'
initial_value: "120"
- id: frame_size
type: byte
restore_value: no
initial_value: '20' # 20 for legacy, 33 for new
initial_value: "20" # 20 for legacy, 33 for new

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}

binary_sensor:
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_binary_sensors();
binary_sensors:
- name: ${devicename} defrost

sensor:
- platform: uptime
name: Uptime
- platform: wifi_signal
name: WiFi Signal
update_interval: 60s
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_sensors();
Expand Down Expand Up @@ -59,6 +73,14 @@ sensor:
- name: Outdoor unit discharge pipe super heat
- name: Protection error state

text_sensor:
- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_text_sensors();
text_sensors:
- name: ${devicename} compressor protection status

select:
- platform: template
name: Fan Control Up Down
Expand Down
19 changes: 14 additions & 5 deletions lr_mhi_ac_ctrl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ esphome:
- 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
packages:
# Comment if you encounter mhi_ac_ctrl_core.loop error: -2 errors and uncomment the legacy_framesize file
mhi-ac-ctrl: !include conf/large_framesize.yaml
# Uncomment this to allow for a working configuration on floor units or older units
# mhi-ac-ctrl: !include conf/legacy_framesize.yaml

wifi:
ssid: "**SSID**"
Expand Down Expand Up @@ -74,6 +74,14 @@ api:
- lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->set_vanes(value);
sensor:
- platform: uptime
name: Uptime
- platform: wifi_signal
name: WiFi Signal
update_interval: 60s

binary_sensor:
- platform: custom
lambda: |-
Expand All @@ -98,3 +106,4 @@ text_sensor:
text_sensors:
- name: Compressor protection status

0 comments on commit 839c46b

Please sign in to comment.