echavet / MitsubishiCN105ESPHome

Mix of MisubishiHeatpump from SwiCago and esphome-mitsubishiheatpump from Geoffdavis.
161 stars 32 forks source link

Reporting 0C/32F current temperature #140

Open tmchow opened 1 month ago

tmchow commented 1 month ago

without remote temperature sensor configuration, my unit is reporting a current temp of 0 degrees celcius for some reason.

Screenshot from the web server: image

(In HA since it’s reporting in Fahrenheit it says it’s 32F). I expected this to work right out of the box so confused why it’s not.

My config:

substitutions:
  name: my-room-climate
  friendly_name: My Room Climate

esphome:
  name: ${name}
  friendly_name: ${friendly_name} 

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
    version: latest

light:
  - platform: esp32_rmt_led_strip
    name: Led
    id: led
    internal: true
    rgb_order: GRB
    pin: 35
    num_leds: 4
    rmt_channel: 1
    chipset: ws2812
    restore_mode: ALWAYS_ON

uart:
  id: HP_UART
  baud_rate: 2400
  tx_pin: GPIO2
  rx_pin: GPIO1

# Default logging level
logger:
  level: INFO

external_components:
  - source: github://echavet/MitsubishiCN105ESPHome

api:
  encryption:
    key: !secret esp_encryption_key
  services:
    - service: reboot
      then:
        - logger.log: "Reboot in progress..."
        - lambda: |-
            ESP.restart();
ota:
  - platform: esphome
    password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "My-Room-Atom-S3-Lite"
    password: !secret wifi_password

captive_portal:

web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time

# Create a button to restart the unit from HomeAssistant. Rarely needed, but can be handy.
button:
  - platform: restart
    name: "Restart ${friendly_name}"

# Climate entity configuration
climate:
  - platform: cn105
    name: "My Room Climate"
    icon: mdi:heat-pump
    compressor_frequency_sensor:
      name: ${name} Compressor Frequency
    vertical_vane_select:
      name: ${name} Vertical Vane
    horizontal_vane_select:
      name: ${name} Horizontal Vane
    debounce_delay : 500ms
    update_interval: 4s  # update interval can be ajusted after a first run and logs monitoring* 

text_sensor:
  - platform: wifi_info
    ip_address:
      name: IP
    ssid:
      name: SSID
    bssid:
      name: BSSID

  - platform: version
    name: Version
    hide_timestamp: true
    disabled_by_default: false
    icon: mdi:new-box
    entity_category: diagnostic

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: "Uptime"
    disabled_by_default: false
    force_update: false
    unit_of_measurement: s
    icon: mdi:timer-outline
    accuracy_decimals: 0
    device_class: duration
    state_class: total_increasing
    entity_category: diagnostic
    update_interval: 60s

  - platform: internal_temperature
    name: Internal Esp temperature
    entity_category: diagnostic

  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: Signaal dB
    id: wifi_signal_db
    update_interval: 60s
    entity_category: diagnostic

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: Signaal %
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: " %"
    entity_category: diagnostic
    device_class: ""

switch:
  - platform: template
    id: eps32_s3_led_switch
    name: Led switch #${led_switch}
    optimistic: true
    restore_mode: RESTORE_DEFAULT_ON 
    lambda: return id(eps32_s3_led_switch).state;
    turn_on_action:
      - light.turn_on:
          id: led
          brightness: !lambda |-
            // output value must be in range 0 - 1.0
            return id(led_brightness).state / 100.0;
    turn_off_action:
      - light.turn_off:
          id: led

number:
    ## Set led brightness
  - platform: template
    id: led_brightness
    name: Led brightness #${led_brightness}
    icon: mdi:toggle-switch-variant
    mode: slider
    entity_category: config
    optimistic: true
    min_value: 0
    max_value: 100
    step: 10
    initial_value: 70
    restore_value: yes
    unit_of_measurement: "%"
    on_value:
      then:
        - if:
            condition:
              - light.is_on: led
            then:
              - light.turn_on:
                id: led
                brightness: !lambda |-
                  // output value must be in range 0 - 1.0
                  return id(led_brightness).state / 100.0;
phidauex commented 1 month ago

Can you confirm which heatpump you have? The only difference I see between a clean setup and yours is that you are using the arduino framework rather than esp-idf. It is my understanding that the latest versions of this component need the esp-idf framework for ESP32 devices: https://github.com/echavet/MitsubishiCN105ESPHome#step-3-configure-the-board-and-uart-settings

That might require changes to your LED strip configuration, but even if you commented those sections out for the moment just to test if a build using esp-idf works, that might help.

echavet commented 1 month ago

Wow I didn't know that

I'll check if the arduino framework is still supported when I am back from holiday. Near 9th August

phidauex commented 1 month ago

I could be wrong, I thought that was something you had changed a few releases ago in order to implement a better UART?

echavet commented 1 month ago

Yes but it is still supposed to work with arduino fw.

tmchow commented 1 month ago

@phidauex

Can you confirm which heatpump you have? The only difference I see between a clean setup and yours is that you are using the arduino framework rather than esp-idf. It is my understanding that the latest versions of this component need the esp-idf framework for ESP32 devices: https://github.com/echavet/MitsubishiCN105ESPHome#step-3-configure-the-board-and-uart-settings

That might require changes to your LED strip configuration, but even if you commented those sections out for the moment just to test if a build using esp-idf works, that might help.

I've tried to use esp-idf but each time I do, i get an error which i documented here: https://github.com/echavet/MitsubishiCN105ESPHome/issues/138

I get the following CMAKE error. I'm very new to arduino and esp so is likely just some dumb error on my part.But as soon as I use type: arduino it works.

Installing collected packages: pyparsing, urllib3, tqdm, six, pyyaml, pycparser, packaging, msgpack, kconfiglib, idna, future, filelock, contextlib2, colorama, click, charset-normalizer, certifi, schema, requests, cffi, requests-toolbelt, requests-file, cryptography, cachecontrol, idf-component-manager
Successfully installed cachecontrol-0.14.0 certifi-2024.7.4 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-3.4.8 filelock-3.15.4 future-1.0.0 idf-component-manager-1.5.3 idna-3.7 kconfiglib-13.7.1 msgpack-1.0.8 packaging-24.1 pycparser-2.22 pyparsing-2.3.1 pyyaml-6.0.1 requests-2.32.3 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.66.4 urllib3-1.26.19
Reading CMake configuration...
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Configuring incomplete, errors occurred!
See also "/data/build/ruby-room-climate/.pioenvs/ruby-room-climate/CMakeFiles/CMakeOutput.log".
See also "/data/build/ruby-room-climate/.pioenvs/ruby-room-climate/CMakeFiles/CMakeError.log".

CMake Error at CMakeLists.txt:2 (include):
  include could not find load file:

    /data/cache/platformio/packages/framework-espidf/tools/cmake/project.cmake

CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.