Advertisement
xangin

MHI-C3

Feb 24th, 2025
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.11 KB | None | 0 0
  1. substitutions:
  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.  
  9. esphome:
  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.  
  17. external_components:
  18.   - source: github://hberntsen/mhi-ac-ctrl-esp32-c3/esphome
  19.     components: [ MhiAcCtrl ]
  20.  
  21. esp32:
  22.   board: airm2m_core_esp32c3
  23.   framework:
  24.     type: esp-idf
  25.  
  26. wifi:
  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.  
  38. captive_portal:
  39. # Enable logging
  40. logger:
  41.   baud_rate: 0 # disable serial logging;
  42. #  level: VERY_VERBOSE
  43.  
  44. # Enable Home Assistant API
  45. api:
  46. ota:
  47.   - platform: esphome
  48.  
  49.    
  50. status_led:
  51.   pin:
  52.     number: GPIO8 # Blue LED  
  53.     #inverted: True
  54.    
  55. # optional binary sensor to monitor serial connection:
  56. binary_sensor:
  57.   - platform: status
  58.     name: "Status"
  59.  
  60. button:
  61.   - platform: safe_mode
  62.     name: Safe Mode Boot
  63.     entity_category: diagnostic
  64.   - platform: restart
  65.     name: "Restart"
  66.    
  67. MhiAcCtrl:
  68.   id: ${mhi_device_id}
  69.   # Optional PIN config
  70.   # The default values are:
  71.   mosi_pin: GPIO6 #GPIO7
  72.   miso_pin: GPIO5 #GPIO2
  73.   sclk_pin: GPIO4 #GPIO6
  74.   cs_in_pin: GPIO7 #GPIO10
  75.   cs_out_pin: GPIO10 #GPIO9
  76.  
  77. climate:
  78.   - platform: MhiAcCtrl
  79.     mhi_ac_ctrl_id: ${mhi_device_id}
  80.     id: ${device_id}
  81.     name: "$devicename"
  82.  
  83. select:
  84.   - platform: MhiAcCtrl
  85.     mhi_ac_ctrl_id: ${mhi_device_id}
  86.     vanes_ud:
  87.       name: $devicename Vanes Up Down
  88.       id: ${device_id}_vanes_ud
  89.     vanes_lr:
  90.       name: $devicename Vanes Left Right
  91.       id: ${device_id}_vanes_lr
  92.  
  93. sensor:
  94.   - platform: MhiAcCtrl
  95.     mhi_ac_ctrl_id: ${mhi_device_id}
  96.     integrated_total_energy:
  97.       name: $devicename Energy
  98.       filters:
  99.         - throttle: 60s
  100.     power:
  101.       name: $devicename Power
  102.     frame_errors:
  103.       name: $devicename Frame errors
  104.     # Special sensor to filter out bursts of (small) temperature changes. When
  105.     # this sensor is present, the current temperature in the climate component
  106.     # will use the filtered value from this sensor..
  107.     #
  108.     # Use case: filtering out temperature jitter. See
  109.     # https://github.com/hberntsen/mhi-ac-ctrl-esp32-c3/issues/5
  110.     climate_current_temperature:
  111.      # Only id, no name so it won't be sent to home assistant as separate sensor
  112.       id: climate_current_temperature
  113.       filters:
  114.        # Check for new temperatures every 10 seconds
  115.         - heartbeat: 10s
  116.         # Home assistant does not show decimals
  117.         - round: 0
  118.         # The climate component will only send updates if the value is different
  119.  
  120.  
  121. switch:
  122.   - platform: MhiAcCtrl
  123.     mhi_ac_ctrl_id: ${mhi_device_id}
  124.     active_mode:
  125.       name: $devicename Active mode
  126.       id: ${device_id}_active_mode
  127.  
  128.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement