gysmo38 / mitsubishi2mqtt Goto Github PK
View Code? Open in Web Editor NEWMitsubishi to MQTT with ESP8266 module
License: GNU Lesser General Public License v2.1
Mitsubishi to MQTT with ESP8266 module
License: GNU Lesser General Public License v2.1
I have 4 Wemos D1 with 4 Aircons, 3 of them running default https://github.com/SwiCago/HeatPump/tree/master/examples/mitsubishi_heatpump_mqtt_esp8266_esp32 and hass custom component and working fine for months.
But i test 1 with your firmware, it hang after about a week, only turn off power of the device and turn back on it will running again.
So may be it is memory leak or not enough memory with your firmware, so i give some suggestion:
- Web control interface and logs/console should make optional, have option to enable it in the web settings page.
- Serial.Print/Serial.Println should use macro like Debug.out(string)f or easy disable
HI,
in Readme the last chapter contains a list of topics.
Please explain some of them (bold expressions).
And finally, if on the web portal in Setup / Others, I set HA Autodisovery to OFF, after save & reboot, the state is ON again?
I don't use HA, but is this a bug?
Thanks!!
Hello Gysmo38,
first of all, big props on this development. I have been following SwiCago and you for over a year and I love what you have done with the autodiscovery code and how reliably it now works with HASS.
There is however one quirk I have been having issues with, since I live in an area with frequent power outages. Whenever a power outage happens, all my electronic equipment boots up at the same time. Heatpumps are quite quick and boot up before my Wifi APs. Therefore they can't find the WiFi signal and revert to AP mode with the HVAC_XXXX ssid.
However, when I try to fix this, I power-cycle the heatpumps manually, with WiFi signal already available, the heatpumps stay in the HVAC_XXXX mode indefinitely.
To fix this, I have to connect to each of my 3 HVAC_XXXX APs, I have to remember which MAC is used in which heatpump, I have to provide the WiFi SSID and Password and after restarting each module, the normal operation resumes. The module remembers MQTT details, temperature step settings and all other customizations, so the issue seems to be only with the initial WiFi config.
What I would like to happen instead, is that when a manual power cycle is triggered, upon rebooting and finding the known WiFi network, normal operation would be resumed.
Do you know what I mean?
Sorry,
i don't made a screenshot.
The captive portal don't show translated words but only the various placeholders.
I removed a stray binary in src, but binaries should be available as releases on github, not within the source repo. Right now there are 0.45 and 0.47.1 Wemos D1 binaries, and this would presumably grow over time to have a random collection of binaries.
If you build from your repo, add the binaries dir to .gitignore so they won't be committed.
Just what the title says. Do you support full auto discovery in HA currently?
After flashing and setup the control interface will stop loading. The web console shows an error in the response, and no HTML is in the source.
I think we might be hitting the upper size limit of String sent as a response. esp8266/Arduino#3205
What about using one (or two) of the unused Pins as Input pin for a door or window contact (as the AC is quite often build on top of a window or door) and transmit the status change of this contact on change? That would allow e.g. stopping the AC if the door/window is open for more than 5min or similar use cases...
[edit] I'm using your SW on a NodeMCU DevBoard ==> having several I/Os unused [/edit]
[edit] sorry for posting in issues, don't know how to share a feature request... [/edit]
Full log is here https://pastebin.com/qB3qXTJ0, core errors are:
Compiling .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Compiling .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClient.cpp.o
Compiling .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Compiling .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Assembler messages:
Fatal error: can't create .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClient.cpp.o: No such file or directory
*** [.pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClient.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/WEMOS_D1_Mini/src/mitsubishi2mqtt.ino.cpp.o: No such file or directory
*** [.pio/build/WEMOS_D1_Mini/src/mitsubishi2mqtt.ino.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o: No such file or directory
*** [.pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o: No such file or directory
*** [.pio/build/WEMOS_D1_Mini/libc09/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o] Error 1
Was anyone able to us PIO for compilation?
As also noted by @andrewl3wis in the gitter, when I first flashed my boards I attempted to load the control page and the board would reset - sending a wdt error through the serial connection.
Once I filled out the MQTT settings, the control page started working correctly. I have six boards total and all are working perfectly with MQTT enabled, I verified the board reset issue on the last one I installed before configuring MQTT. Once configured, the control page loads fine.
Sketch uses 290516 bytes (27%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29440 bytes (35%) of dynamic memory, leaving 52480 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM5
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC:
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 294672 bytes to 213918...
Writing at 0x00000000... (7 %)
Writing at 0x00004000... (14 %)
Writing at 0x00008000... (21 %)
Writing at 0x0000c000... (28 %)
Writing at 0x00010000... (35 %)
Writing at 0x00014000... (42 %)
Writing at 0x00018000... (50 %)
Writing at 0x0001c000... (57 %)
Writing at 0x00020000... (64 %)
Writing at 0x00024000... (71 %)
Writing at 0x00028000... (78 %)
Writing at 0x0002c000... (85 %)
Writing at 0x00030000... (92 %)
Writing at 0x00034000... (100 %)
Wrote 294672 bytes (213918 compressed) at 0x00000000 in 4.8 seconds (effective 489.8 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Invalid library found in arduino\libraries\mitsubishi2MQTT-master: no headers files (.h) found in arduino\libraries\mitsubishi2MQTT-master
Invalid library found in arduino\libraries\mitsubishi2MQTT-master: no headers files (.h) found in arduino\libraries\mitsubishi2MQTT-master
After that no wifi appears.
I used Wemos D1 Mini board.
hello,
i have installed the scetch to a wemo d1 mini...Web and MQTT is working, but i have no communication to the heatpump...i have it connected like shown at swicagoheatpump readme...but without 10k Resistor...
Is this device not supported or do i need this resistors...
is it possible to implement localization? (like Tasmota, since the GUI has already been taken as a reference ...). I could help for Italian translation...
Thank you!
Hello I have some ghostswitching issues in my 2 HeatPumps. Anybody else? Or some ideas?
Hello,
Would you be so kind to compile .bin last version for wemos d1 mini. I am having some troubles to upload source file using my IDE and I don't no why.
Thanks in advance,
I know the reset configuration button is red, but a simple click by mistake and all is gone. Maybe adding a very basic javascript command on the button could be useful:
something like a onclick="return confirm('Are you sure?')" or equivalent could prevent this.
What do you think about it?
I'll try to deactivate the HomeAssistant feature (as it is useless for me) via WebMenue by setting it to "OFF" and afterwards clicking on Save & Reboot. After 10sec and the reconnect, HA is still "ON" in the web and also if I sniff the messages it is still active
Put the recording information in wemos d1, since I get an error when uploading SPPIFFS. Thank you
Hello,
theactual state of the heatpumps changes when i restart or start my mqtt broker. For example the temperatur changes to 10 degrees and the device will be switched on. Even i have configurated minimum temp to 16...
Hi Gysmo.
Well - i just got your code flashed to an esp-01 module with an esp8285 mcu on it. I think i have done it right - the code runs and the webpages show correctly.
BUT - i see some issues on running through HA. When i set / change settings, there is some kind of long latency and when i turn down the temperature it just bounces back on a much higher temperature . Any thoughts what might cause this?
Best
Jacob
Hello @gysmo38 , thanks a lot for your effort. I am testing your code in one of my units: MSZ-HR35 and it works almost perfect.
Below you can find what I have detected:
I will continue testing it but the job done is ENORMOUS.
Thanks a lot.
Hi
I would like to interface a php application with mitsubishi2MQTT. I need to query the PAC to know its states (power, temp, ...) I can parse whatever I get back (json, ...)
What is the best way to achieve this ? I'm not very used to MQTT and I don't know if there is a way to call an URL through http and receive something back.
I'm trying to parse the /control page but it is quite painful and not very clever.
More ideas?
Hi
Something is bothering me : I often keep a tab of my web browser (computer, smartphone) opened with the control page of my AC (ie : http://192.168.1.33/control ) When I make an action, like turning the AC on or off, the url becomes http://192.168.1.33/control?POWER=OFF for example.
If later I refresh (or the tab is automatically reloaded after I quit and restarted my browser) and in the meantime I changed the status of the AC (powered on with the remote for example), it automatically shuts it off which is not very convenient.
Is there a reason for the url to be keeping the last action? Wouldn't it be better if a new location was called (/control) after each command or the url rewritten using javascript for example?
In the Advanced settings, setting the unit to Fahrenheit doesn't affect the minimum/maximum settings. For example, if I set the unit to Fahrenheit and then set the minimum temperature to 61 degrees, the actual setting is 142 degrees. If I set the maximum temperature to 88 degrees, the actual setting is 190 degrees.
From the HA autodiscovery topic:
"min_temp":142,
"max_temp":190,
Changing the unit should change the minimum/maximum temperature display, and the conversion should go both ways.
Internally and in the config files, min_temp and max_temp can remain Celsius values. For display, however, they need to match the unit.
If I turn off the power to the air conditioner, when it restarts the temperature of 26 degrees is communicated.
I'm using the code of Jun 6, 2020.
Currently if wifi fails to connect the device does nothing and is not accessable.
Upon failure can it fallback to AP?
I have the device set up and running normally without issue, however when I try to have Alexa discover it (I have included the entity for sharing with Alexa via configuration.yaml
) it's not found. I've tried searching for others also facing this issue but haven't found much relevant information online. I have other devices, including thermostats successfully shared with/discoverable by Alexa. Can you advise if this is a known issue and if you are aware of any fix?
I thought that your esp8266 plugin was based enough on the Swicago MQTT code so this domoticz plugin would work: https://github.com/Masurov/Domoticz-MitsubishiHpMQTT-Plugin
But it seems that they use different "words" to exchange through MQTT.
For example the domoticz plugin sends commands like:
pac/pac/set {"vane": "SWING"}
pac/pac/set {"mode": "FAN"}
But your code sends commands/status like:
pac/pac/state {"roomTemperature":19,"temperature":19,"fan":"AUTO","vane":"1","action":"off","mode":"off"}
pac/pac/settings {"temperature":19,"fan":"AUTO","vane":"1","mode":"dry"}
Is there a way to make the two communicate? Have you developed a plugin for domoticz for your version of the code?
Another way to see the problem (maybe simpler for you) is : can you provide a parameter in the interface to switch between a "HASS friendly" style and the original Swicago MQTT commands ?
When I uploaded 0.6.0 to the D1 Mini I connect to the AP, enter all the details and when save & reboot is pressed the page errors out and that's it.
Hi. Just installed the latest version.
When im controlling the temperature it is very inconsistent. At my device I need it to go down to minimum 10 degrees. That I set up in the config file before flashing.
I made a video, where it shows the thing im getting. Its funny it I always going back to 26 degrees when I go down to 10 degrees.
Why is that happening?
I tried everything and I can't read or write in the json files. The output of my terminal is this:
Starting Mitsubishi2MQTT
Connecting to CRASH
Failed to open wifi config file
Some details I've seen :
1/ the initial IP (before firest wifi configuration) is 192.168.1.1 : Do you have a reason to choose this one as 192.168.4.1 seems to be a kind of standard for this situation?
2/ The wifi connection timeout is a bit on the short side. I don't know why (maybe the distance between the access point and the AC in the attic, but I had the same issue a few months ago with another esp8266 very close to the AP) but the connection time for me is often more than 10 seconds. It can lead to reboots, and even resets of the configuration. I suggest to change it to something more like 20000 ms instead of 10000 (line 1474).
3/ I don't know if I am alone, but I always have a difficult time to compile your code. I have the Swicago library in my personal folder, but I have an error when compiling:
mitsubishi2mqtt:1056:1: error: 'heatpumpSettings' does not name a type
To be able to compile I have to move a copy of the heatpump.cpp and heatpump.h in the folder where the .ino is and remove the #include heatpump.h in the .ino Strange behavior, not sure if it is specific to my configuration or not.
4/ Same thing, probably very related to my own installation, but since I managed to make MQTT work (I installed HA to try it, but it was the same with the [non properly working] mqtt domoticz plugin), the ESP is very very unresponsive. Even when doing something like a simple ping, it changes from 2 or 3ms to timeouts. I don't understand what happens. At the beginning I thought that the ESP was overloaded by the MQTT traffic of the other things on the network... but since I moved the configuration to a separate MQTT server on the HA node, the Mitsubishi2mqtt ESP is the only device connected to this MQTT server... So maybe it has no relation with MQTT and it is just something related to the weather, the phase of the moon or... :-) who knows. How can I try to debug what happens as I can't plug an usb cable on the ESP in the attic? For information the Rssi is between -73 and -76dB which is not very good, but is it too much?
Single command sending works fine for me, for example for fan I send value 1 to topic mitsubishi2mqtt/mitsu/fan/set.
For the temperature I send the value to the topic mitsubishi2mqtt/mitsu/temp/set.
Is it possible to send multiple commands, eg temp=24, fan=1, mode=heat as one command?
If so, how to do that and on what topic to publish?
I use Node-RED to control AC.
Thanks!
When flash to boot to the capacitvo portal shows in terminal impossible to open wifi config file.
When entering IP 192.168.1.1 the first screen appears, but when you try to configure it does not go to the next pages and shows them without any css.
If the MEL is able to work against a target temperature, it should be able to understand the current room temperature. I'm wondering if that value is available anywhere?
Hi,
I've succesfully programmed my D1 mini (maybe clone??) with your git.
After connection to AP and set the SSID and the PW it correctly reboot and connect to my wifi.
If I try to setup the MQTT settings it stuck to "Saving configuration and rebooting... Refresh in 10s..." and nothing happens (the D1 stay connected to wifi as I can ping it correctly).
Tell me if I can to help you to found the problem with logs or somewhat (tell me how to do)
(PS: I've also try the dzungpv git with same error...)
Thank you
EDIT: after a day of various test now it work... I think that I don't change too much on MQTT parameters... Is possible that a blank parameter causing the bug?
Can implement the MQTT availability feature?
availability_topic
The MQTT topic subscribed to receive birth and LWT messages from the MQTT device. If availability_topic is not defined, the binary sensor will always be considered available and its state will be on, off or unknown. If availability_topic is defined, the binary sensor will be considered as unavailable by default and the sensor’s state will be unavailable.
When you enter the configuration portal, the first page goes well, but when you go to configure wifi or mqtt you lose the css and do not let enter data.
I have only managed to make it work by configuring a Wi-Fi code, but it still gives me problems.
I tried all this with the last modification several hours ago
First of all - I know this is way off for this project BUT - I think this project has turned out to be very nice - and with a very cool interface / GUI.
I have a project going on with controlling a Danish branded Nilan Vent system, that is controlled via modbus. the project is here https://github.com/jascdk/Nilan_Homeassistant
I really want to have some kind of same GUI experience like in this project, but the code is massive and I simply don't know where to start (im not much into coding :/)
Does someone of you have a kind of template / thing for this code, so I can get on going. I have tried to pick out parts and so, but it always messes up :(
Thanks in advance and sorry for posting this "issue" as it is not related to this project.
All the best
Jacob
When I try to enter the control page, I can't find it, and it takes a long time to access the different pages.
This was really easy to set-up, thanks a lot!
I'm still having a few issues though, I get the entity in Home Assistant, but in MQTT logs I can see that after an initial config and status message, it goes to sending debug msges only:
"failed to publish hp status change"
And also, the current temperature tpl seems to fallback to 26 degrees in home-assistant (as in the arduino sketch is defined), but in the webinterface on the /control page, it does show the correct current temperature.
Is something going wrong with setting up the json mqtt message?
Hi all.
Anyone else have trouble getting debug info through MQTT? When I enable it I only get Null:null and no response from heatpump??
In order to avoid the problems with the installation of all dependencies, we should prepare the project for platformio.
Once you try it you will never return to ArduinoIDE :)
Any fork or implementation of the method void HeatPump::setRemoteTemperature(float setting) so a custom temperature override can be pushed via mqtt? (since the heatpumps usually got a bad reading of temperature from the builtin sensor)
@gysmo38
exit status 1
'class HeatPump' has no member named 'isConnected'
Anybody nows how to implement eco cooling function?
Unlike an HA custom component, which can set the display scale to follow the unit system of HA, an autodiscovered MQTT hvac device can't be configured to use Fahrenheit to display and set the temperature. HA assumes that all devices follow the scale set if you set unit_system
in your configuration.
homeassistant:
unit_system: imperial
Since I live in the US, installing mistsubishi2MQTT displays the climate component in HA as if the values were Fahrenheit when they are actually Celsius.
The code assumes the use of metric scale, probably since the SwiCago library and the Mitsubishi units themselves use Celsius internally.
The sketch should have a configurable option for displaying and processing Fahrenheit values and converting them to and from Celsius when interacting with the SwiCago library.
Hi gysmo
Would it be possible to make a firmware upgrade feature through the interface like on the Tasmota firmware ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.