Open gunnaraas opened 2 years ago
I just got this one too. I picked up the S2 mini as it's recommended by some of the folks over in https://gitter.im/Mitsubishi-Heat-Pump/Lobby as working without any additional resistors or breakout boards.
@gunnaraas The very simple fix in this commit makes the build work.
Noting that I had to use hardware_uart: UART1
- a different compile error was happening with UART0
.
I also found that hardware_uart: UART0
fails to compile:
Compiling .pioenvs/f4accc/lib74d/WiFi/WiFiUdp.cpp.o
src/main.cpp: In function 'void setup()':
src/main.cpp:477:54: error: no matching function for call to 'MitsubishiHeatPump::MitsubishiHeatPump(USBCDC*)'
mitsubishiheatpump = new MitsubishiHeatPump(&Serial);
^
In file included from src/esphome.h:21,
from src/main.cpp:3:
src/esphome/components/mitsubishi_heatpump/espmhp.h:55:9: note: candidate: 'MitsubishiHeatPump::MitsubishiHeatPump(HardwareSerial*, uint32_t)'
MitsubishiHeatPump(
^~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:55:9: note: no known conversion for argument 1 from 'USBCDC*' to 'HardwareSerial*'
src/esphome/components/mitsubishi_heatpump/espmhp.h:44:7: note: candidate: 'MitsubishiHeatPump::MitsubishiHeatPump(const MitsubishiHeatPump&)'
class MitsubishiHeatPump : public PollingComponent, public climate::Climate {
^~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.h:44:7: note: no known conversion for argument 1 from 'USBCDC*' to 'const MitsubishiHeatPump&'
src/esphome/components/mitsubishi_heatpump/espmhp.h:44:7: note: candidate: 'MitsubishiHeatPump::MitsubishiHeatPump(MitsubishiHeatPump&&)'
src/esphome/components/mitsubishi_heatpump/espmhp.h:44:7: note: no known conversion for argument 1 from 'USBCDC*' to 'MitsubishiHeatPump&&'
Compiling .pioenvs/f4accc/lib590/FS/FS.cpp.o
Archiving .pioenvs/f4accc/libf23/libAsyncTCP-esphome.a
Compiling .pioenvs/f4accc/lib590/FS/vfs_api.cpp.o
*** [.pioenvs/f4accc/src/main.cpp.o] Error 1
Indexing .pioenvs/f4accc/libf23/libAsyncTCP-esphome.a
However, UART1
works. In order for the device to operate you must set the baud rate as in #72
That check is there to make sure you're configuring the board correctly. It looks like I need to cast the pointers to void before doing the comparison.
The deal with the UART0/UART1 stuff is that you can't use the port that is configured for logging with the heat pump. If you want to use UART0, you have to disabled the serial logging (set the baud rate to zero in the logging section.) But this isn't necessary on ESP32 boards, just the ESP8266 boards.
I think you'll find that configuring the UART correctly this compilation problem will go away. Setting the hardware UART to
That said, please post your config (with passwords sanitized.)
EDIT: reading comprehension is minimal, it seems.
See GH-86 for void casting fix
I just got this one too. I picked up the S2 mini as it's recommended by some of the folks over in https://gitter.im/Mitsubishi-Heat-Pump/Lobby as working without any additional resistors or breakout boards.
Hey, On a S2 mini how do you know which pins are the UART1?
Hi, Has anyone managed to get the WEMOS Lolin S2 Mini to work? I would like to have the yaml code please. Thanks.
Hi, Has anyone managed to get the WEMOS Lolin S2 Mini to work? I would like to have the yaml code please. Thanks.
Hey @imtheyoyo ,
I had given up on getting it the S2 mini working, and opted to just set up with a HiLetGo ESP-01 (amazon link). Seemed that there was too much variance in quality & that the market was overrun with counterfeits at the time (November 2022). That would be my advise for how to reduce hassle with getting esphome on your heat pump.
BTW, I got this to work w/ ESPHome 2023.10.3
esphome:
name: mitsubishi
name_add_mac_suffix: true
platformio_options:
build_unflags:
- "-std=gnu++11"
build_flags:
- "-std=gnu++17"
preferences:
flash_write_interval: 10min
esp32:
board: lolin_s2_mini
variant: ESP32S2
framework:
type: arduino
platform_version: 6.4.0
external_components:
- source: github://geoffdavis/esphome-mitsubishiheatpump@develop
# Enable logging
logger:
#level: VERBOSE
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Dashboard Fallback Hotspot"
password: ""
captive_portal:
# Sensors with general information.
sensor:
# Uptime sensor.
- platform: uptime
name: Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: WiFi Signal
update_interval: 60s
climate:
- platform: mitsubishi_heatpump
name: "Heat Pump"
hardware_uart: UART1
rx_pin: 18
tx_pin: 16
baud_rate: 2400
update_interval: 500ms
I used the config from @jjhuff to get this going on an S2 mini hooked up to a MSZ-GL09NA using ESPHome - I can send commands and get what seems to be good comms back, I see successful serial response, but just get NaN for temps and no updates if I make a change over IR. Any idea what I might be doing wrong? Here's a log excerpt, the packetRecv seems like what we'd want to see but that's all I get from the HP.
[16:49:47][V][MitsubishiHeatPump:622]: PKT: [packetSent] FC 41 01 30 10 01 0F 00 01 01 09 00 00 00 00 00 00 00 00 00 00 63
[16:49:48][V][MitsubishiHeatPump:622]: PKT: [packetRecv] FC 61 01 30 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E
[16:49:48][W][component:214]: Component api took a long time for an operation (1.18 s).
[16:49:48][W][component:215]: Components should block for at most 20-30ms.
@stewartadam described a similar-sounding issue in #125, but the commit his PR pins to results in compile issues in combo with the config from @jjhuff.
Thanks for the merge! Casting to void* fixes the same issue I was having on adafruit_feather_esp32s2_tft
When attempting to compile this for use with an S2 mini, I get a compilation error that seems to be related to the USB-C port on the board.
esphome yaml:
Terminal Output: