Either create an empty skeleton with the maven script or take a look at the intesis Binding, which was written for intesis/AirConWithMe WiFi adapters used in MHI and several other aircon devices.
@bartsnijder I feel you might be interested in this topic
Nothing to test yet, but I’ll need your help once I have something ready for tests.
Is nagios something that can be leveraged? Those 4 IPs are my MHI AC units with RAC-WF modules. I have the Home Assistant code (using python zeroconf for discovery) and I’m working in that direction as well.
$ nmap -sV 192.168.1.0/24 -p 51443
Starting Nmap 7.93 ( https://nmap.org ) at 2024-03-22 20:24 CET
Nmap scan report for _gateway (192.168.1.2)
Host is up (0.0040s latency).
[..]
Nmap scan report for 192.168.1.110
Host is up (0.053s latency).
PORT STATE SERVICE VERSION
51443/tcp open nagios-nsca Nagios NSCA
Nmap scan report for 192.168.1.111
Host is up (0.079s latency).
PORT STATE SERVICE VERSION
51443/tcp open nagios-nsca Nagios NSCA
Nmap scan report for 192.168.1.112
Host is up (0.014s latency).
PORT STATE SERVICE VERSION
51443/tcp open nagios-nsca Nagios NSCA
Nmap scan report for 192.168.1.113
Host is up (0.048s latency).
PORT STATE SERVICE VERSION
51443/tcp open nagios-nsca Nagios NSCA
[..]
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 256 IP addresses (18 hosts up) scanned in 17.41 seconds
I have discovery working for the RAC-WF Thanks for all heavy work done by authors of other bindings, obviously! All I had to do was put together a binding skeleton, copy over Daikin binding (and modify the naming, trim some stuff) and copy over the zeroconf discovery from MPD binding.
I’d appreciate help with naming - are there any rules I should stick to? I tried to use the best guess so the binding name is mhiaircon, but should it be just the brand name? Without the aircon part?
I missed the trigger (space between @ and bartsnijder :-))… Was by accident checking out how this was going. Good to see that there is good progress. Is anything open yet to try?
Ohhh… my coding skills are hopefully better than the forum skills. If you like dirty code… Only the discovery works, the rest is just copy from Daikin binding, so obviously not working.
The code is here:
If you need detailed download/compilation/installation instruction let me know.
Shout if there’s anything i can help with. I’m not very familiar with openhab addon structure. (Ngl it looks very overwhelming from that gitlabs repo) If there’s specific elements of the home assistant python code you want translated I’m happy to lend a hand where i can.
(I’ll try read up on openhab addon layouts but could be awhile, however happy to help write/translate python to java)
Thank you - any help would be fantastic. OH is an elephant, it can be only eaten piece by piece. I don’t understand it as well despite of amending denon binding and making mhiaircon binding from scratch. I can give you developer access to my gitlab if you want. All the code is here: bundles/org.openhab.binding.mhiaircon · mhi · Przemo Firszt / mhiaircon · GitLab
I can help with setting up the development environment on linux (compilation, ssh for easy copying of the jar, etc but I use vim…).
I’m trying to figure out what should happen after an item has been added. The progress is mediocre - I´m working on many non-OH items as well…
Thanks, my plan is to write it in “plain” java, almost like a library. So make one giant aircon object, store all the data and methods for sending/receiving commands and parsing responses. I’ve got the bulk of this setup using the home assistant python code as a guide for parsing etc.
I’m away from home atm so can’t test but I think it’s pretty much drafted. However it’lll need a fair bit of debuging and some logging/error handling needed.
Then hoping someone on here can lend a hand in how we use this aircon object in openhab/how to map it to openhab.
Current test code is setup something like this:
AirCon aircon = new AirCon();
aircon.setHostname = “192.168.x.x”;
aircon.setPort = “5443”;
aircon.setminRefreshRate = 1L; //max 1s intervals between commands;
//I assume openhab is setup to something like this periodically
aircon.getAirconStats();
//Then I’d want to map openhab channels to specific methods/commands.
ie On/off channel mapped to the below
aircon.setOperation(true);
aircon.send();
Imagine there’s some standard way you guy lock the .getAirconStats periodic run from running when user is updating/before updates have been sent over to external device.
However I’ll get to reading into all that once I’ve tested the “plain” java version. @PrzemoF Once i’ve got it tested on my unit I’ll give you a shout/make my repo public and we can work out how to integrate into openhab.
You’re miles ahead of me in understanding what needs to be done and in writing java. I’m just piggybacking daikin binding and I’m planning to port the already existing python code (HA).
I don’t know if it will help any, but there has been a “forum” binding for Midea AC devices. Lately I have been working on it to possibly become “official”. It was also originally derived from python code for HA. You are welcome to review any code that might help your efforts here.
@apella12 Thanks! I’ll check that!
I’m at the stage where the basic stuff works: discovery, settings, refresh time. Now the binding is trying to connect the unit on IP and port, but obviously the connection fails as it’s still trying to connect it as it was a Daikin unit.
Unfortunately, because of this I really can’t jump in and offer anything of value beyond that I do recognize some similar items in the code. I also see some differences that might be deal breakers.
The Midea binding uses a socket to write() a command (like a poll or power ON) and an input stream that collects the bytes sent back by the device. Code extract using IP and Port;
// Open socket
try {
socket = new Socket();
socket.setSoTimeout(config.getTimeout() * 1000);
if (ipPort != null) {
int port = Integer.parseInt(ipPort);
socket.connect(new InetSocketAddress(ipAddress, port), config.getTimeout() * 1000);
}
Also, the V3 models use encryption so both the write() and read() have code/decode elements. The cloud application(s) for Midea provide the token and key used with the encryption.
HA uses a table for temperature conversion, but I decided to use polynomial curves. The significant discrepancies are only around the extreme values, that are probably inaccurate anyway.
Wind direction up down and right left readable. Naming consistency to be improved. Due to some weird problems (more here) the development is for now based on 4.1.3 and under name mhiairconditioning Files · mhi-413 · Przemo Firszt / mhiaircon · GitLab