geoffdavis / esphome-mitsubishiheatpump

ESPHome Climate Component for Mitsubishi Heatpumps using direct serial connection
BSD 2-Clause "Simplified" License
583 stars 156 forks source link

Current Temperature: nan°C #71

Open k0nkiShell opened 2 years ago

k0nkiShell commented 2 years ago

Hello

First of all thanks for your work :)

I have managed to make it work in a duct machine, everything works except that the temperature of the room comes out as "Current Temperature: nan°C"

imagen

Do you know if there is any way to solve this and take the value of the machine???

In Home assistant I don't get the temperature of the room either.

I've tried with the service in home assistant, but I can't get anything, I'm sure I'm doing something wrong....

api: services:

This is the climate I use:

climate:

Thank you very much :)

geoffdavis commented 2 years ago

Wild guess is bidirectional comms are not actually working. I originally had the library not update until the heat pump acknowledged the change, but now it optimistically sets the current state to the requested state...

All that's to say - you should verify that you actually have bidirectional comms working. Level shifters or voltage divider circuit.

k0nkiShell commented 2 years ago

Ok, I'll try again, I had a Level shifters set, but I removed it because at first it didn't work for me and it turns out that it was because my machine needs 2400 baud to communicate :man_facepalming:.

Right now it's directly connected.

I'll try to put the Level shifters and I'll tell you.

Thanks for the reply :)

k0nkiShell commented 2 years ago

Well, no luck, I've tried a voltage divider, but it still doesn't work, the rest of the values if I get them right, in fact I turn the machine on and off, I can set the different operating modes, I can set the temperature I want , that is if I can only put integers, that is, I cannot put the temperature at 25.5º, it leaves it at 25º....

It could be because it has two temperature probes, the machine is controlled from a PAR-31 thermostat and I think it has a temperature probe apart from the one on the machine.

imagen

I will continue investigating to see if I find why, it does not return the temperature of the room correctly,

Thank you very much

DavidLBCN commented 1 year ago

Hello,

I'm running the same issue than @kikonkike

Does anyone have a solution or any additional information?

Thanks for all your work.

slackpj commented 1 year ago

EDIT:GOT IT WORKING! Hi I've got the same issue.. I believe my issue is with the bidirectional communication too, as I can send commands (from home assistant TO Aircon), but if I use the IR remote control, theres no feedback of the changes (From Aircon TO Home Assistant)

I'm using a d1 mini v3.0.0...(https://www.wemos.cc/en/latest/_static/files/sch_d1_mini_v3.0.0.pdf) I had to change my baud_rate to 2400 for anything to work (tried 4800 and 9600 with and without the pull up resistors)

Originally had no pull up resistors, just used direct cable, and I had the same issue, so I've tired the pull up resistors, and I've still got the same problem

Any other ideas?

AC unit a new unit MSZ-AP25VGD (Australia) with no external temperature probes

EDIT: Found my issue! looking closely at the schematic, I noticed that RX and TX were connected to the CH340C chip (usb adapter).. I couldn't see the traces on the board, I believe they go through holes to the other side of the board... I just cut the RX/TX pins off the CH340C chip, and everything is working... with the pull up resistors... not sure if they are needed or not, will test it on my second AC unit)... I assume I wont be able to use the usb to reflash now, but not really an issue with OTA updates

EDIT2: seems I did not need the pull up resistors, built another one and skipped the resistors and it's working fine so far

echavet commented 1 year ago

Same for me. With esphome. But it works well in both direction with mitsubishi2MQTT.

nixmaster2000 commented 1 year ago

I have the same problem where I can send commands to the AC but can't get status back.

I have a ducted PEA-M100 indoor unit (Australia) with a PAR-41MAA wall controller. I'm controlling with a WT32-ETH01 connected via a level shifter (but also got the same results using 10k pull-ups).

The WT32-ETH01 has on-board LEDs tied to the TX and RX pins of UART2 so you can see when comms are happening. When sending a command from the ESP the TX LED gives a short flash followed by a short flash on the RX LED and the AC starts operating. If any commands are sent from the wall controller there are no LED flashes on the ESP, which suggests to me that this particular AC unit isn't offering updates via the CN105 connector.

I've been hunting around to see if there's a service setting in the AC to enable this but so far haven't found anything.

EDIT: I should add that this is a brand new current model AC system in case Mitsubishi are making changes to their protocol.

KazWolfe commented 1 year ago

@nixmaster2000 I spent far too many hours debugging this today, and what I finally found is that the WT32-ETH01's UART ports apparently are... weird. I had to manually patch this library to define the pins to use for TX/RX.

This was done by editing this line:

https://github.com/geoffdavis/esphome-mitsubishiheatpump/blob/980271337a87970ff0e3607c61ee12150c16f524/components/mitsubishi_heatpump/espmhp.cpp#L459

and making the following change:

-     if (hp->connect(this->get_hw_serial_(), this->baud_, -1, -1)) {
+     if (hp->connect(this->get_hw_serial_(), this->baud_, 5, 17)) {

This seems like a definitions issue somewhere, but I'm honestly not sure where to report and everything at least appears to be working now.

geoffdavis commented 1 year ago

Good find! It sounds to me like the WT32-ETH01 uses different tx and rx pins than the defaults for that platform. I suppose the Platform definitions might be updated to make note of the different default tx and rx pins, but I have no idea how that works at the Platform.IO layer.

I personally haven't run any of this code on an ESP32 myself, I have it all running on ESP_01S boards. All of the ESP32 is from other contributors. With that said...

Also note that the code doesn't interact too closely with the UART component from ESPHome itself. There may be some options to set pins in a UART component, but I'm not using them because the SwiCago/HeatPump library didn't support them when I first wrote this.

Some breadcrumbs for anyone that wants to dig in further:

ESPHOME supports tx_pin and rx_pin for the UART component, but for our purposes it only has an effect on ESP32. (It forces a software serial mode on the 8266 which SwiCago/HeatPump doesn't know how to use.)

The ESPHome code, at least for the ESP32 takes those tx_pin and rx_pin definitions and uses them in a direct call to Serial.connect(), same as what SwiCago/HeatPump is doing.

I imagine that extending the configuration schema for this custom component to add tx_pin and rx_pin definitions (defaulting them to -1), and then passing that to the hp->connect() call would do what you need it to do.

nixmaster2000 commented 1 year ago

@KazWolfe do you still specify the UART pins in your yaml config after making this patch? I've attempted the change you made but on first go I'm not having any luck.

Here's my relevant yaml:

climate:
  - platform: mitsubishi_heatpump
    name: "Living Areas"
    hardware_uart: UART2
    baud_rate: 2400
    update_interval: 500ms

uart:
  tx_pin: 17
  rx_pin: 5
  baud_rate: 2400
  rx_buffer_size: 512
KazWolfe commented 1 year ago

I imagine that extending the configuration schema for this custom component to add tx_pin and rx_pin definitions (defaulting them to -1), and then passing that to the hp->connect() call would do what you need it to do.

Seems to already be done, nice. Didn't know that branch existed.

do you still specify the UART pins in your yaml config after making this patch? I've attempted the change you made but on first go I'm not having any luck.

No, I just manually patched the .cpp file. If you want to switch to the develop branch temporarily though (at least until that's cut/merged?), I tested the following to work:

external_components:
  - source: github://geoffdavis/esphome-mitsubishiheatpump@develop

climate:
  - platform: mitsubishi_heatpump
    name: "Living Areas"
    hardware_uart: UART2
    tx_pin: 17
    rx_pin: 5
    baud_rate: 2400
    update_interval: 500ms

My specific configuration also has a SparkFun level shifter in-line with the TXD/RXD pins for safety's sake, but that shouldn't actually matter (?).

(Edit: seems like setting SWING_MODE to VERTICAL crashes the ESP32. I'll open a separate unrelated bug for this later, because that's... weird.)

Desperado88 commented 1 year ago

Hello,

Thank you for your integration work.

I tried to run my esp-01 module on my Mitsubitshi Ecodan ERST20D-VM2D heat pump, but without success.

Communication doesn't work at all. I have access to my esp but the instructions are not received by the heat pump, no change of instructions. I modified the BAUD, without success.

I followed the instructions available here: https://github.com/geoffdavis/esphome-mitsubishiheatpump/tree/master

With Home Assistant 2023.11.1 and ESPHome 2023.10.6.

Do you have any ideas ?

Here are my logs and my installation:

INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/esp-01s-pac.yaml...
INFO Detected timezone 'Europe/Paris'
INFO Starting log output from esp-01s-pac.local using esphome API
INFO Successfully connected to esp-01s-pac.local
[22:25:02][I][app:102]: ESPHome version 2023.10.6 compiled on Nov  5 2023, 21:55:54
[22:25:02][C][wifi:546]: WiFi:
[22:25:02][C][wifi:382]:   Local MAC: B4:E6:2D:7B:FE:58
[22:25:02][C][wifi:383]:   SSID: [redacted]
[22:25:02][C][wifi:384]:   IP Address: 192.168.1.73
[22:25:02][C][wifi:385]:   BSSID: [redacted]
[22:25:02][C][wifi:387]:   Hostname: 'esp-01s-pac'
[22:25:02][C][wifi:389]:   Signal strength: -81 dB ▂▄▆█
[22:25:02][C][wifi:393]:   Channel: 11
[22:25:02][C][wifi:394]:   Subnet: 255.255.255.0
[22:25:02][C][wifi:395]:   Gateway: 192.168.1.1
[22:25:02][C][wifi:396]:   DNS1: 192.168.1.1
[22:25:02][C][wifi:397]:   DNS2: 0.0.0.0
[22:25:02][C][logger:416]: Logger:
[22:25:02][C][logger:417]:   Level: DEBUG
[22:25:02][C][logger:418]:   Log Baud Rate: 0
[22:25:02][C][logger:420]:   Hardware UART: UART0
[22:25:02][C][uptime.sensor:031]: Uptime Sensor 'hptest Uptime'
[22:25:02][C][uptime.sensor:031]:   Device Class: 'duration'
[22:25:02][C][uptime.sensor:031]:   State Class: 'total_increasing'
[22:25:02][C][uptime.sensor:031]:   Unit of Measurement: 's'
[22:25:02][C][uptime.sensor:031]:   Accuracy Decimals: 0
[22:25:02][C][uptime.sensor:031]:   Icon: 'mdi:timer-outline'
[22:25:02][C][homeassistant.time:010]: Home Assistant Time:
[22:25:02][C][homeassistant.time:011]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[22:25:02][C][version.text_sensor:021]: Version Text Sensor 'hptest ESPHome Version'
[22:25:02][C][version.text_sensor:021]:   Icon: 'mdi:new-box'
[22:25:02][I][MitsubishiHeatPump:062]: ESPHome MitsubishiHeatPump version 2.4.1
[22:25:02][I][MitsubishiHeatPump:504]:   Supports HEAT: YES
[22:25:02][I][MitsubishiHeatPump:505]:   Supports COOL: YES
[22:25:02][I][MitsubishiHeatPump:506]:   Supports AWAY mode: NO
[22:25:02][I][MitsubishiHeatPump:507]:   Saved heat: -1.0
[22:25:02][I][MitsubishiHeatPump:508]:   Saved cool: -1.0
[22:25:02][I][MitsubishiHeatPump:509]:   Saved auto: -1.0
[22:25:02][C][captive_portal:088]: Captive Portal:
[22:25:03][C][web_server:161]: Web Server:
[22:25:03][C][web_server:162]:   Address: esp-01s-pac.local:80
[22:25:04][C][mdns:115]: mDNS:
[22:25:04][C][mdns:116]:   Hostname: esp-01s-pac
[22:25:04][C][ota:097]: Over-The-Air Updates:
[22:25:04][C][ota:098]:   Address: esp-01s-pac.local:8266
[22:25:04][C][ota:101]:   Using Password.
[22:25:04][C][api:139]: API Server:
[22:25:04][C][api:140]:   Address: esp-01s-pac.local:6053
[22:25:04][C][api:142]:   Using noise encryption: YES
[22:25:04][C][wifi_info:009]: WifiInfo IPAddress 'hptest IP'
[22:25:04][C][wifi_info:011]: WifiInfo SSID 'hptest SSID'
[22:25:04][C][wifi_info:012]: WifiInfo BSSID 'hptest BSSID'
[22:25:04][C][wifi_signal.sensor:009]: WiFi Signal 'hptest WiFi Signal'
[22:25:04][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[22:25:04][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[22:25:04][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[22:25:04][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[22:25:09][D][climate:011]: 'Test Heatpump' - Setting
[22:25:09][D][climate:015]:   Mode: HEAT
[22:25:09][D][MitsubishiHeatPump:241]: control - Was HeatPump updated? YES
[22:25:09][D][climate:380]: 'Test Heatpump' - Sending state:
[22:25:09][D][climate:383]:   Mode: HEAT
[22:25:09][D][climate:385]:   Action: IDLE
[22:25:09][D][climate:388]:   Fan Mode: OFF
[22:25:09][D][climate:400]:   Swing Mode: OFF
[22:25:09][D][climate:403]:   Current Temperature: nan°C
[22:25:09][D][climate:409]:   Target Temperature: nan°C
[22:25:10][W][component:214]: Component api took a long time for an operation (1.02 s).
[22:25:10][W][component:215]: Components should block for at most 20-30ms.
[22:25:13][D][climate:011]: 'Test Heatpump' - Setting
[22:25:13][D][climate:040]:   Target Temperature: 22.00
[22:25:13][D][MitsubishiHeatPump:241]: control - Was HeatPump updated? YES
[22:25:13][D][climate:380]: 'Test Heatpump' - Sending state:
[22:25:13][D][climate:383]:   Mode: HEAT
[22:25:13][D][climate:385]:   Action: IDLE
[22:25:13][D][climate:388]:   Fan Mode: OFF
[22:25:13][D][climate:400]:   Swing Mode: OFF
[22:25:13][D][climate:403]:   Current Temperature: nan°C
[22:25:13][D][climate:409]:   Target Temperature: 22.00°C
[22:25:14][W][component:214]: Component api took a long time for an operation (1.02 s).
[22:25:14][W][component:215]: Components should block for at most 20-30ms.
substitutions:
  name: hptest
  friendly_name: Test Heatpump

esphome:
  name: esp-01s-pac
  friendly_name: PAC

#esp8266:
  platform: ESP8266
  board: esp01_1m

# Enable Home Assistant API
api:
  encryption:
    key: "******************************************"

ota:
  password: "***********************"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-01S-Pac Fallback Hotspot"
    password: "**********"

captive_portal:

# Enable logging
logger:
  baud_rate: 0

# Enable Web server.
web_server:
  port: 80

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

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: ${name} ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: ${name} IP
    ssid:
      name: ${name} SSID
    bssid:
      name: ${name} BSSID

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: ${name} Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: ${name} WiFi Signal
    update_interval: 60s

external_components:
  - source: github://geoffdavis/esphome-mitsubishiheatpump

climate:
  - platform: mitsubishi_heatpump
    name: "${friendly_name}"
    id: hp

    # ESP32 uniquement - remplacez UART0 par UART1 ou UART2 et supprimez le
    # logging:baud_rate ci-dessus pour permettre à l'UART0 intégré de fonctionner pendant
    # journalisation.
    hardware_uart: UART0
    # Décomenter les lignes suivantes en fonction des usages, defaut 4800
    baud_rate: 2400 #0, 2400 ou 9600, defaut 4800
    supports:
       mode: [ COOL, HEAT]
    #   fan_mode: [AUTO, LOW, MEDIUM, HIGH]
    #   swing_mode: [OFF, VERTICAL]
    visual:
      min_temperature: 16
      max_temperature: 31
      temperature_step: 1.0

IMG_4029 IMG_4066

Thank you so much

echavet commented 1 year ago

Hello, I had the same problem. So I changed many little things looking at the code from mistubishi2mqtt, because this one was working well with my heaters.

https://github.com/gysmo38/mitsubishi2MQTT

Now I've got it working... You can have a look if you want.

Here is my espconf: Note that I'm using my GitHub rep.

substitutions: name: "hpsejour" friendly_name: Climatisation Séjour

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

esp8266: board: esp01_1m

mqtt: broker: homeassistant.local username: heatpumpSejour password: !secret mqtt_password discovery: true

Enable logging

logger: hardware_uart: UART1 level: DEBUG logs: MitsubishiHeatPump: DEBUG HeatPump: WARN json: WARN sensor: WARN

packetSent : DEBUG

#packetRecv : DEBUG
#Decoder    : VERBOSE

Enable Home Assistant API

api: services:

services:

- service: set_remote_temperature
  variables:
    temperature: float
  then:
    - lambda: 'id(hp_sejour).set_remote_temperature(temperature);'

- service: use_internal_temperature
  then:
    - lambda: 'id(hp_sejour).set_remote_temperature(0);'

encryption: key: "***"

ota: password: "***"

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

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "Heatpump-Sejour Fallback Hotspot" password: "****"

captive_portal:

web_server: port: 80

Sync time with Home Assistant.

time:

external_components:

external_components:

- source:

type: local

path: components/mitsubishi_heatpump

    # Text sensors with general information.

text_sensor:

Expose ESPHome version as sensor.

Sensors with general information.

sensor:

Uptime sensor.

climate:

Le dim. 5 nov. 2023, 23:00, Desperado88 @.***> a écrit :

Hello,

Thank you for your integration work.

I tried to run my esp-01 module on my Mitsubitshi Ecodan ERST20D-VM2D heat pump, but without success.

Communication doesn't work at all. I have access to my esp but the instructions are not received by the heat pump, no change of instructions. I modified the BAUD, without success.

I followed the instructions available here: https://github.com/geoffdavis/esphome-mitsubishiheatpump/tree/master

With Home Assistant 2023.11.1 and ESPHome 2023.10.6.

Do you have any ideas ?

Here are my logs and my installation:

INFO ESPHome 2023.10.6 INFO Reading configuration /config/esphome/esp-01s-pac.yaml... INFO Detected timezone 'Europe/Paris' INFO Starting log output from esp-01s-pac.local using esphome API INFO Successfully connected to esp-01s-pac.local [22:25:02][I][app:102]: ESPHome version 2023.10.6 compiled on Nov 5 2023, 21:55:54

[22:25:02][C][wifi:382]: Local MAC: B4:E6:2D:7B:FE:58 [22:25:02][C][wifi:383]: SSID: [redacted] [22:25:02][C][wifi:384]: IP Address: 192.168.1.73 [22:25:02][C][wifi:385]: BSSID: [redacted]

[22:25:02][C][wifi:389]: Signal strength: -81 dB ▂▄▆█ [22:25:02][C][wifi:393]: Channel: 11 [22:25:02][C][wifi:394]: Subnet: 255.255.255.0 [22:25:02][C][wifi:395]: Gateway: 192.168.1.1 [22:25:02][C][wifi:396]: DNS1: 192.168.1.1 [22:25:02][C][wifi:397]: DNS2: 0.0.0.0

[22:25:02][C][logger:417]: Level: DEBUG [22:25:02][C][logger:418]: Log Baud Rate: 0 [22:25:02][C][logger:420]: Hardware UART: UART0 [22:25:02][C][uptime.sensor:031]: Uptime Sensor 'hptest Uptime' [22:25:02][C][uptime.sensor:031]: Device Class: 'duration' [22:25:02][C][uptime.sensor:031]: State Class: 'total_increasing' [22:25:02][C][uptime.sensor:031]: Unit of Measurement: 's' [22:25:02][C][uptime.sensor:031]: Accuracy Decimals: 0

[22:25:02][C][homeassistant.time:010]: Home Assistant Time:

[22:25:02][C][version.text_sensor:021]: Version Text Sensor 'hptest ESPHome Version'

[22:25:02][I][MitsubishiHeatPump:062]: ESPHome MitsubishiHeatPump version 2.4.1 [22:25:02][I][MitsubishiHeatPump:504]: Supports HEAT: YES [22:25:02][I][MitsubishiHeatPump:505]: Supports COOL: YES [22:25:02][I][MitsubishiHeatPump:506]: Supports AWAY mode: NO [22:25:02][I][MitsubishiHeatPump:507]: Saved heat: -1.0 [22:25:02][I][MitsubishiHeatPump:508]: Saved cool: -1.0 [22:25:02][I][MitsubishiHeatPump:509]: Saved auto: -1.0 [22:25:02][C][captive_portal:088]: Captive Portal: [22:25:03][C][web_server:161]: Web Server: [22:25:03][C][web_server:162]: Address: esp-01s-pac.local:80

[22:25:04][C][mdns:116]: Hostname: esp-01s-pac [22:25:04][C][ota:097]: Over-The-Air Updates: [22:25:04][C][ota:098]: Address: esp-01s-pac.local:8266 [22:25:04][C][ota:101]: Using Password. [22:25:04][C][api:139]: API Server: [22:25:04][C][api:140]: Address: esp-01s-pac.local:6053 [22:25:04][C][api:142]: Using noise encryption: YES [22:25:04][C][wifi_info:009]: WifiInfo IPAddress 'hptest IP' [22:25:04][C][wifi_info:011]: WifiInfo SSID 'hptest SSID' [22:25:04][C][wifi_info:012]: WifiInfo BSSID 'hptest BSSID' [22:25:04][C][wifi_signal.sensor:009]: WiFi Signal 'hptest WiFi Signal' [22:25:04][C][wifi_signal.sensor:009]: Device Class: 'signal_strength' [22:25:04][C][wifi_signal.sensor:009]: State Class: 'measurement' [22:25:04][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm' [22:25:04][C][wifi_signal.sensor:009]: Accuracy Decimals: 0 [22:25:09][D][climate:011]: 'Test Heatpump' - Setting [22:25:09][D][climate:015]: Mode: HEAT [22:25:09][D][MitsubishiHeatPump:241]: control - Was HeatPump updated? YES [22:25:09][D][climate:380]: 'Test Heatpump' - Sending state: [22:25:09][D][climate:383]: Mode: HEAT [22:25:09][D][climate:385]: Action: IDLE [22:25:09][D][climate:388]: Fan Mode: OFF [22:25:09][D][climate:400]: Swing Mode: OFF [22:25:09][D][climate:403]: Current Temperature: nan°C [22:25:09][D][climate:409]: Target Temperature: nan°C [22:25:10][W][component:214]: Component api took a long time for an operation (1.02 s). [22:25:10][W][component:215]: Components should block for at most 20-30ms. [22:25:13][D][climate:011]: 'Test Heatpump' - Setting [22:25:13][D][climate:040]: Target Temperature: 22.00 [22:25:13][D][MitsubishiHeatPump:241]: control - Was HeatPump updated? YES [22:25:13][D][climate:380]: 'Test Heatpump' - Sending state: [22:25:13][D][climate:383]: Mode: HEAT [22:25:13][D][climate:385]: Action: IDLE [22:25:13][D][climate:388]: Fan Mode: OFF [22:25:13][D][climate:400]: Swing Mode: OFF [22:25:13][D][climate:403]: Current Temperature: nan°C [22:25:13][D][climate:409]: Target Temperature: 22.00°C [22:25:14][W][component:214]: Component api took a long time for an operation (1.02 s). [22:25:14][W][component:215]: Components should block for at most 20-30ms.

substitutions: name: hptest friendly_name: Test Heatpump

esphome: name: esp-01s-pac friendly_name: PAC

esp8266:

platform: ESP8266 board: esp01_1m

Enable Home Assistant API

api: encryption: key: "**"

ota: password: "***"

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

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "Esp-01S-Pac Fallback Hotspot" password: "**"

captive_portal:

Enable logging

logger: baud_rate: 0

Enable Web server.

web_server: port: 80

Sync time with Home Assistant.

time:

  • platform: homeassistant id: homeassistant_time

Text sensors with general information.

text_sensor:

Expose ESPHome version as sensor.

  • platform: version name: ${name} ESPHome Version

    Expose WiFi information as sensors.

  • platform: wifi_info ip_address: name: ${name} IP ssid: name: ${name} SSID bssid: name: ${name} BSSID

Sensors with general information.

sensor:

Uptime sensor.

  • platform: uptime name: ${name} Uptime

    WiFi Signal sensor.

  • platform: wifi_signal name: ${name} WiFi Signal update_interval: 60s

external_components:

  • source: github://geoffdavis/esphome-mitsubishiheatpump

climate:

  • platform: mitsubishi_heatpump name: "${friendly_name}" id: hp

    ESP32 uniquement - remplacez UART0 par UART1 ou UART2 et supprimez le

    logging:baud_rate ci-dessus pour permettre à l'UART0 intégré de fonctionner pendant

    journalisation.

    hardware_uart: UART0

    Décomenter les lignes suivantes en fonction des usages, defaut 4800

    baud_rate: 2400 #0, 2400 ou 9600, defaut 4800 supports: mode: [ COOL, HEAT]

    fan_mode: [AUTO, LOW, MEDIUM, HIGH]

    swing_mode: [OFF, VERTICAL]

    visual: min_temperature: 16 max_temperature: 31 temperature_step: 1.0

[image: IMG_4029] https://user-images.githubusercontent.com/102601357/280557269-93e6a3b3-5ddb-4f34-b648-b7e500ddba43.JPG [image: IMG_4066] https://user-images.githubusercontent.com/102601357/280557272-4e16ce34-df06-495c-8101-b4a460403a9b.JPG

Thank you so much

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1793858467, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBB6XPI745L2ID77ZY3YDAD6TAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTHA2TQNBWG4 . You are receiving this because you commented.Message ID: @.***>

Desperado88 commented 1 year ago

Hello,

Thank you for your reply.

I modified my code to match yours. It seems to work better but the commands still do not work, even though the connection seems established (see log).

I tried the MQTT code alone, but the result is worse, it can't even connect to the boiler.

Does anyone understand what Warnings [W] mean ? I also don't understand what the last lines of your code, "action_state_topic: "mitsubishi2mqtt/sejour/state"", are for files on Git?

Always up for ideas, thank you.

Here are my logs:

[20:34:51][D][MitsubishiHeatPump:062]: update() called
[20:34:51][D][MitsubishiHeatPump:067]: hp->isConnected=false ;@( 
[20:34:53][D][MitsubishiHeatPump:373]: Connection à la clim établie
[20:34:53][D][packetSent:399]: FC 5A 01 30 02 CA 01 A8 
[20:34:54][W][HeatPump:639]: did not find any start, returning an error...
[20:34:54][W][component:214]: Component esphome.coroutine took a long time for an operation (3.03 s).
[20:34:54][W][component:215]: Components should block for at most 20-30ms.
[20:34:54][C][logger:416]: Logger:
[20:34:54][C][logger:417]:   Level: DEBUG
[20:34:54][C][logger:418]:   Log Baud Rate: 115200
[20:34:54][C][logger:420]:   Hardware UART: UART1
[20:34:54][C][logger:424]:   Level for 'MitsubishiHeatPump': DEBUG
[20:34:54][C][logger:424]:   Level for 'HeatPump': WARN
[20:34:54][C][logger:424]:   Level for 'json': WARN
[20:34:54][C][logger:424]:   Level for 'sensor': WARN
[...]
[20:35:09][I][MitsubishiHeatPump:064]: ESPHome MitsubishiHeatPump version 2.4.1
[20:35:09][I][MitsubishiHeatPump:617]:   Version de Eric Chavet 1.0
[20:35:09][I][MitsubishiHeatPump:618]:   Supports HEAT: YES
[20:35:09][I][MitsubishiHeatPump:619]:   Supports COOL: YES
[20:35:09][I][MitsubishiHeatPump:620]:   Supports AWAY mode: NO
[20:35:09][I][MitsubishiHeatPump:621]:   Saved heat: -1.0
[20:35:09][I][MitsubishiHeatPump:622]:   Saved cool: -1.0
[20:35:09][I][MitsubishiHeatPump:623]:   Saved auto: -1.0
[20:35:09][I][MitsubishiHeatPump:624]:   ---- 
[20:35:09][I][MitsubishiHeatPump:625]:   hp : 
[20:35:09][I][MitsubishiHeatPump:626]: heatpump connected:
[20:35:09][D][MitsubishiHeatPump:627]: heatpump room temp: 0.000000
[20:35:09][I][MitsubishiHeatPump:628]: heatpump room temp: 0.000000
[20:35:09][D][MitsubishiHeatPump:629]: heatpump operating: 
[20:35:09][I][MitsubishiHeatPump:630]:   ---- 
[20:35:09][I][MitsubishiHeatPump:635]: Using callbacks
[20:35:09][D][MitsubishiHeatPump:062]: update() called
[20:35:09][D][MitsubishiHeatPump:067]: hp->isConnected=false ;@( 
[20:35:11][D][MitsubishiHeatPump:373]: Connection à la clim établie
[20:35:11][D][packetSent:399]: FC 5A 01 30 02 CA 01 A8 
[...]
[20:37:37][D][climate:011]: 'PAC' - Setting
[20:37:37][D][climate:040]:   Target Temperature: 21.00
[20:37:37][D][MitsubishiHeatPump:256]: control - Was HeatPump updated? YES
[20:37:37][D][climate:380]: 'PAC' - Sending state:
[20:37:37][D][climate:383]:   Mode: HEAT
[20:37:37][D][climate:385]:   Action: IDLE
[20:37:37][D][climate:388]:   Fan Mode: OFF
[20:37:37][D][climate:400]:   Swing Mode: OFF
[20:37:37][D][climate:403]:   Current Temperature: 0.00°C
[20:37:37][D][climate:409]:   Target Temperature: 21.00°C
[20:37:37][D][packetSent:399]: FC 41 01 30 10 01 07 00 01 01 0A 00 00 00 00 00 00 00 00 00 00 6A 
[20:37:38][W][HeatPump:864]: AUCUNE donnée disponible!
[20:37:38][D][Decoder:867]: [packet decode is a FAILLURE]
[...]
[20:37:59][I][ota:117]: Boot seems successful, resetting boot loop counter.

![Capture d’écran 2023-11-06 à 20 26 53]

Thank you

(https://github.com/geoffdavis/esphome-mitsubishiheatpump/assets/102601357/5d5901b3-3ebf-4c05-98fc-3e52c5539f88)

echavet commented 1 year ago

Hey

Sorry Geoff I don't remember why I chose to customize my Matt topics. This is not code, these last lines are just custom topics for the mqtt. I don't think that the mqtt config is mandatory because you can use the esphome homeassistant integration to access your heater. I had to make it work through mqtt.

Le lun. 6 nov. 2023, 20:52, Desperado88 @.***> a écrit :

Hello,

Thank you for your reply.

I modified my code to match yours. It seems to work better but the commands still do not work, even though the connection seems established (see log).

I tried the MQTT code alone, but the result is worse, it can't even connect to the boiler.

Does anyone understand what Warnings [W] mean ? I also don't understand what the last lines of your code, "action_state_topic: "mitsubishi2mqtt/sejour/state"", are for files on Git?

Always up for ideas, thank you.

Here are my logs:

[20:34:51][D][MitsubishiHeatPump:062]: update() called [20:34:51][D][MitsubishiHeatPump:067]: hp->isConnected=false ;@( [20:34:53][D][MitsubishiHeatPump:373]: Connection à la clim établie [20:34:53][D][packetSent:399]: FC 5A 01 30 02 CA 01 A8 [20:34:54][W][HeatPump:639]: did not find any start, returning an error... [20:34:54][W][component:214]: Component esphome.coroutine took a long time for an operation (3.03 s). [20:34:54][W][component:215]: Components should block for at most 20-30ms.

[20:34:54][C][logger:417]: Level: DEBUG [20:34:54][C][logger:418]: Log Baud Rate: 115200 [20:34:54][C][logger:420]: Hardware UART: UART1 [20:34:54][C][logger:424]: Level for 'MitsubishiHeatPump': DEBUG [20:34:54][C][logger:424]: Level for 'HeatPump': WARN [20:34:54][C][logger:424]: Level for 'json': WARN [20:34:54][C][logger:424]: Level for 'sensor': WARN [...] [20:35:09][I][MitsubishiHeatPump:064]: ESPHome MitsubishiHeatPump version 2.4.1 [20:35:09][I][MitsubishiHeatPump:617]: Version de Eric Chavet 1.0 [20:35:09][I][MitsubishiHeatPump:618]: Supports HEAT: YES [20:35:09][I][MitsubishiHeatPump:619]: Supports COOL: YES [20:35:09][I][MitsubishiHeatPump:620]: Supports AWAY mode: NO [20:35:09][I][MitsubishiHeatPump:621]: Saved heat: -1.0 [20:35:09][I][MitsubishiHeatPump:622]: Saved cool: -1.0 [20:35:09][I][MitsubishiHeatPump:623]: Saved auto: -1.0

[20:35:09][I][MitsubishiHeatPump:625]: hp : [20:35:09][I][MitsubishiHeatPump:626]: heatpump connected: [20:35:09][D][MitsubishiHeatPump:627]: heatpump room temp: 0.000000 [20:35:09][I][MitsubishiHeatPump:628]: heatpump room temp: 0.000000 [20:35:09][D][MitsubishiHeatPump:629]: heatpump operating:

[20:35:09][I][MitsubishiHeatPump:635]: Using callbacks [20:35:09][D][MitsubishiHeatPump:062]: update() called [20:35:09][D][MitsubishiHeatPump:067]: hp->isConnected=false ;@( [20:35:11][D][MitsubishiHeatPump:373]: Connection à la clim établie [20:35:11][D][packetSent:399]: FC 5A 01 30 02 CA 01 A8 [...] [20:37:37][D][climate:011]: 'PAC' - Setting [20:37:37][D][climate:040]: Target Temperature: 21.00 [20:37:37][D][MitsubishiHeatPump:256]: control - Was HeatPump updated? YES [20:37:37][D][climate:380]: 'PAC' - Sending state: [20:37:37][D][climate:383]: Mode: HEAT [20:37:37][D][climate:385]: Action: IDLE [20:37:37][D][climate:388]: Fan Mode: OFF [20:37:37][D][climate:400]: Swing Mode: OFF [20:37:37][D][climate:403]: Current Temperature: 0.00°C [20:37:37][D][climate:409]: Target Temperature: 21.00°C [20:37:37][D][packetSent:399]: FC 41 01 30 10 01 07 00 01 01 0A 00 00 00 00 00 00 00 00 00 00 6A [20:37:38][W][HeatPump:864]: AUCUNE donnée disponible! [20:37:38][D][Decoder:867]: [packet decode is a FAILLURE] [...] [20:37:59][I][ota:117]: Boot seems successful, resetting boot loop counter.

![Capture d’écran 2023-11-06 à 20 26 53]

Thank you

( https://github.com/geoffdavis/esphome-mitsubishiheatpump/assets/102601357/5d5901b3-3ebf-4c05-98fc-3e52c5539f88 )

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1796238273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBBFJ5RBTPD3GL4CJ7DYDE5ZTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGIZTQMRXGM . You are receiving this because you commented.Message ID: @.***>

echavet commented 1 year ago

I have added some logs in the code. Some logs are not reliable. It says it is connected to the heater. But it is not. The heater does not seem to be connected well in yours logs. Sorry you have to dig deeper ! Perhaps you did not connect the Rx tx correctly. Perhaps your heater does not work with this project. In my case the esp couldn't get it's UART to work with the heater until I unplugged the programming usb port from my raspberry pi. I had 2 uart in my esphome yaml conf because one was used for the heater and the other for me logs. But I don't know why both didn't work together at the same time.

Le lun. 6 nov. 2023, 20:52, Desperado88 @.***> a écrit :

Hello,

Thank you for your reply.

I modified my code to match yours. It seems to work better but the commands still do not work, even though the connection seems established (see log).

I tried the MQTT code alone, but the result is worse, it can't even connect to the boiler.

Does anyone understand what Warnings [W] mean ? I also don't understand what the last lines of your code, "action_state_topic: "mitsubishi2mqtt/sejour/state"", are for files on Git?

Always up for ideas, thank you.

Here are my logs:

[20:34:51][D][MitsubishiHeatPump:062]: update() called [20:34:51][D][MitsubishiHeatPump:067]: hp->isConnected=false ;@( [20:34:53][D][MitsubishiHeatPump:373]: Connection à la clim établie [20:34:53][D][packetSent:399]: FC 5A 01 30 02 CA 01 A8 [20:34:54][W][HeatPump:639]: did not find any start, returning an error... [20:34:54][W][component:214]: Component esphome.coroutine took a long time for an operation (3.03 s). [20:34:54][W][component:215]: Components should block for at most 20-30ms.

[20:34:54][C][logger:417]: Level: DEBUG [20:34:54][C][logger:418]: Log Baud Rate: 115200 [20:34:54][C][logger:420]: Hardware UART: UART1 [20:34:54][C][logger:424]: Level for 'MitsubishiHeatPump': DEBUG [20:34:54][C][logger:424]: Level for 'HeatPump': WARN [20:34:54][C][logger:424]: Level for 'json': WARN [20:34:54][C][logger:424]: Level for 'sensor': WARN [...] [20:35:09][I][MitsubishiHeatPump:064]: ESPHome MitsubishiHeatPump version 2.4.1 [20:35:09][I][MitsubishiHeatPump:617]: Version de Eric Chavet 1.0 [20:35:09][I][MitsubishiHeatPump:618]: Supports HEAT: YES [20:35:09][I][MitsubishiHeatPump:619]: Supports COOL: YES [20:35:09][I][MitsubishiHeatPump:620]: Supports AWAY mode: NO [20:35:09][I][MitsubishiHeatPump:621]: Saved heat: -1.0 [20:35:09][I][MitsubishiHeatPump:622]: Saved cool: -1.0 [20:35:09][I][MitsubishiHeatPump:623]: Saved auto: -1.0

[20:35:09][I][MitsubishiHeatPump:625]: hp : [20:35:09][I][MitsubishiHeatPump:626]: heatpump connected: [20:35:09][D][MitsubishiHeatPump:627]: heatpump room temp: 0.000000 [20:35:09][I][MitsubishiHeatPump:628]: heatpump room temp: 0.000000 [20:35:09][D][MitsubishiHeatPump:629]: heatpump operating:

[20:35:09][I][MitsubishiHeatPump:635]: Using callbacks [20:35:09][D][MitsubishiHeatPump:062]: update() called [20:35:09][D][MitsubishiHeatPump:067]: hp->isConnected=false ;@( [20:35:11][D][MitsubishiHeatPump:373]: Connection à la clim établie [20:35:11][D][packetSent:399]: FC 5A 01 30 02 CA 01 A8 [...] [20:37:37][D][climate:011]: 'PAC' - Setting [20:37:37][D][climate:040]: Target Temperature: 21.00 [20:37:37][D][MitsubishiHeatPump:256]: control - Was HeatPump updated? YES [20:37:37][D][climate:380]: 'PAC' - Sending state: [20:37:37][D][climate:383]: Mode: HEAT [20:37:37][D][climate:385]: Action: IDLE [20:37:37][D][climate:388]: Fan Mode: OFF [20:37:37][D][climate:400]: Swing Mode: OFF [20:37:37][D][climate:403]: Current Temperature: 0.00°C [20:37:37][D][climate:409]: Target Temperature: 21.00°C [20:37:37][D][packetSent:399]: FC 41 01 30 10 01 07 00 01 01 0A 00 00 00 00 00 00 00 00 00 00 6A [20:37:38][W][HeatPump:864]: AUCUNE donnée disponible! [20:37:38][D][Decoder:867]: [packet decode is a FAILLURE] [...] [20:37:59][I][ota:117]: Boot seems successful, resetting boot loop counter.

![Capture d’écran 2023-11-06 à 20 26 53]

Thank you

( https://github.com/geoffdavis/esphome-mitsubishiheatpump/assets/102601357/5d5901b3-3ebf-4c05-98fc-3e52c5539f88 )

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1796238273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBBFJ5RBTPD3GL4CJ7DYDE5ZTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGIZTQMRXGM . You are receiving this because you commented.Message ID: @.***>

Desperado88 commented 1 year ago

Hello,

Thank you very much,

I tested by changing the rx and tx, but the result is the same. If I comment on bebug's lines, I can't do anything anymore.

My heat pump is an air/water pump not air/air, that may be the problem. I connected a green USB UART adapter to the CN105 socket, but I didn't see any frames. It doesn't matter what the BAUD is. It may not be possible on my device to connect a wifi module, you are right.

Thanks for your help anyway.

adepssimius commented 1 year ago

@KazWolfe I tried your configuration with a WT32-ETH01 board and when I went to install on the board I got a bunch of compile errors from the develop branch. I don't do C++ so I'm not sure where to go with it. I do see part of the error stating note: 'std::optional' is only available from C++17 onwards, but not sure what to do about that.


Compiling .pioenvs/wt32-eth01-2/src/main.cpp.o
In file included from src/esphome.h:28,
                 from src/esphome/components/mitsubishi_heatpump/espmhp.h:20,
                 from src/esphome/components/mitsubishi_heatpump/espmhp.cpp:21:
src/esphome/components/mitsubishi_heatpump/espmhp.h:163:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operating_timeout_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:163:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operating_timeout_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:164:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idle_timeout_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:164:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idle_timeout_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:165:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_ping_timeout_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:165:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_ping_timeout_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:166:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_remote_temperature_sensor_update_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:166:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_remote_temperature_sensor_update_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:167:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_ping_request_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:167:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_ping_request_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'virtual void MitsubishiHeatPump::control(const esphome::climate::ClimateCall&)':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:129:9: error: 'last_remote_temperature_sensor_update_' was not declared in this scope
     if (last_remote_temperature_sensor_update_.has_value()) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:129:9: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout'
     if (last_remote_temperature_sensor_update_.has_value()) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         enforce_remote_temperature_sensor_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_temperature(float)':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:450:9: error: 'last_remote_temperature_sensor_update_' was not declared in this scope
         last_remote_temperature_sensor_update_ =
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:450:9: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout'
         last_remote_temperature_sensor_update_ =
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         enforce_remote_temperature_sensor_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:453:9: error: 'last_remote_temperature_sensor_update_' was not declared in this scope
         last_remote_temperature_sensor_update_.reset();
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:453:9: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout'
         last_remote_temperature_sensor_update_.reset();
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         enforce_remote_temperature_sensor_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::ping()':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:461:5: error: 'last_ping_request_' was not declared in this scope
     last_ping_request_ = std::chrono::steady_clock::now();
     ^~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_operating_timeout_minutes(int)':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:466:5: error: 'remote_operating_timeout_' was not declared in this scope
     remote_operating_timeout_ = std::chrono::minutes(minutes);
     ^~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:466:5: note: suggested alternative: 'set_remote_operating_timeout_minutes'
     remote_operating_timeout_ = std::chrono::minutes(minutes);
     ^~~~~~~~~~~~~~~~~~~~~~~~~
     set_remote_operating_timeout_minutes
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_idle_timeout_minutes(int)':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:471:5: error: 'remote_idle_timeout_' was not declared in this scope
     remote_idle_timeout_ = std::chrono::minutes(minutes);
     ^~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:471:5: note: suggested alternative: 'set_timeout'
     remote_idle_timeout_ = std::chrono::minutes(minutes);
     ^~~~~~~~~~~~~~~~~~~~
     set_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_ping_timeout_minutes(int)':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:476:5: error: 'remote_ping_timeout_' was not declared in this scope
     remote_ping_timeout_ = std::chrono::minutes(minutes);
     ^~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:476:5: note: suggested alternative: 'set_timeout'
     remote_ping_timeout_ = std::chrono::minutes(minutes);
     ^~~~~~~~~~~~~~~~~~~~
     set_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::enforce_remote_temperature_sensor_timeout()':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:481:9: error: 'remote_ping_timeout_' was not declared in this scope
     if (remote_ping_timeout_.has_value() && last_ping_request_.has_value()) {
         ^~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:481:9: note: suggested alternative: 'set_timeout'
     if (remote_ping_timeout_.has_value() && last_ping_request_.has_value()) {
         ^~~~~~~~~~~~~~~~~~~~
         set_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:481:45: error: 'last_ping_request_' was not declared in this scope
     if (remote_ping_timeout_.has_value() && last_ping_request_.has_value()) {
                                             ^~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:28: error: 'remote_operating_timeout_' was not declared in this scope
         this->operating_ ? remote_operating_timeout_ : remote_idle_timeout_;
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:28: note: suggested alternative: 'set_remote_operating_timeout_minutes'
         this->operating_ ? remote_operating_timeout_ : remote_idle_timeout_;
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
                            set_remote_operating_timeout_minutes
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:56: error: 'remote_idle_timeout_' was not declared in this scope
         this->operating_ ? remote_operating_timeout_ : remote_idle_timeout_;
                                                        ^~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:56: note: suggested alternative: 'set_timeout'
         this->operating_ ? remote_operating_timeout_ : remote_idle_timeout_;
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        set_timeout
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:496:13: error: 'last_remote_temperature_sensor_update_' was not declared in this scope
             last_remote_temperature_sensor_update_.has_value()) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:496:13: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout'
             last_remote_temperature_sensor_update_.has_value()) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             enforce_remote_temperature_sensor_timeout
In file included from src/esphome.h:28,
                 from src/main.cpp:3:
src/esphome/components/mitsubishi_heatpump/espmhp.h:163:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operating_timeout_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:163:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operating_timeout_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:164:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idle_timeout_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:164:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idle_timeout_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:165:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_ping_timeout_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:165:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_ping_timeout_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:166:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_remote_temperature_sensor_update_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:166:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_remote_temperature_sensor_update_;
         ^~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:167:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_ping_request_;
              ^~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:167:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_ping_request_;
         ^~~
*** [.pioenvs/wt32-eth01-2/src/esphome/components/mitsubishi_heatpump/espmhp.cpp.o] Error 1
*** [.pioenvs/wt32-eth01-2/src/main.cpp.o] Error 1
========================= [FAILED] Took 25.46 seconds =========================```
echavet commented 1 year ago

Esp32 and Esp8266 does not share the same libs. I don't think this conf works with esp32.

Le sam. 11 nov. 2023, 05:41, adepssimius @.***> a écrit :

@KazWolfe https://github.com/KazWolfe @geoffdavis https://github.com/geoffdavis I tried your configuration with a WT32-ETH01 board and when I went to install on the board I got a bunch of compile errors from the develop branch. I don't do C++ so I'm not sure where to go with it. I do see part of the error stating note: 'std::optional' is only available from C++17 onwards, but not sure what to do about that.

Compiling .pioenvs/wt32-eth01-2/src/main.cpp.o In file included from src/esphome.h:28, from src/esphome/components/mitsubishi_heatpump/espmhp.h:20, from src/esphome/components/mitsubishi_heatpump/espmhp.cpp:21: src/esphome/components/mitsubishi_heatpump/espmhp.h:163:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operatingtimeout; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:163:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operatingtimeout; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:164:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idletimeout; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:164:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idletimeout; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:165:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_pingtimeout; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:165:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_pingtimeout; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:166:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::time_point> last_remote_temperature_sensorupdate; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:166:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::time_point> last_remote_temperature_sensorupdate; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:167:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::time_point> last_pingrequest; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:167:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::time_point> last_pingrequest; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'virtual void MitsubishiHeatPump::control(const esphome::climate::ClimateCall&)': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:129:9: error: 'last_remote_temperature_sensorupdate' was not declared in this scope if (last_remote_temperature_sensorupdate.has_value()) { ^~~~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:129:9: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout' if (last_remote_temperature_sensorupdate.has_value()) { ^~~~~~~~~~ enforce_remote_temperature_sensor_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_temperature(float)': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:450:9: error: 'last_remote_temperature_sensorupdate' was not declared in this scope last_remote_temperature_sensorupdate = ^~~~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:450:9: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout' last_remote_temperature_sensorupdate = ^~~~~~~~~~ enforce_remote_temperature_sensor_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp:453:9: error: 'last_remote_temperature_sensorupdate' was not declared in this scope last_remote_temperature_sensorupdate.reset(); ^~~~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:453:9: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout' last_remote_temperature_sensorupdate.reset(); ^~~~~~~~~~ enforce_remote_temperature_sensor_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::ping()': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:461:5: error: 'last_pingrequest' was not declared in this scope last_pingrequest = std::chrono::steady_clock::now(); ^~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_operating_timeout_minutes(int)': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:466:5: error: 'remote_operatingtimeout' was not declared in this scope remote_operatingtimeout = std::chrono::minutes(minutes); ^~~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:466:5: note: suggested alternative: 'set_remote_operating_timeout_minutes' remote_operatingtimeout = std::chrono::minutes(minutes); ^~~~~~~~~ set_remote_operating_timeout_minutes src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_idle_timeout_minutes(int)': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:471:5: error: 'remote_idletimeout' was not declared in this scope remote_idletimeout = std::chrono::minutes(minutes); ^~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:471:5: note: suggested alternative: 'set_timeout' remote_idletimeout = std::chrono::minutes(minutes); ^~~~~~~~ set_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::set_remote_ping_timeout_minutes(int)': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:476:5: error: 'remote_pingtimeout' was not declared in this scope remote_pingtimeout = std::chrono::minutes(minutes); ^~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:476:5: note: suggested alternative: 'set_timeout' remote_pingtimeout = std::chrono::minutes(minutes); ^~~~~~~~ set_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'void MitsubishiHeatPump::enforce_remote_temperature_sensor_timeout()': src/esphome/components/mitsubishi_heatpump/espmhp.cpp:481:9: error: 'remote_pingtimeout' was not declared in this scope if (remote_pingtimeout.has_value() && last_pingrequest.has_value()) { ^~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:481:9: note: suggested alternative: 'set_timeout' if (remote_pingtimeout.has_value() && last_pingrequest.has_value()) { ^~~~~~~~ set_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp:481:45: error: 'last_pingrequest' was not declared in this scope if (remote_pingtimeout.has_value() && last_pingrequest.has_value()) { ^~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:28: error: 'remote_operatingtimeout' was not declared in this scope this->operating_ ? remote_operatingtimeout : remote_idletimeout; ^~~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:28: note: suggested alternative: 'set_remote_operating_timeoutminutes' this->operating ? remote_operatingtimeout : remote_idletimeout; ^~~~~~~~~ set_remote_operating_timeout_minutes src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:56: error: 'remote_idletimeout' was not declared in this scope this->operating_ ? remote_operatingtimeout : remote_idletimeout; ^~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:494:56: note: suggested alternative: 'settimeout' this->operating ? remote_operatingtimeout : remote_idletimeout; ^~~~~~~~ set_timeout src/esphome/components/mitsubishi_heatpump/espmhp.cpp:496:13: error: 'last_remote_temperature_sensorupdate' was not declared in this scope last_remote_temperature_sensorupdate.has_value()) { ^~~~~~~~~~ src/esphome/components/mitsubishi_heatpump/espmhp.cpp:496:13: note: suggested alternative: 'enforce_remote_temperature_sensor_timeout' last_remote_temperature_sensorupdate.has_value()) { ^~~~~~~~~~ enforce_remote_temperature_sensor_timeout In file included from src/esphome.h:28, from src/main.cpp:3: src/esphome/components/mitsubishi_heatpump/espmhp.h:163:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operatingtimeout; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:163:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operatingtimeout; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:164:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idletimeout; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:164:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_idletimeout; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:165:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_pingtimeout; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:165:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_pingtimeout; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:166:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::time_point> last_remote_temperature_sensorupdate; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:166:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::time_point> last_remote_temperature_sensorupdate; ^~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:167:14: error: 'optional' in namespace 'std' does not name a template type std::optional<std::chrono::time_point> last_pingrequest; ^~~~ src/esphome/components/mitsubishi_heatpump/espmhp.h:167:9: note: 'std::optional' is only available from C++17 onwards std::optional<std::chrono::time_point> last_pingrequest; ^~~ [.pioenvs/wt32-eth01-2/src/esphome/components/mitsubishi_heatpump/espmhp.cpp.o] Error 1 [.pioenvs/wt32-eth01-2/src/main.cpp.o] Error 1 ========================= [FAILED] Took 25.46 seconds =========================```

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1806676889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBC4YMEXHVF4GDNZWK3YD36XLAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGY3TMOBYHE . You are receiving this because you commented.Message ID: @.***>

adepssimius commented 1 year ago

@echavet The poster who stated that the configuration worked on the develop branch was using the same ESP32 based WT32-ETH01 that I am using.

KazWolfe commented 1 year ago

@adepssimius See #117. Add this to your YAML:


esphome:
  platformio_options:
    build_unflags: 
      - "—std=gnu++11"
    build_flags: 
      - "-std=gnu++17"
echavet commented 1 year ago

ah ok sorry

Le sam. 11 nov. 2023 à 21:57, adepssimius @.***> a écrit :

@echavet https://github.com/echavet The poster who stated that the configuration worked on the develop branch was using the same ESP32 based WT32-ETH01 that I am using.

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1806915412, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBBGELTWYPN47DGOVSTYD7RDFAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWHEYTKNBRGI . You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

adepssimius commented 1 year ago

@KazWolfe thanks for the suggestion. I'm not sure that the build flags are being applied correctly since I get the same error output when building with a config with these options:

esphome:
  name: wt32-eth01-2
  friendly_name: wt32-eth01-2
  platformio_options:
    build_unflags: 
      - "-std=gnu++11"
    build_flags: 
      - "-std=gnu++17"

esp32:
  board: wt32-eth01
  framework:
    type: arduino

external_components:
  - source: github://geoffdavis/esphome-mitsubishiheatpump@develop

climate:
  - platform: mitsubishi_heatpump
    name: "Living Areas"
    hardware_uart: UART2
    tx_pin: 17
    rx_pin: 5
    baud_rate: 2400
    update_interval: 500ms

I'm building and installing right from ESPHome on home assistant on a Home Assistant Yellow box. I wonder if it has something to do with building on ARM?

I was able to get a functional setup by manually specifying the pins during the serial connection as you did earlier in the thread. The easiest way for me to pull and build the right thing was to make a fork, so I have a fork with the hardcoded pins and a full functional example config available here: https://github.com/adepssimius/WT32-ETH01-compatible-esphome-mitsubishiheatpump , which I plan on using until the functionality for manually specifying the pins is stable in master here.

stewartadam commented 12 months ago

I have also been running into this and determined it to be an issue with recent changes to the SwiCago/HeatPump library. It looks like the version pinning attempted while adding the library in climate.py here fails, and it's always pulling from master instead.

Reverting to commit SwiCago/HeatPump commit cea90c5ed48d24a904835f8918bd88cbc84cb1be fixes the issue immediately. I'll have PR out shortly.

echavet commented 12 months ago

What do you mean with recent changes to the SwiCago/HeatPump library ? I see in the climate.py file that esphome-mitsubishiheatpump component uses a specific version of swicago library.

cg.add_library( name="HeatPump", repository="https://github.com/SwiCago/HeatPump", version="d6a29134401d7caae1b8fca9c452c8eb92af60c5", )

do you mean you changed that in your own repository or are you using the original geoffdavis repository ?

In the last case the error occurs with the commit d6a29134401d7caae1b8fca9c452c8eb92af60c5

Am I wrong ? BreatBreadcrumbs

Le sam. 18 nov. 2023 à 07:40, Stewart Adam @.***> a écrit :

I have also been running into this and determined it to be an issue with recent changes to the SwiCago/HeatPump library. It looks like the version pinning attempted while adding the library in climate.py here fails, and it's always pulling from master instead.

Reverting to commit SwiCago/HeatPump commit cea90c5ed48d24a904835f8918bd88cbc84cb1be fixes the issue immediately. I'll have PR out shortly.

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1817414177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBBI5STOMT33DVGT3O3YFBJ63AVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXGQYTIMJXG4 . You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

echavet commented 12 months ago

Oh sorry I had not read your message well !

Marksonamap commented 12 months ago

@slackpj I think I might be in the same boat as you, I have new MSZ-AP42VGD and MSZ-AP22VGD models (Australia) and using D1 Minis. I can turn the units on and off, but can't set temperature and don't have any communication from the unit back to HA.

Thanks for sharing your solution. Any chance you have a photo of pins you had to cut off? I'm a little lost with the schematic.

echavet commented 11 months ago

I have 2 Mitsubishi hp. I used to have the same pb. I've tried to add some debug instructions in the code. I've directly included the swicago lib in the esphome conf. And one day it began to work with my 2 hp units. I've been using my testing repository since this day! Last week I wanted to install the same wemos d1 mini in a friend of mine's heat pump. He has exactly the same model. I use exactly the same code. I can't manage to get rid of this PB with this last unit. Nan temp. Which means communication is broken with the heat pump. I've changed the cable and the esp. Still doesn't work... still digging. Perhaps a pin is tied inside the male hp connector? I have to check... I've read all this is about a swicago regression on the head branch. (Because the version in the climate.py is ignored)

danolson1 commented 11 months ago

I had a communication problem and solved it with a pull-down resistor. See detailed description here.

echavet commented 11 months ago

Oh thank you for the tip. I have noticed many checksum errors in the com too. I'was about to test a pull-down too. But why are you using a level converter?

Le lun. 11 déc. 2023, 05:16, Daniel Olson @.***> a écrit :

I had a communication problem and solved it with a pull-down resistor. See detailed description here https://github.com/unixko/MitsuCon/issues/15#issuecomment-1849293534.

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1849298724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBCAXERG5SKMLIPTDK3YI2CKRAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGI4TQNZSGQ . You are receiving this because you were mentioned.Message ID: @.***>

danolson1 commented 11 months ago

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

echavet commented 11 months ago

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI . You are receiving this because you were mentioned.Message ID: @.***>

danolson1 commented 11 months ago

I connected the 5v supply from the mitsubishi to the D1 to provide power.

How are you powering yours?

-Dan

On Tue, Dec 12, 2023, 6:20 AM Eric Chavet @.***> wrote:

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub < https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851842453, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABK4ACAFJG6WEQCMW5X6BELYJA4XZAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA2DENBVGM . You are receiving this because you commented.Message ID: @.***>

echavet commented 11 months ago

Wow I didn't know you could do that. I have first connected the 5v hp to the the esp. It was working but I had many loss. I'm writing a new version of the EspHome MitsubishiHeatPump with the SwiCago directly included and with no delays ( https://github.com/echavet/MitsubishiCN105ESPHome). EspHome is not meant to have some delays in the loop method. So I added some logs and I noticed a lot of checksum errors. Now I got everything ok but I still have a little loss. My 2 esp are connected to my 2 hp the same way, with a regulator ( https://www.amazon.fr/dp/B072FTMS89?ref=ppx_yo2ov_dt_b_product_details&th=1) but connected to the 5v input. The 3.3 was not soldered ! So I tried and it worked very well. But I have to check if it work better with the AMS1117 output connected to the 3.3 esp input.

Also I was logging on the UART1 (d4 pin) on a USB to TTL (USB CH340C) directly connected to a Pi3. And I had to connect the grounds of the USB CH340C to the hp ground and to the esp ground to all this to work together. And I noticed I had no loss this way. No chkSum error.

Le mar. 12 déc. 2023 à 12:53, Daniel Olson @.***> a écrit :

I connected the 5v supply from the mitsubishi to the D1 to provide power.

How are you powering yours?

-Dan

On Tue, Dec 12, 2023, 6:20 AM Eric Chavet @.***> wrote:

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851842453>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABK4ACAFJG6WEQCMW5X6BELYJA4XZAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA2DENBVGM>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851890760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBFMSHDWIYZ5E4JSJVTYJBASTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA4TANZWGA . You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

danolson1 commented 11 months ago

I'm curious to see a photo or a wiring diagram of your setup.

The part you described (AMS1117) looks like a voltage regulator. So I'm assuming you power it with 5v from your heat pump and it outputs 3.3v that you then use to power your D1. One potential problem with your setup is that you are connecting the 5v TTL signal from the heat pump to the 3.3v TTL signal from the D1. The 3.3v signal from your D1 is probably read just fine by the heat pump, but the 5v signal it sends back could potentially damage the D1.

-Dan

On Tue, Dec 12, 2023 at 12:30 PM Eric Chavet @.***> wrote:

Wow I didn't know you could do that. I have first connected the 5v hp to the the esp. It was working but I had many loss. I'm writing a new version of the EspHome MitsubishiHeatPump with the SwiCago directly included and with no delays ( https://github.com/echavet/MitsubishiCN105ESPHome). EspHome is not meant to have some delays in the loop method. So I added some logs and I noticed a lot of checksum errors. Now I got everything ok but I still have a little loss. My 2 esp are connected to my 2 hp the same way, with a regulator ( https://www.amazon.fr/dp/B072FTMS89?ref=ppx_yo2ov_dt_b_product_details&th=1)

but connected to the 5v input. The 3.3 was not soldered ! So I tried and it worked very well. But I have to check if it work better with the AMS1117 output connected to the 3.3 esp input.

Also I was logging on the UART1 (d4 pin) on a USB to TTL (USB CH340C) directly connected to a Pi3. And I had to connect the grounds of the USB CH340C to the hp ground and to the esp ground to all this to work together. And I noticed I had no loss this way. No chkSum error.

Le mar. 12 déc. 2023 à 12:53, Daniel Olson @.***> a écrit :

I connected the 5v supply from the mitsubishi to the D1 to provide power.

How are you powering yours?

-Dan

On Tue, Dec 12, 2023, 6:20 AM Eric Chavet @.***> wrote:

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851842453>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABK4ACAFJG6WEQCMW5X6BELYJA4XZAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA2DENBVGM>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851890760>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAYTHBFMSHDWIYZ5E4JSJVTYJBASTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA4TANZWGA>

. You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852491466, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABK4ACCKVJGJI7CTM6W6VFLYJCIENAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGQ4TCNBWGY . You are receiving this because you commented.Message ID: @.***>

jemarr commented 11 months ago

I had this issue as well (nanºC) as Wemos D1 Mini didn't receive any data from AC unit. I can send data but no response.

I use level shifters as well.

I thought to put a pulldown resistor on Rx line as Danolson1 suggested, but finally I just cutted the Rx trace just before CH340 chip on Wemos D1. Now everything is ok. Update software is with OTA, so no need Rx line anymore.

3

echavet commented 11 months ago

Thanks for these informations. I didn't even know there was a 3.3 or 5v ttl. I thought it was 5v. So what you're saying is that resistance is not an option? ok I was about to add it since you post your analyse... but did not test yet https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/IMG_20231213_165310.jpg

this one is not a good picture but it wasn't meant to be published. It's when I was debugging: https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231206_200948742.jpg

These 2 are not connected to the hp. https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231211_132305690.jpg

Le mar. 12 déc. 2023 à 18:55, Daniel Olson @.***> a écrit :

I'm curious to see a photo or a wiring diagram of your setup.

The part you described (AMS1117) looks like a voltage regulator. So I'm assuming you power it with 5v from your heat pump and it outputs 3.3v that you then use to power your D1. One potential problem with your setup is that you are connecting the 5v TTL signal from the heat pump to the 3.3v TTL signal from the D1. The 3.3v signal from your D1 is probably read just fine by the heat pump, but the 5v signal it sends back could potentially damage the D1.

-Dan

On Tue, Dec 12, 2023 at 12:30 PM Eric Chavet @.***> wrote:

Wow I didn't know you could do that. I have first connected the 5v hp to the the esp. It was working but I had many loss. I'm writing a new version of the EspHome MitsubishiHeatPump with the SwiCago directly included and with no delays ( https://github.com/echavet/MitsubishiCN105ESPHome). EspHome is not meant to have some delays in the loop method. So I added some logs and I noticed a lot of checksum errors. Now I got everything ok but I still have a little loss. My 2 esp are connected to my 2 hp the same way, with a regulator (

https://www.amazon.fr/dp/B072FTMS89?ref=ppx_yo2ov_dt_b_product_details&th=1)

but connected to the 5v input. The 3.3 was not soldered ! So I tried and it worked very well. But I have to check if it work better with the AMS1117 output connected to the 3.3 esp input.

Also I was logging on the UART1 (d4 pin) on a USB to TTL (USB CH340C) directly connected to a Pi3. And I had to connect the grounds of the USB CH340C to the hp ground and to the esp ground to all this to work together. And I noticed I had no loss this way. No chkSum error.

Le mar. 12 déc. 2023 à 12:53, Daniel Olson @.***> a écrit :

I connected the 5v supply from the mitsubishi to the D1 to provide power.

How are you powering yours?

-Dan

On Tue, Dec 12, 2023, 6:20 AM Eric Chavet @.***> wrote:

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851842453>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABK4ACAFJG6WEQCMW5X6BELYJA4XZAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA2DENBVGM>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851890760>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBFMSHDWIYZ5E4JSJVTYJBASTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA4TANZWGA>

. You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

— Reply to this email directly, view it on GitHub < https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852491466>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABK4ACCKVJGJI7CTM6W6VFLYJCIENAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGQ4TCNBWGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852539586, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBHHEQPD5YEIZ2VLIQLYJCLCXAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGUZTSNJYGY . You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

danolson1 commented 11 months ago

You can definitely convert logic levels using discrete components (such as resistors), but that involves a bit of design work. The whole point of logic level converters is that they're cheap and do the job well.

I'm curious about your post where you say you "added logs and saw checksum errors." Can you provide a detailed description of how you did this? I would like to try this myself, to confirm that my pull-down resistor method is not causing software errors, but am not sure where to start.

-Dan

On Wed, Dec 13, 2023 at 11:04 AM Eric Chavet @.***> wrote:

Thanks for these informations. I didn't even know there was a 3.3 or 5v ttl. I thought it was 5v. So what you're saying is that resistance is not an option? ok I was about to add it since you post your analyse... but did not test yet

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/IMG_20231213_165310.jpg

this one is not a good picture but it wasn't meant to be published. It's when I was debugging:

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231206_200948742.jpg

These 2 are not connected to the hp.

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231211_132305690.jpg

Le mar. 12 déc. 2023 à 18:55, Daniel Olson @.***> a écrit :

I'm curious to see a photo or a wiring diagram of your setup.

The part you described (AMS1117) looks like a voltage regulator. So I'm assuming you power it with 5v from your heat pump and it outputs 3.3v that you then use to power your D1. One potential problem with your setup is that you are connecting the 5v TTL signal from the heat pump to the 3.3v TTL signal from the D1. The 3.3v signal from your D1 is probably read just fine by the heat pump, but the 5v signal it sends back could potentially damage the D1.

-Dan

On Tue, Dec 12, 2023 at 12:30 PM Eric Chavet @.***> wrote:

Wow I didn't know you could do that. I have first connected the 5v hp to the the esp. It was working but I had many loss. I'm writing a new version of the EspHome MitsubishiHeatPump with the SwiCago directly included and with no delays ( https://github.com/echavet/MitsubishiCN105ESPHome). EspHome is not meant to have some delays in the loop method. So I added some logs and I noticed a lot of checksum errors. Now I got everything ok but I still have a little loss. My 2 esp are connected to my 2 hp the same way, with a regulator (

https://www.amazon.fr/dp/B072FTMS89?ref=ppx_yo2ov_dt_b_product_details&th=1)

but connected to the 5v input. The 3.3 was not soldered ! So I tried and it worked very well. But I have to check if it work better with the AMS1117 output connected to the 3.3 esp input.

Also I was logging on the UART1 (d4 pin) on a USB to TTL (USB CH340C) directly connected to a Pi3. And I had to connect the grounds of the USB CH340C to the hp ground and to the esp ground to all this to work together. And I noticed I had no loss this way. No chkSum error.

Le mar. 12 déc. 2023 à 12:53, Daniel Olson @.***> a écrit :

I connected the 5v supply from the mitsubishi to the D1 to provide power.

How are you powering yours?

-Dan

On Tue, Dec 12, 2023, 6:20 AM Eric Chavet @.***> wrote:

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851842453>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABK4ACAFJG6WEQCMW5X6BELYJA4XZAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA2DENBVGM>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851890760>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBFMSHDWIYZ5E4JSJVTYJBASTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA4TANZWGA>

. You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852491466>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABK4ACCKVJGJI7CTM6W6VFLYJCIENAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGQ4TCNBWGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852539586>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAYTHBHHEQPD5YEIZ2VLIQLYJCLCXAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGUZTSNJYGY>

. You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1854210631, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABK4ACHRX5RPZXWQPEZUHYLYJHGXDAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJUGIYTANRTGE . You are receiving this because you commented.Message ID: @.***>

echavet commented 11 months ago

Well, two things:

1st: With the original geoffdavis esphome-mitsubishiheatpump version the only way to log was to log over the air (OTA) .

So I began a new branch which have many log instructions added. The way to use is is to change the line :

external_components:

by

external_components:

in your yaml file.

But this was not enough because the setup method, where the first connection is made was not present in the traces. This because OTA logs are too long to get initialized. So I decided to use the second UART of the ESP for logs (because the 1st one is used for the hp of course). This one only has one line for sending. So I connected it to the TTL converter like on this picture: https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231206_200948742.jpg The d4 pin of the ESP has to be connected to the TXD pin of the TTL converter. You also have to connect the ground of the USB TTL converter to the ESP and to the HP. That's because TTL is relative to ground. Then I just had to connect the TTL converter to the usb port of a Pi and to launch an "esphome logs" (over serial) command with my yaml configured with logger to UART1.

logger: hardware_uart: UART1 level: DEBUG

But actually it wasn't enough. Because I had the damn T° : Not a Number issue on a friend of mine hp.

2nd thing: So I decided to dig deeper. And I made another version of the esphome-mitsubishiheatpump geoffdavis project. A version in which I do the initializations later. In this repo I have included and modified the SwiCago librarie. But without all the delays instructions which are normally forbidden in esphome architecture.

You can see in this file that there are buttons to launch the setupUART and to send the first connection packet.

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/hp-debug.yaml

I find my version much better (because it is). No need to wait 2 seconds each time a packet is sent because the loop method always reads the UART response of the HP and never misses a packet. Except when I get checksum errors.

All you have to do is to change the external component ref to this:

external_components:

or to get the code in your esphome directory and to reference it locally like this:

external_components:

Of course I have completely reused SwiCago and GeoffDavis's codes. And I've added a lot of log instructions.

So if you want to check the quality of your connection you should take the 2nd option.

Here is a sample of the logsyou can get:

***@***.*** MitsubishiCN105ESPHome % esphome logs
hp-sejour.yaml
INFO ESPHome 2023.11.6
INFO Reading configuration hp-sejour.yaml...
INFO Detected timezone 'Europe/Paris'
Found multiple options for logging, please choose one:
  [1] Over The Air (hpsejour.local)
  [2] MQTT (homeassistant.local)
(number): 1
INFO Starting log output from hpsejour.local using esphome API
INFO Successfully connected to hpsejour in 19.474s
INFO Successful handshake with hpsejour in 3.213s

[18:15:06][D][switch:012]: 'hpsejour UART Setup Switch' Turning ON.
[18:15:06][I][CN105:395]: setupUART() with baudrate 2400
[18:15:06][I][CN105:401]: hw_serial(0x3fff0bbc) is
&Serial(0x3fff0bbc)? YES
[18:15:06][D][CN105:414]: Serial->begin...
[18:15:06][D][switch:055]: 'hpsejour UART Setup Switch': Sending state
ON
[18:15:14][D][switch:012]: 'Send 1st packet to hpsejour' Turning ON.
[18:15:14][D][CN105:429]: Envoi du packet de connexion...
[18:15:14][D][CN105:998]: writing packet...
[18:15:14][D][WRITE:1226]: FC 5A 01 30 02 CA 01 A8
[18:15:14][D][switch:055]: 'Send 1st packet to hpsejour': Sending
state ON
[18:15:14][D][Header:523]: command: (7A) data length: [01]<-- header
[18:15:14][D][READ:1226]: FC 7A 01 30 01 00 54
[18:15:14][I][CN105:691]: --> Heatpump did reply: connection success!
<--
[18:15:14][D][CN105:239]: Autoupdate is ON --> creating a loop for
reccurent updates...
[18:15:14][I][CN105:241]: Programming update interval : 4000
[18:15:14][D][sensor:093]: 'Compressor Frequency (Clim)': Sending
state 7.00000  with 1 decimals of accuracy
[18:15:14][D][sensor:093]: 'Operating (Clim)': Sending state 1.00000
with 1 decimals of accuracy
[18:15:18][D][CN105:1139]: buildAndSendRequestsInfoPackets: sending 3
request packet at interval: 300
[18:15:18][D][CN105:1141]: sending a request for settings packet
(0x02)
[18:15:18][D][CN105:1161]: creating Info packet
[18:15:18][D][CN105:998]: writing packet...
[18:15:18][D][WRITE:1226]: FC 42 01 30 10 02 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 7B
[18:15:18][D][CN105:239]: Autoupdate is ON --> creating a loop for
reccurent updates...
[18:15:18][I][CN105:241]: Programming update interval : 4000
[18:15:19][D][Header:523]: command: (62) data length: [10]<-- header
[18:15:19][D][READ:1226]: FC 62 01 30 10 02 00 00 01 01 0B 00 00 00 00
03 A8 00 00 00 00 A3
[18:15:19][D][Decoder:558]: [0x02 is settings]
[18:15:19][D][Decoder:564]: [Power : ON]
[18:15:19][D][Decoder:565]: [iSee  : 0]
[18:15:19][D][Decoder:566]: [Mode  : HEAT]
[18:15:19][D][Decoder:579]: [Fan: AUTO]
[18:15:19][D][Decoder:582]: [Vane: AUTO]
[18:15:19][D][Decoder:588]: [wideVane: | (adj:0)]
[18:15:19][D][CN105:354]: setting action to -> 3
[18:15:19][I][CN105:287]: Climate mode is: 3
[18:15:19][I][CN105:307]: Fan mode is: 513
[18:15:19][I][CN105:317]: Swing mode is: 0
[18:15:19][I][CN105:323]: Target temp is: 20.000000
[18:15:19][D][climate:380]: 'Climatisation Séjour' - Sending state:
[18:15:19][D][climate:383]:   Mode: HEAT
[18:15:19][D][climate:385]:   Action: HEATING
[18:15:19][D][climate:388]:   Fan Mode: AUTO
[18:15:19][D][climate:400]:   Swing Mode: OFF
[18:15:19][D][climate:403]:   Current Temperature: 20.50°C
[18:15:19][D][climate:409]:   Target Temperature: 20.00°C
[18:15:19][W][component:214]: Component esphome.coroutine took a long
time for an operation (0.10 s).
[18:15:19][W][component:215]: Components should block for at most
20-30ms.
[18:15:19][D][CN105:1144]: sending a request room temp packet (0x03)
[18:15:19][D][CN105:1161]: creating Info packet
[18:15:19][D][CN105:998]: writing packet...
[18:15:19][D][WRITE:1226]: FC 42 01 30 10 03 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 7A
[18:15:19][D][Header:523]: command: (62) data length: [10]<-- header
[18:15:19][D][READ:1226]: FC 62 01 30 10 03 00 00 0A 00 00 A9 00 00 00
00 00 00 00 00 00 A7
[18:15:19][D][Decoder:604]: [0x03 room temperature]
[18:15:19][D][Decoder:614]: [Room °C: 20.500000]
[18:15:19][D][CN105:1147]: sending a request status paquet (0x06)
[18:15:19][D][CN105:1161]: creating Info packet
[18:15:19][D][CN105:998]: writing packet...
[18:15:19][D][WRITE:1226]: FC 42 01 30 10 06 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 77
[18:15:19][D][Header:523]: command: (62) data length: [10]<-- header
[18:15:19][D][READ:1226]: FC 62 01 30 10 06 00 00 07 01 00 00 00 00 00
00 00 00 00 00 00 4F
[18:15:19][D][Decoder:635]: [0x06 is status]
[18:15:19][D][Decoder:643]: [Operating: 1]
[18:15:19][D][Decoder:644]: [Compressor Freq: 7]
[18:15:22][D][CN105:1139]: buildAndSendRequestsInfoPackets: sending 3
request packet at interval: 300
[18:15:22][D][CN105:1141]: sending a request for settings packet
(0x02)
[18:15:22][D][CN105:1161]: creating Info packet
[18:15:22][D][CN105:998]: writing packet...
[18:15:22][D][WRITE:1226]: FC 42 01 30 10 02 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 7B
[18:15:22][D][CN105:239]: Autoupdate is ON --> creating a loop for
reccurent updates...
[18:15:22][I][CN105:241]: Programming update interval : 4000
[18:15:23][D][Header:523]: command: (62) data length: [10]<-- header
[18:15:23][D][READ:1226]: FC 62 01 30 10 02 00 00 01 01 0B 00 00 00 00
03 A8 00 00 00 00 A3
[18:15:23][D][Decoder:558]: [0x02 is settings]
[18:15:23][D][Decoder:564]: [Power : ON]
[18:15:23][D][Decoder:565]: [iSee  : 0]
[18:15:23][D][Decoder:566]: [Mode  : HEAT]
[18:15:23][D][Decoder:579]: [Fan: AUTO]
[18:15:23][D][Decoder:582]: [Vane: AUTO]
[18:15:23][D][Decoder:588]: [wideVane: | (adj:0)]
[18:15:23][D][CN105:354]: setting action to -> 3
[18:15:23][I][CN105:287]: Climate mode is: 3
[18:15:23][I][CN105:307]: Fan mode is: 513
[18:15:23][I][CN105:317]: Swing mode is: 0
[18:15:23][I][CN105:323]: Target temp is: 20.000000
[18:15:23][D][climate:380]: 'Climatisation Séjour' - Sending state:
[18:15:23][D][climate:383]:   Mode: HEAT
[18:15:23][D][climate:385]:   Action: HEATING
[18:15:23][D][climate:388]:   Fan Mode: AUTO
[18:15:23][D][climate:400]:   Swing Mode: OFF
[18:15:23][D][climate:403]:   Current Temperature: 20.50°C
[18:15:23][D][climate:409]:   Target Temperature: 20.00°C
[18:15:23][W][component:214]: Component esphome.coroutine took a long
time for an operation (0.09 s).
[18:15:23][W][component:215]: Components should block for at most
20-30ms.
[18:15:23][D][CN105:1144]: sending a request room temp packet (0x03)
[18:15:23][D][CN105:1161]: creating Info packet
[18:15:23][D][CN105:998]: writing packet...
[18:15:23][D][WRITE:1226]: FC 42 01 30 10 03 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 7A
[18:15:23][D][Header:523]: command: (62) data length: [10]<-- header
[18:15:23][D][READ:1226]: FC 62 01 30 10 03 00 00 0A 00 00 A9 00 00 00
00 00 00 00 00 00 A7
[18:15:23][D][Decoder:604]: [0x03 room temperature]
[18:15:23][D][Decoder:614]: [Room °C: 20.500000]
[18:15:23][D][CN105:1147]: sending a request status paquet (0x06)
[18:15:23][D][CN105:1161]: creating Info packet
[18:15:23][D][CN105:998]: writing packet...
[18:15:23][D][WRITE:1226]: FC 42 01 30 10 06 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 77
[18:15:23][D][Header:523]: command: (62) data length: [10]<-- header
[18:15:23][D][READ:1226]: FC 62 01 30 10 06 00 00 07 01 00 00 00 00 00
00 00 00 00 00 00 4F
[18:15:23][D][Decoder:635]: [0x06 is status]
[18:15:23][D][Decoder:643]: [Operating: 1]
[18:15:23][D][Decoder:644]: [Compressor Freq: 7]

Hope it helps

Le mer. 13 déc. 2023 à 17:19, Daniel Olson @.***> a écrit :

You can definitely convert logic levels using discrete components (such as resistors), but that involves a bit of design work. The whole point of logic level converters is that they're cheap and do the job well.

I'm curious about your post where you say you "added logs and saw checksum errors." Can you provide a detailed description of how you did this? I would like to try this myself, to confirm that my pull-down resistor method is not causing software errors, but am not sure where to start.

-Dan

On Wed, Dec 13, 2023 at 11:04 AM Eric Chavet @.***> wrote:

Thanks for these informations. I didn't even know there was a 3.3 or 5v ttl. I thought it was 5v. So what you're saying is that resistance is not an option? ok I was about to add it since you post your analyse... but did not test yet

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/IMG_20231213_165310.jpg

this one is not a good picture but it wasn't meant to be published. It's when I was debugging:

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231206_200948742.jpg

These 2 are not connected to the hp.

https://github.com/echavet/MitsubishiCN105ESPHome/blob/main/captures/PXL_20231211_132305690.jpg

Le mar. 12 déc. 2023 à 18:55, Daniel Olson @.***> a écrit :

I'm curious to see a photo or a wiring diagram of your setup.

The part you described (AMS1117) looks like a voltage regulator. So I'm assuming you power it with 5v from your heat pump and it outputs 3.3v that you then use to power your D1. One potential problem with your setup is that you are connecting the 5v TTL signal from the heat pump to the 3.3v TTL signal from the D1. The 3.3v signal from your D1 is probably read just fine by the heat pump, but the 5v signal it sends back could potentially damage the D1.

-Dan

On Tue, Dec 12, 2023 at 12:30 PM Eric Chavet @.***> wrote:

Wow I didn't know you could do that. I have first connected the 5v hp to the the esp. It was working but I had many loss. I'm writing a new version of the EspHome MitsubishiHeatPump with the SwiCago directly included and with no delays ( https://github.com/echavet/MitsubishiCN105ESPHome). EspHome is not meant to have some delays in the loop method. So I added some logs and I noticed a lot of checksum errors. Now I got everything ok but I still have a little loss. My 2 esp are connected to my 2 hp the same way, with a regulator (

https://www.amazon.fr/dp/B072FTMS89?ref=ppx_yo2ov_dt_b_product_details&th=1)

but connected to the 5v input. The 3.3 was not soldered ! So I tried and it worked very well. But I have to check if it work better with the AMS1117 output connected to the 3.3 esp input.

Also I was logging on the UART1 (d4 pin) on a USB to TTL (USB CH340C) directly connected to a Pi3. And I had to connect the grounds of the USB CH340C to the hp ground and to the esp ground to all this to work together. And I noticed I had no loss this way. No chkSum error.

Le mar. 12 déc. 2023 à 12:53, Daniel Olson @.***> a écrit :

I connected the 5v supply from the mitsubishi to the D1 to provide power.

How are you powering yours?

-Dan

On Tue, Dec 12, 2023, 6:20 AM Eric Chavet @.***> wrote:

thanks. why did you connect both 5 and 3.3?

my experience shows that: wemos d1 mini does it with direct connection to the hp but with some data corruption adding an ext 3.3 converter and connecting it to the esp 5v in ou 3.3 does remove 99% of the checksum errors. with no resistance

Envoyé avec Gmail Mobile

Le lun. 11 déc. 2023 à 15:19, Daniel Olson @.***> a écrit :

Mitsubishi TTL is 5v, Wemos D1 wants 3.3v TTL

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1850174892>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBALTNWKDL7Q7J67ES3YI4JADAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGE3TIOBZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851842453>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABK4ACAFJG6WEQCMW5X6BELYJA4XZAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA2DENBVGM>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1851890760>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBFMSHDWIYZ5E4JSJVTYJBASTAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHA4TANZWGA>

. You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852491466>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABK4ACCKVJGJI7CTM6W6VFLYJCIENAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGQ4TCNBWGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub <

https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1852539586>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAYTHBHHEQPD5YEIZ2VLIQLYJCLCXAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGUZTSNJYGY>

. You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

— Reply to this email directly, view it on GitHub < https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1854210631>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABK4ACHRX5RPZXWQPEZUHYLYJHGXDAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJUGIYTANRTGE>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1854246583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBCVOE3FYDGKO32SN4TYJHIQRAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJUGI2DMNJYGM . You are receiving this because you were mentioned.Message ID: @.***>

-- Eric

echavet commented 11 months ago

About the 3.3 or 5v TTL Logic, here is what I found:

GPIOs

The ESP8266 has 16 GPIOs (General Purpose Input/Output) that can be used to control external devices. The GPIOs are numbered from GPIO0 to GPIO15.

RX and TX

The RX and TX pins are used for serial communication. The RX pin receives data from the serial port and the TX pin sends data to the serial port. The RX and TX pins are compatible with 5V TTL logic.

jpollard-cs commented 11 months ago

Managed to get this working with the develop branch as others had mentioned. Working example:


substitutions:
  name: nunya-biznass-mini-split
  friendly_name: Nunya Biznass Mini Split

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  platformio_options:
    build_unflags:
      - "-std=gnu++11"
    build_flags:
      - "-std=gnu++17"

preferences:
  flash_write_interval: 10min

esp32:
  board: nodemcu-32s

# Enable logging
logger:
  # level: VERBOSE

api:
  encryption:
    key: "****"

ota:
  password: "****"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret fallback_ssid
    password: !secret fallback_password

mqtt:
  broker:!secret mqtt_host
  port: !secret mqtt_port
  username: !secret mqtt_username
  password: !secret mqtt_password

captive_portal:

# Enable Web server.
web_server:
  port: 80

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

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: ${name} ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: ${name} IP
    ssid:
      name: ${name} SSID
    bssid:
      name: ${name} BSSID

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: ${name} Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: ${name} WiFi Signal
    update_interval: 60s

external_components:
  - source: github://geoffdavis/esphome-mitsubishiheatpump@develop

climate:
  - platform: mitsubishi_heatpump
    name: "${friendly_name}"
    hardware_uart: UART2
    tx_pin: 17
    rx_pin: 16
    baud_rate: 2400
    update_interval: 500ms
    visual:
      min_temperature: 18
      max_temperature: 25
      temperature_step: 0.1
danolson1 commented 10 months ago

@echavet Eric, does your logging require a second UART? Or is it possible to use UART0 for communication with the heatpump and send the logs to ESPHome (or MQTT) via wifi?

-Dan

danolson1 commented 10 months ago

@jpollard-cs Jordan, we should find a place to collect working examples. I've got a working example for an ESP32-C3 from Seeed studios.

-Dan

jpollard-cs commented 10 months ago

@jpollard-cs Jordan, we should find a place to collect working examples. I've got a working example for an ESP32-C3 from Seeed studios.

-Dan

I thought this thread was where we were doing that? 😆

It does seem like development has slowed on this project, but out of respect I'd like to defer to the author before suggesting we spin up a fork. I'd also be happy to setup a discord server. It would really be nice to have a general ESP Discord even.

adepssimius commented 10 months ago

@jpollard-cs There is already an (official, I think) ESPHome discord. https://discord.com/invite/Ve73Ma32ce

echavet commented 10 months ago

For info, I have started a new version of the project which has included the swicago lib directly into the esphome component code. This looks like a regression because the lib is not a lib anymore. But actually, the swicago lib does not fit the esphome requirements:

The lib requires a delay each time a packet is written so as the read process only starts when it is sure the response packet is complete, and it can read it in a single loop.

This is not the right way to do.

Like it is done in the Firmata project the main loop must always read packets from the input UART and write when needed. This way, we don't loose packet, and the component matches the esphome requirements (no delay). Also there is many logs in the code.

It is working well on a esp8266 D1 mini and with my 2 Mitsubishi hp. But the project needs to be tested and improved...

Here is the code.

https://github.com/echavet/MitsubishiCN105ESPHome

We could start a new project with the best of both projects.

Le sam. 23 déc. 2023, 16:51, Jordan @.***> a écrit :

@jpollard-cs https://github.com/jpollard-cs Jordan, we should find a place to collect working examples. I've got a working example for an ESP32-C3 from Seeed studios.

-Dan

I thought this thread was where we were doing that? 😆

It does seem like development has slowed on this project, but out of respect I'd like to defer to the author before suggesting we spin up a fork. I'd also be happy to setup a discord server. It would really be nice to have a general ESP Discord even.

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1868319274, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBFEBVYRF5F3XUX56Q3YK34WXAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGMYTSMRXGQ . You are receiving this because you were mentioned.Message ID: @.***>

geoffdavis commented 10 months ago

Development has indeed slowed on this project, and I'm unsure of the best way to proceed. I keep hoping that I'll have time to work on it, but that's clearly not happening as I'm spending less time in front of a desk and more time out in the field.

I'm happy to allow other admins to vet commits if that makes sense, or transfer ownership if that makes things easier.

However, I'd like to see compatibility maintained with ESP8266 units, as that's what I'm using and presumably others are using it as well.

danolson1 commented 10 months ago

Here's a working example for controlling a Mitsubishi heat pump with a Seeed XIAO ESP32C3 board.

ESP32C3 wiring diagram@4x

# Notes: need to attach wifi antenna for good signal reception
# https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html
# Use pin D6 for serial Tx, use pin D7 for serial Rx. 
# Connect serial pins to level converter to interface 5v TTL signal from heat pump to 3.3v TTL signal of ESP32C3

substitutions:
  name: hp-2
  friendly_name: HP-2

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  platformio_options:
    board_build.flash_mode: dio
    board_build.extra_flags:
      # Override, defaults to '-DARDUINO_USB_CDC_ON_BOOT=1'     
      # This is necessary to allow mitsubishi heatpump to work correctly
      # More info here https://wiki.seeedstudio.com/XIAO_ESP32C3_Pin_Multiplexing/
      - "-DARDUINO_USB_CDC_ON_BOOT=0"  

esp32:
  board: seeed_xiao_esp32c3
  variant: esp32c3
  framework:
    type: arduino
    version: 2.0.14
    platform_version: 6.4.0 # 6.4.0 and 5.4.0 worked

# Enable logging
logger:
 #hardware_uart: UART0
 baud_rate: 0 # disable the logger

# Enable Home Assistant API
api:
  encryption:
    key: "*****"

ota:
  password: "*****"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "*****"
    password: "*****"

web_server:
  port: 80

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

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: ${name} ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: ${name} IP
    ssid:
      name: ${name} SSID
    bssid:
      name: ${name} BSSID

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: ${name} Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: ${name} WiFi Signal
    update_interval: 60s

external_components:
  - source: github://geoffdavis/esphome-mitsubishiheatpump

climate:
  - platform: mitsubishi_heatpump
    name: "${friendly_name}"

    # ESP32 only - change UART0 to UART1 or UART2 and remove the
    # logging:baud_rate above to allow the built-in UART0 to function for
    # logging.

    # ESP32C3, must be UART0
    hardware_uart: UART0
echavet commented 10 months ago

Yes you can use UART0 for the heat pump and UART1 for logging. Logging through WiFi or mqtt remains possible of course as itis the esphome logging feature. I have just added log instructions in the code, and tested on UART1 of esp8266.

Le ven. 22 déc. 2023, 18:16, Daniel Olson @.***> a écrit :

@echavet https://github.com/echavet Eric, does your logging require a second UART? Or is it possible to use UART0 for communication with the heatpump and send the logs to ESPHome (or MQTT) via wifi?

-Dan

— Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/71#issuecomment-1867912260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYTHBBAEPCNU2HZHFANYHLYKW57JAVCNFSM6AAAAAAQ4HMUZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHEYTEMRWGA . You are receiving this because you were mentioned.Message ID: @.***>

Protoncek commented 10 months ago

Hi guys! A couple of days ago i built and installed my esp module, too. I experienced a strange phenomenon, though: each time i make OTA upgrade of FW it seems that esp doesn’t communicate with A/C after finished upgrade (i get no temp readings)l BUT…if i manually reboot esp again (i have reboot button programmed) all starts to work and it works perfectly afterwards. Did anyone had such a problem? What could be the cause?

Reagarding UART communication: esp modules with built-in UART-to-USB chip can be nasty… some of these chips tend to hold tx or rx level up or down when not in use, so no communication via uart is possible with other devices. So, for this purpose it’s best to use a module without usb, say, esp01. It’s cheap, ultrasmall and it works. Or, as someone above did: cut traces from esp to uart chip.

Finally, regarding level converter: i didn’t use it, but it works. Original schematic doesn’t use it also. So, i wonder…is it needed or not? Esp module’s data say pins are 5v tolerant, so we can’t destroy esp, while sending 3.3V is already enough for AC to see this voltage as active 1… any thoughts?