Code Monkey home page Code Monkey logo

mhi2mqtt's People

Contributors

rjdekker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mhi2mqtt's Issues

srk71zma-s working

Confirming that MHIMQTT works with MHI model srk71zma-s. Was able to control with Home Assistant via MQTT

ESP not active when connected to aircon

Hi,

I'm facing issues with the interface when i connect it to the aircon.

When putting 12V by an external power supply the interface is running (Arduino & ESP all lamps on, connected to wifi)

But when i connect the interface to the aircon just the Arduino is active - the ESP is not showing any LED or connects to the wifi.

I've double checked the wires and CLK Port - everything is fine.

Does anybody has an idea how i can get it working?

Best Regards

Manuel

No Hotspot / no Connection

Hi,

first, many many thanks for this project. Works fine for the first time, but i wanted to change the names. So i restart in hotspot mode an change the names. After reboot i had no more connection to my wifi and no hotspot is there. Any idea? What can i do?
I think i will try to flash the ESP Modul again to see if it works

statusRoomTemp from Hass?

Hi Rob,

Love the project and many thanks for putting in the effort to develop and document!

I realise that you no longer have a system to test on and improve this, but I was wondering if it's possible to write values to statusRoomtemp using your code? IE Zigbee temperature values from various rooms.

The main reason I want to use this is as we have an MHI ducted air conditioning system with zones, but only one temperature sensor so the system can cool individual rooms but only sees the central thermostat temperature. Would be good to know if this is possible before I dive into Arduino and buy the components! I'm new to Arduino but have been using RPi for some time.

Cheers,
CanuckianOz

Compilation error: DynamicJsonBuffer is a class from ArduinoJson 5

.../MHI-ESP2MQTT.ino:132:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see https://arduinojson.org/v7/upgrade-from-v5/ to learn how to upgrade to ArduinoJson 7
  132 |               DynamicJsonBuffer jsonBuffer;
      |           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                  
.../MHI-ESP2MQTT.ino:308:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see https://arduinojson.org/v7/upgrade-from-v5/ to learn how to upgrade to ArduinoJson 7
  308 |       DynamicJsonBuffer jsonBuffer;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                          

exit status 1

Compilation error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see https://arduinojson.org/v7/upgrade-from-v5/ to learn how to upgrade to ArduinoJson 7

Only get subscription response from Roomname/Aircon/#

Thankyou for sharing this awesome writeup. I am using a RPI with openhab2 and mosquitto and can subscribe to Roomname/Aircon/# (giving me the response = "MHI2MQTT connected to MQTT broker at 192.168.1.148:1883" however any other subscriptions i enter return nothing eg. Roomname/Aircon/State
Roomname/Aircon/Fanspeed etc

this is the first time i have used mqtt so am i doing something wrong here or do i need to reflash the arduino pro ? appreciate any help with this.

The only thing you may want to add on your readme for future users is that they should not get the latest version of ArduinoJSON (6) as the INO file requires (5.x) and pops up with errors in the Arduino IDE for the latest version of this library. The only other thing was that on the ESP8266 webpage the maximum character length for the host name is (16 characters) i was trying to debug my code with an online hostname (m16.cloudmqtt.com) but would not fit in the field. That said i could never create the awesomeness that you have here!!

compile error?

C:\Users\steph\Downloads\rjdekker-MHI2MQTT-e737f6e\src\MHI-SPI2ESP\MHI-SPI2ESP.ino: In function 'void SPI_sync()':

C:\Users\steph\Downloads\rjdekker-MHI2MQTT-e737f6e\src\MHI-SPI2ESP\MHI-SPI2ESP.ino:152:49: warning: invalid conversion from 'volatile void*' to 'void*' [-fpermissive]

memcpy(&tx_SPIframe[9], &frameVariant[0][0], 9); //Copy (part of) the next frame to the current frame for sending on the upcoming bitfield 18 clock cycle

                                             ^

In file included from C:\Users\steph\Downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\arduino\avr\cores\arduino/Arduino.h:25:0,

             from C:\Users\steph\AppData\Local\Temp\arduino_build_189773\sketch\MHI-SPI2ESP.ino.cpp:1:

c:\users\steph\downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr\avr\include\string.h:191:14: note: initializing argument 1 of 'void* memcpy(void*, const void*, size_t)'

extern void *memcpy(void *, const void *, size_t);

          ^

C:\Users\steph\Downloads\rjdekker-MHI2MQTT-e737f6e\src\MHI-SPI2ESP\MHI-SPI2ESP.ino: In function 'void loop()':

C:\Users\steph\Downloads\rjdekker-MHI2MQTT-e737f6e\src\MHI-SPI2ESP\MHI-SPI2ESP.ino:275:67: warning: invalid conversion from 'volatile void*' to 'const void*' [-fpermissive]

                   memcpy(&toESP.currentMHI, &rx_SPIframe[3], 7);                                               //Copy bitfields 4-10 from the most recent MHI SPI frame to new array for sending to ESP

                                                               ^

In file included from C:\Users\steph\Downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\arduino\avr\cores\arduino/Arduino.h:25:0,

             from C:\Users\steph\AppData\Local\Temp\arduino_build_189773\sketch\MHI-SPI2ESP.ino.cpp:1:

c:\users\steph\downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr\avr\include\string.h:191:14: note: initializing argument 2 of 'void* memcpy(void*, const void*, size_t)'

extern void *memcpy(void *, const void *, size_t);

          ^

C:\Users\steph\Downloads\rjdekker-MHI2MQTT-e737f6e\src\MHI-SPI2ESP\MHI-SPI2ESP.ino:308:62: warning: invalid conversion from 'volatile void*' to 'const void*' [-fpermissive]

               memcpy(&rx_bitfield4_10, &rx_SPIframe[3], 7);                                                    //Get bitfields 4-10 from the last MHI SPI frame to use for the upcoming tx_SPIframe update

                                                          ^

In file included from C:\Users\steph\Downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\arduino\avr\cores\arduino/Arduino.h:25:0,

             from C:\Users\steph\AppData\Local\Temp\arduino_build_189773\sketch\MHI-SPI2ESP.ino.cpp:1:

c:\users\steph\downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr\avr\include\string.h:191:14: note: initializing argument 2 of 'void* memcpy(void*, const void*, size_t)'

extern void *memcpy(void *, const void *, size_t);

          ^

C:\Users\steph\Downloads\rjdekker-MHI2MQTT-e737f6e\src\MHI-SPI2ESP\MHI-SPI2ESP.ino:330:73: warning: invalid conversion from 'volatile void*' to 'void*' [-fpermissive]

           memcpy(&tx_SPIframe[9], &frameVariant[variantnumber][0], 9);                                         //Copy (part of) the next frame to the current frame for sending on the upcoming bitfield 18 clock cycle

                                                                     ^

In file included from C:\Users\steph\Downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\arduino\avr\cores\arduino/Arduino.h:25:0,

             from C:\Users\steph\AppData\Local\Temp\arduino_build_189773\sketch\MHI-SPI2ESP.ino.cpp:1:

c:\users\steph\downloads\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr\avr\include\string.h:191:14: note: initializing argument 1 of 'void* memcpy(void*, const void*, size_t)'

extern void *memcpy(void *, const void *, size_t);

          ^

Question about OTA

Hi,

first, thank you for the great work - I am using your design since 6 Months, without any big issues (controlling 4 MHI SRK via mqtt from fhem)

I just recently noticed that all 4 modules open an hotspot allthough configured and connected.
Is this used for OTA? Or is OTA done via the usual connected WLAN and it is a bug that the hotspot mode comes up in normal "production" mode?

Thank you for your input, and best regards
Markus

Upload error flashing

Hi,
i try to flash the arduino pro mini with your sketch.

If I upload the sketch a mistake comes up.

`Arduino: 1.8.10 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"

Der Sketch verwendet 4158 Bytes (13%) des Programmspeicherplatzes. Das Maximum sind 30720 Bytes.
Globale Variablen verwenden 373 Bytes (18%) des dynamischen Speichers, 1675 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x77
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x77
Problem beim Hochladen auf das Board. Hilfestellung dazu unter http://www.arduino.cc/en/Guide/Troubleshooting#upload.

Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
`

Can anyone explain what I'm doing wrong?

MQTT not responding

When I subscribe to debug channel the ESP send me, I suppose, the help message, but I don't receive anything on all status channels and when I send something to set values nothing happens. Even the service channel seems dead. I've tried with different brokers but nothing. Any idea?

Power/Econo mode?

Good Morning/Afternoon/Evening..
I'm wanting to use something exactly like this to control my 2 MHI aircons.
the larger (model escapes me right now) offers an eco mode which runs in a low power mode. One of the reasons i want to be able to control them is in the event my mains grid fails and i run on battery. - to maximise battery life i first want to reduce to eco mode and then off. Has anyone any idea what bitfields eco mode might use?
(the remote control has a combined power/eco mode - 1 push give power mode, 2 gives eco mode).
I guess i will have to monitor the unit for state change when i manually enter eco mode.

DynamicJSONBuffer not longer supported in Arduino 6

Hi,

when i try to verify / compile the MHI-ESP2MQTT there is shown an error:

MHI-ESP2MQTT:132:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6 DynamicJsonBuffer jsonBuffer; ^ MHI-ESP2MQTT:308:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6 DynamicJsonBuffer jsonBuffer; ^ exit status 1 DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6

How must i change the both lines where it is used? I tried "DynamicJsonDocument jsonBuffer(1024);" but then it's running into next errors. Or is there a way to tell the Arduino IDE to use v5 instead of v6?

Best Regards and thanks for that great work

Manuel

When attached Unit won't start

Hi all, I tried to apply this project to a MHI DXK12ZSA-W. Everything went fine, but when I tried to operate the unit it wouldn't start and appeared almost like it had no power. Multiple power cycles, checking cables and they all had the same result.

I removed the Arduino and the AC immediately started to work. Has anyone else seen this? Is it a new development?

Problem WiFi Setup

I am an old codger from Australia. I am familiar with Arduino, less so with ESP8266. I make the odd Eagle PCB.

I have a few Arduino Mini's, although they don't look identical to your Pro Mini. I also use a MacOSX Big Sur for development.
I have a couple of Adafrruit Huzzah Feather boards. I am interested in the project primarily because I have a large MHI AirCon which is driving me mad, and it does seem to have a lot in common with the environment described.

The documentation provided is terrific, and I have made a lot of progress, but have needed to change things a bit to suit the bits I have.

Firstly Software: The ESP JSON 6 code needed changing to compile - basically to use JsonDocument class. The changes seem to be a bit simpler than the original, due to Json improvements. I also needed to put a Silabs Driver on the Mac to upload to the Huzzah.

Next Hardware. I had to rework the 2 boards. The Huzzah includes a USB connector, and my Mini is loaded through a FTDI connection. To get access to each board for changing software, and for the connector to the MHI I needed a bit different arrangement. I will send a photo if it might be of general interest. I haven't wired the MHI bit yet, as we are in Covid lockdown.

Anyway, on to the problem. Power to the Huzzah and the Mini is via the USB connector on the Huzzah. Mini LED ON.
I search for a Network, and find one which is obviously the ESP board. But its SSID is ESP_C109E7 and unpassworded.
I don't know how to relate it to my home Wifi SSID/PSWD. I also changed the code temporarily to grab this network.

I do get a nice Wifi Manager screen Config Info Update etc etc, but am unsure on what I should be setting where.
When I upload code into the Huzzah via the SiLabs driver, I don't seem to need any Burnloader activity from the Arduino IDE.

Any comments welcome. Sorry this is a bit preliminary.

Peter Hanlon

Room temperature formula

Hi,
Thanks for you excellent work.
I'm trying to make it work on ESP8266 directly.
But in my case, the room temperature seems to be not very accurate.
Do you remember why the formula was set to
//Calculate current room temperature in degrees Celsius from bitfield 7 using:
// (BF7 - 61) / 4 (note: Calibration of temperature needs to be checked further)
Is it estimated or is there any "reason" for this formula, especially the "- 61" ?
Or does it mean my aircon is not correctly calibrated ?

Best regards.

get/send values to the ac

Hello,
I connected the arduino to my AC (SRK 35 ZS), the light on the esp is on.
It send a connection-message to my broker, every 6 minutes. I visulize it with mqtt.fx
I send help to the device and it sends {"metrics":[],"seq":0} back, if i change the "payload decoder".
How can i send some commands to my ac, can you make me an example ?

Only the debug message comes back, nothing else. is that normal ?
I subscribe it all (#)

Im a beginner in this case.

Random generated MQTT devices with changing chars

Hi,

I'm running into some issues with the module in my iobroker mqtt instance. After starting up everything is fine - the devices is recognized by the mqtt server and all items are created. Perfect!

But when i'm using the adapter it seems that there is a wrong feedback from the adapter hat creates devices with special chars. Attached a screenshot.

First i was thinking about german special chars (Umlaute) but i only use regular chars. Also debug-mode is of. I think it's issue in the debug feedback. Is there an option to completly deactivate feedback from this part?

Best Regards

Manuel
Bildschirmfoto 2020-04-27 um 08 32 15

Use ESP8266 only?

I'm getting some questions if it is possible to only use an ESP8266-based board without the Arduino.

The thing is that this is what I was aiming for when starting this project. Unfortunately, I could not get SPI communication working with the MHI. The reason is technical and mostly beyond my skills. Running an ESP8266 as a SPI slave (MHI is master) is very poorly documented and some code that I found was impossible for me to get working for this particular scenario.

Some of the things that I ran into:

  • The MHI does not use a slave select line and the ESP8266 SPI library does
  • The MHI's clock is high when idle. The ESP8266 appears to only work with clock low when idle.
  • Cryptic documentation on the ESP's SPI hardware

I still think it's possible but it would cost me too much time to figure out.

In contrast, I had the Arduino working as a SPI slave in no time and the programmatic implementation was delightfully simple compared to the ESP8266.

If anyone knows how to do this, I will be happy to provide you with more detailed information on the SPI protocol.

Cheers, Rob

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.