mitch7391 / homebridge-cmd4-AdvantageAir

Catered shell script to integrate air conditioner control units by Advantage Air into HomeKit using the plug-in homebridge-cmd4.
MIT License
38 stars 5 forks source link

ConfigCreator returns IP address error (MyAir3 systems) #78

Closed CdG1202 closed 1 year ago

CdG1202 commented 1 year ago

Describe Your Problem: Running Hoobs on a Raspberrypi 4. Have configured homebridge-cmd4 and homebridge-cmd4-advantageair on their own bridge called Myair Bridge.

Navigate to /var/lib/hoobs/myairbridge/node_modules/homebridge-cmd4-advantageair

Execute ConfigCreator.sh

provide the relevant ip addresses (I have 3 MyAir3 systems) 10.0.0.120, 10.0.0.121 and 10.0.0.122

Paste of Logs:

pi@raspberrypi:/var/lib/hoobs/myairbridge/node_modules/homebridge-cmd4-advantageair $ ./ConfigCreator.sh
Please enter the name (default: Aircon) and IP address of your AdvanatageAir system:
Name: Main
IP address (xxx.xxx.xxx.xxx): 010.000.000.120

Please enter the name and IP address of your 2nd AdvantageAir System if any. Just hit 'enter' if none:
Name: 

Do you want to set up your "Fan" as "FanSwitch"? (y/n): n

INFO: fanSetup=fan
INFO: AdvAir.sh found: /var/lib/hoobs/myairbridge/node_modules/homebridge-cmd4-advantageair/AdvAir.sh

INFO: This process may take up to 1 minute!
INFO: Fetching and processing data from your AdvantageAir system (Main 010.000.000.120).... 
ERROR: AdvantageAir system is inaccessible or your IP address 010.000.000.120 is invalid!

Cmd4 Config:

Screenshots:

Advantage Air System:

Homebridge Environment:

mitch7391 commented 1 year ago

Hey @CdG1202 just a quick thought off the top of my head, have you tried inputting your IP address as 10.0.0.120 instead of 010.000.000.120..?

CdG1202 commented 1 year ago

Hi @mitch7391 and thanks for the quick response! yes, I have tried entering the IP as 10.0.0.120 but it makes no difference.

If I browse to: http://10.0.0.120 I get what's in the attached screenshot.

image

CdG1202 commented 1 year ago

And FYI from what I can gather - myair3 uses a different API to myair4 and above (myair3 is apparently XML rather than JSON and is run from the myair controller on the ac unit rather than an android tablet). Not sure if that makes any difference or not??

mitch7391 commented 1 year ago

Oh… Yep, someone on Reddit told me this a few months ago as they were hoping I could help them out. I was not aware until recently the MyAir3 uses XML over Jason and this plug-in as it stands would not support the MyAir3 using XML… Sadly at first thought this would not a simple addition to the plug-in…

uswong commented 1 year ago

To test whether your MyAir3 is accessible or not, can you try the following command on an terminal:

curl -s -g "http://10.0.0.120:2025/getSystemData"

if you get a page of text looks something like below, then it is good. It means your system should be accessible. if you get nothing, your system is not accessible.

 {"aircons":{"ac1":{"info":{"aaAutoFanModeEnabled":false,"activationCodeStatus":"noCode",......

If you system is accessible then can you try running the ConfigCreator.sh from your home directory again? To run the script from your home directory do the following on a terminal:

cd /var/lib/hoobs/myairbridge/node_modules/homebridge-cmd4-advantageair/ConfigCreator.sh

CdG1202 commented 1 year ago

Hi @uswong i did try that, but the myair3 doesn't use port 2025.

To get the system data, I first use:

10.0.0.120/login?password=password

Which authenticates with the unit. Then the following:

10.0.0.120/getSystemData

Which returns the XML below:

<?xml version="1.0" encoding="UTF-8" ?>getSystemData001ec0a159ac112UPSTAIRS7.44110.0.0.120255.255.255.010.0.0.138011025.424.0 0432.016.08140000.000116</iZS10.3>

uswong commented 1 year ago

Thanks, this confirms what Mitch has said this plugin in its current coding is unable to support myAir3 using XML.

mitch7391 commented 1 year ago

@uswong the person who contacted me on Reddit was using Home Assistant but could not get it to work with their integration and was trying their luck with our integration. The tag for MyAir3 on this page was what lead them our way, it seems I had been mistaken by previous users that MyAir3 used the same Jason API and they were hoping we had a solution that Home Assistant didn’t. The good thing was they were very aware the MyAir3 was using XML and port 80 vs Jason and port 2025; so I did not waste much time investigating and I was very quickly able to tell them we could not help at this stage.

It would be a massive undertaking to get MyAir3 working with this plug-in due to the entire plug-in being based on the Jason API. I had pointed this Reddit user to the Home Assistant forum for Advantage Air to see if they could get them to add it and it looks like no one has replied to them…

https://community.home-assistant.io/t/myair-ac-zoning-system-climate-and-room-association-for-components/9953/170

uswong commented 1 year ago

It would be a massive undertaking to get MyAir3 working with this plug-in due to the entire plug-in being based on the Jason API.

Indeed.

CdG1202 commented 1 year ago

@mitch7391 @uswong thanks for your help guys, and very quick replies! I can see that trying to add the MyAir3 XML would be a big undertaking for the few using it! I did find some stuff on the HA forums so will keep digging and see where I end up. Appreciate your help.

mitch7391 commented 1 year ago

@CdG1202 sorry we cannot be of more help at present, maybe you can also comment in that Home Assistant forum to add further backing to the Redditor that also wanted help?

I did some digging around in the advantage air developer forum and they do not have the old XML API there anymore but found a reference to this tool that uses it; maybe this could be presented to the Home Assistant people? It is not a tool we would be able to utilise in the current state of this plug-in (piggy backing off cmd4, but maybe one day if we make our own stand alone plug-in).

Another option is you could always ‘fork’ this project and adapt it to use whatever tools are required to ‘parse’ XML? I knew absolutely nothing about coding before starting this project and while I have had a lot of help along the way from very smart people and am still flying by the seat of my pants, I have learnt a lot and we now have this amazing project!

CdG1202 commented 1 year ago

@mitch7391 yep, a good idea to lend some support in the HA thread. I did also find the pymyair tool you mentioned and another in .net

Last time I did any coding was the early 90's in Pascal and c+ so maybe time to get back into it, albeit with something more modern...

mitch7391 commented 1 year ago

Best of luck @CdG1202 and do let us know how you go or if you think it’s something you could merge into our project :)

Life and work have been so busy these last few years that I am so lucky I have been able to rely on Ung Sing here and John from Cmd4. I really need to start learning JavaScript or TypeScript to make this its own standalone plug-in one day!