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 4 forks source link

[Support] HOOBS Installation Issue #70

Closed QLDRiddler closed 2 years ago

QLDRiddler commented 2 years ago

Hi Mitch, thanks for developing this plugin, just what I am looking for. However, getting stuck at the first hurdle! I'm trying to install on my Hoobs setup, I've already downloaded and installed the CMD4 plugin and then installed the AdvantageAir one.

I accessed the Terminal and followed the instructions but when I enter $config, I get an error messgae back stating ERROR: either your AdvantageAir system is inacessible or your IP address /var/lib/hoobs/cmd4bridge/node_modules/homebridge-cmd4-advantageair/ConfigCreator.sh is invalid! - I thought this step was mean to ask for the ip address of my AA system? What am I doing wrong?

uswong commented 2 years ago

Hi @QLDRiddler, based on the script messages, I can see that you are still using the old version of the script. Apparently you have not successfully installed the v3.6.0-beta.2 version.

The v3.6.0-beta.2 has an updated ConfigCreator.sh.

One option is to download the script from this link: https://github.com/uswong/homebridge-cmd4-AdvantageAir/blob/master/ConfigCreator.sh

click on the copy button (red circled in the picture below) to copy the full content

image

Create a file called ConfigCreator.sh on your home drive using any editor of your choice and paste the entire content into it and save it, then make the file executable by the following command:

chmod +x ConfigCreator.sh

then run the script:

./ConfigCreator

then follow the prompts.

If everything runs fine, it should look something like below: image

If not, please post the error messages.

mitch7391 commented 2 years ago

Was just about to reply @uswong :p thanks for jumping on that one! I will edit your comment to include how to remove the old file and how to create the new one just in case.

Also side note @QLDRiddler, none of your screenshots work because you always reply via email and not via the GitHub website.

mitch7391 commented 2 years ago

Oh wait disregard that Ung Sing, I see you are getting QLDRiddler to create the file on the Home drive... Just in case, the command to create the file is sudo nano ConfigCreator.sh.

uswong commented 2 years ago

Yes, I think it is best not to touch the directory of the v3.5.1 installation but create the file in the Home drive for now, so that there is no permission issues also when running the script.

Hey Mitch, may be you can post the screen shot of your test on your HOOBS for QLDRiddler's reference.

QLDRiddler commented 2 years ago

Copied the script from the link provided, used sudo nano to create the file and paste the script, ran the newly created ConfigCreator.sh, entered the details but then it crapped out as per below:

@.:~ $ ls cmd4Config_AA_Dutton.json cmd4ConfigAA.json.1660633030 cmd4Config_AA_MyPlace.json.1661490720 cmd4Config_AA_MyPlace.json.1661491119 cmd4ConfigAA.json.1660632908 cmd4ConfigAA.json.1660635646 cmd4Config_AA_MyPlace.json.1661490811 ConfigCreator.sh cmd4ConfigAA.json.1660632983 cmd4Config_AA_MyPlace.json.1660637396 cmd4Config_AA_MyPlace.json.1661490914 @.:~ $ ConfigCreator.sh Please enter the name (default: Aircon) and IP address of your AdvanatageAir system: Name: Home IP address (xxx.xxx.xxx.xxx): 192.168.101.164

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/cmd4bridge/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 (Home 192.168.101.164)....

WARNING: No Homebridge config.json file located by the script!

Please enter the full path of your Homebridge config.json file, otherwise just hit enter to abort copying "cmd4Config_AA_Home.json" to Homebridge config.json. The config.json path should be in the form of ///*/config.json

WARNING: No Homebridge config.json file specified Copying of cmd4Config_AA_Home.json to Homebridge config.json was aborted

INFO: Please copy/paste the cmd4Config_AA_Home.json into Cmd4 JASON Config Editor manually @.***:~ $

On Fri, 26 Aug 2022 at 16:04, Mitch Williams @.***> wrote:

Oh wait disregard that Ung Sing, I see you are getting QLDRiddler to create the file on the Home drive... Just in case, the command to create the file is sudo nano ConfigCreator.sh.

— Reply to this email directly, view it on GitHub https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/issues/70#issuecomment-1228090304, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2RODL6QQ77G47SHUYMVNJLV3BNALANCNFSM56UQCGDQ . You are receiving this because you were mentioned.Message ID: @.***>

uswong commented 2 years ago

The issue now is the config.json file required not found. Can you locate the config.json file in your system?

ls -al /var/lib/hoobs/cmd4bridge Do you see config.json file in that directory?

if not, that is something you need to find out. Try the following commands, hopefully one of them will find your config.json file: find /var/lib -name config.json | grep -v find | grep -v node_modules | grep -v cache | grep -v System | grep config.json or find /usr/lib -name config.json | grep -v find | grep -v node_modules | grep -v cache | grep -v System | grep config.json or find /usr/local/lib -name config.json | grep -v find | grep -v node_modules | grep -v cache | grep -v System | grep config.json

mitch7391 commented 2 years ago

It should be located in /var/lib/hoobs/hoobs/config.json right?

uswong commented 2 years ago

It should be located in /var/lib/hoobs/hoobs/config.json right?

The script would have found it if it is there.

mitch7391 commented 2 years ago

Disregard me again… I should stop jumping in lol mine might be there because I do not have a bridge setup; I will leave this to you Ung Sing, I am muddying the waters haha…

QLDRiddler commented 2 years ago

OK, there was a config.json file in /var/lib/hoobs/cmd4bridge so I added those details when promoted in the ConfigCreator process. Seemed to go OK and I got prompted to reboot but still showing as 3.5.1 in the versions :(

image

mitch7391 commented 2 years ago

Anything in your accessories tab now @QLDRiddler..? :)

uswong commented 2 years ago

Nice! It still show v3.5.1 is because the v3.6.0.beta.2 was not installed successfully. That is ok.

can u do this command for me to check the validity of the config.json

cat /var/lib/hoobs/cmd4bridge/config.json | more

if you see something like “platform”: “Cmd4” in there, then the script has done its job and your MyPlace accessories should have been created and you should see it in HOOBS and in HomeKit.

From here on, Mitch should be able to help you more as he has tested it with his own HOOBS installation.

uswong commented 2 years ago

the command should be:

cat /var/lib/hoobs/cmd4bridge/config.json | more

uswong commented 2 years ago

Hi @QLDRiddler, would you be able to issue the following command and see what you get on your system?

find /var/lib/hoobs -name config.json 2>&1|grep -v find|grep -v System|grep -v cache|grep -v hassio|grep -v node_modules|grep config.json

If your config.json is in /var/lib/hoobs/cmd4bridge then the script should have found it. Why it did not find it is a bit puzzle to me.

QLDRiddler commented 2 years ago

So the cat command produces a bunch of text which includes

{"platform":"cmd4AdvantageAir"}.

It does also include this:

{"platform":"Cmd4","name":"Cmd4","debug":false,"outputConstants":false,"statusMsg":true,"timeout":60000,"stateChangeResponseTime":0,"constants":[{"key"

but shouldnt there be } and ] symbols at the end of that string before the next "key" string starts?

Also confirming teh Find command did locate a ferw instances of config.json including one in cmd4bridge.

I can now see all my zones, temps etc in Accessories but theyre not showing up in my Apple Home app :-(

Finally, anyway of changing the name I gave my system during install? I clicked on the Config button on the plugin but that didnt have any info.

image

mitch7391 commented 2 years ago

@QLDRiddler if you are seeing all of the expected accessories in the ‘Accessories’ tab on HOOBS UI then this has been a success. From HomeKit you should be able to scan the QR code provided for your bridge on HOOBS UI and it should then add the accessories for you to HomeKit. I actually had not done this step myself on my HOOBS machine as I did not want to add them to my HomeKit as duplicates haha…

mitch7391 commented 2 years ago

Finally, anyway of changing the name I gave my system during install? I clicked on the Config button on the plugin but that didnt have any info.

Do you mean the name you have to the ConfigCreator or your bridge? If you mean the former, you can run it all again or you can modify that ‘config.json’ from the terminal or HOOBS UI (click config on a plug-in and on the left should show your plugins and an ‘advanced’ section; modify it in there).

uswong commented 2 years ago

Also confirming teh Find command did locate a ferw instances of config.json including one in cmd4bridge.

Hi @QLDRiddler, Would u be able to post all the instances of the find commands? This is for me trying to understand better the directory structure of HOOBS installation. I was expecting a single instance. Multiple instances is the reason it did not work at the first place.

QLDRiddler commented 2 years ago

First of all, apols for being such a doofus and not scanning the QR code to add to my Homekit, have done that now and all shows up.

I posted above the contents of the advanced config screen on the bridge, the only entry is "platform": "cmd4AdvantageAir" so no chance to change the name there. Is that possibly related to the }] situation I mentioned?

Here's the output from the Find command:

image

uswong commented 2 years ago

Try cat /var/lib/hoobs/cmd4bridge/config.json

then you should see the full complete json file.

What you saw before was only part of config.json

uswong commented 2 years ago

Thanks for the output of the find command, I know now what I have to do to pick up only the right one. I will get u an updated version later tonight or tomorrow.

uswong commented 2 years ago

Hey Mitch and @QLDRiddler,

Please download an updated version of ConfigCreator.sh.

HOOBS has multiple config.json files if you have created multiple bridges in it. As such, I have to scan all the config.json files for "Cmd4" or "homebridge-cmd4" to get the correct config.json file to use.

https://github.com/uswong/homebridge-cmd4-AdvantageAir/blob/master/ConfigCreator.sh

Please test it out. @QLDRiddler should no longer need to input the full path to config.json. It should also work for homebridge users too.

uswong commented 2 years ago

{"platform":"Cmd4","name":"Cmd4","debug":false,"outputConstants":false,"statusMsg":true,"timeout":60000,"stateChangeResponseTime":0,"constants":[{"key" but shouldnt there be } and ] symbols at the end of that string before the next "key" string starts?

What you saw above was only part of config.json (in compact form) and that is why you see that the brackets are not balanced. What you saw above was correct config.json file for the plugin but incomplete.....

Try cat /var/lib/hoobs/cmd4bridge/config.json

then you should see the full complete config.json file and all the square and curly brackets are balanced.

If you rather want to see the config.json in an expanded form, try the command below:

jq --indent 4 '.' /var/lib/hoobs/cmd4bridge/config.json

QLDRiddler commented 2 years ago

Hey Mitch and @QLDRiddler,

Please download an updated version of ConfigCreator.sh.

HOOBS has multiple config.json files if you have created multiple bridges in it. As such, I have to scan all the config.json files for "Cmd4" or "homebridge-cmd4" to get the correct config.json file to use.

https://github.com/uswong/homebridge-cmd4-AdvantageAir/blob/master/ConfigCreator.sh

Please test it out. @QLDRiddler should no longer need to input the full path to config.json. It should also work for homebridge users too.

Worked first time :) You little beauties!!

Couple more questions for you:

  1. Does your wonderful plugin allow the user to change the focus zone?
  2. Can you change the fan labels from a % to Low, Medium and High?
  3. When I'm in the Apple Home app it's grouping the temperature sensor controls in my "Air Conditioning" room together, I'm guessing that's by design? When I click into that temperature group, its calling out a couple of the controls as having low batteries? Does that literally mean I need to swap out the button batteries in those sensors? I havent seen that info on the main Advantage Air app. 73084A2A-8264-445F-A04A-48195DC868AB
mitch7391 commented 2 years ago

Hey @QLDRiddler sorry for the late reply, I had an evening out planned last night; but you were in good hands with Ung Sing in my absence!

First of all, apols for being such a doofus and not scanning the QR code to add to my Homekit, have done that now and all shows up.

Easy mistake to make when we have given you so many things to do :p I am very glad it was just a simple thing like this and not something more major haha...

I posted above the contents of the advanced config screen on the bridge, the only entry is "platform": "cmd4AdvantageAir" so no chance to change the name there. Is that possibly related to the }] situation I mentioned?

I may not have described this as well while I was in an Uber last night as I did not have HOOBS in front of me. It looks like you went to the advanced section of 'cmd4-advantageair' but not the advanced section I meant. Here is where I meant:

image

This is the config that the 'ConfigCreator' has made for you and from here, you can now manually edit the displayName's of any of your accessories if you want to.

Does your wonderful plugin allow the user to change the focus zone?

I might need a little more information about your system, do you mean the 'constant zone' represented as a C in your Advantage Air app? Or do you my the 'myZone' represented as an M in some systems? If you mean the C, I believe only the installer can change this, but if you mean the M we have not added the support yet, but has been on my mind as a small feature that I keep forgetting about. I believe the M is one you can change around to whichever room you like at any given time (I do not have this feature in my e-zone system).

Can you change the fan labels from a % to Low, Medium and High?

This is a limitation imposed by Apple themselves for HomeKit; they only support fans that turn on/off or have % based speed. We have set up a conversion in our code to do the low/med/high/auto as 1-33% for low, 34-67% for medium, 68-99% for high and 100% for 'auto' or 'ezfan'. You can read about it all here in my Wiki if you are interested.

When I'm in the Apple Home app it's grouping the temperature sensor controls in my "Air Conditioning" room together, I'm guessing that's by design?

That is correct and how I like to keep mine so when I pull up the temperature status indicator on the home page it shows them in all one place and not scattered across rooms making you scroll down to see them all. You can change this by long pressing on the temperature sensor accessory, scrolling down and changing what room it lives in.

When I click into that temperature group, its calling out a couple of the controls as having low batteries?

Yes, this means you do have low batteries if the code is working properly; to be 100% sure cross reference with your Advantage Air app and check the zones tab to see if they have any errors on them. In our plug-in the default for 'no reading' is the 25.0deg value; so based on what you have shown me, the batteries have died and are no longer communicating to the control unit any more or they have somehow lost comms to the control unit itself and cannot get a read of value or battery. Please let us know if your Advantage Air app tells you they are reading fine.

I think I have answered all your questions? But please let me know if I have missed any. I just also wanted to thank you for your patience and help; I know we had a lot of kinks to iron out to get this working for you, but your hard work has ensured that the next HOOBS user will have a much smoother experience :) Please continue to raise issues for any bugs you find or features you would like to see!

QLDRiddler commented 2 years ago

Wow, such a comprehensive response. Thank you. Quick reply from me.

Yes, I did mean the feature M zone - I will look out for future updates if youre able to get this included.

I've gone into the tech setup on my AA panel to check the sensors and its reporting all is OK, as per the photo below, as is the zones tab of the app so not sure where the battery warning is coming from.

IMG_0650

mitch7391 commented 2 years ago

Yes, I did mean the feature M zone - I will look out for future updates if youre able to get this included.

I will talk with Ung Sing and we will look into adding it as one of the future updates :) should not be a hard one to implement.

I've gone into the tech setup on my AA panel to check the sensors and its reporting all is OK, as per the photo below, as is the zones tab of the app so not sure where the battery warning is coming from.

I am not terribly familiar with that Advantage Air UI design, is that the ‘zone10e’ that you have? If not, which app is it that you are using?

I have just pulled the battery out of one of my sensors to show you. For my temperature sensors, it will show here:

E8A5505A-56DC-4BC9-8DFB-0FB5004B338F

You can always swap the batteries around to be sure; it can take up to 15mins for the Advantage Air controller to recognise the new battery I have found. Otherwise we will have to try figure out what is going wrong for these two temperature sensors for you!

QLDRiddler commented 2 years ago

The photo was of the native tablet supplied with the system and directly connected to the control unit. If you click on setup, there's an option for Tech Setup that you access after entering a master PIN. Then lots of behind the scenes goodies. I believe this Tech Setup option doesnt show in the regular apps, only on the native tablet (which is running an OEM version of Android). I have seen the battery warnings come up before in the Zones tab on the apps but theyre all showing normally at the moment.

On Sat, 27 Aug 2022 at 16:58, Mitch Williams @.***> wrote:

Yes, I did mean the feature M zone - I will look out for future updates if youre able to get this included.

I will talk with Ung Sing and we will look into adding it as one of the future updates :) should not be a hard one to implement.

I've gone into the tech setup on my AA panel to check the sensors and its reporting all is OK, as per the photo below, as is the zones tab of the app so not sure where the battery warning is coming from.

I am not terribly familiar with that Advantage Air UI design, is that the ‘zone10e’ that you have? If not, which app is it that you are using?

I have just pulled the battery out of one of my sensors to show you. For my temperature sensors, it will show here:

[image: E8A5505A-56DC-4BC9-8DFB-0FB5004B338F] https://user-images.githubusercontent.com/40288237/187018930-71c9e964-6f63-4f2d-99df-153a5d3609f8.jpeg

You can always swap the batteries around to be sure; it can take up to 15mins for the Advantage Air controller to recognise the new battery I have found. Otherwise we will have to try figure out what is going wrong for these two temperature sensors for you!

— Reply to this email directly, view it on GitHub https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/issues/70#issuecomment-1229137911, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2RODLY3HZXFLX5X7FUF5ODV3G4BXANCNFSM56UQCGDQ . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 2 years ago

@QLDRiddler yep that makes sense, same for my 'e-zone' app in terms of what can accessed on the phone app vs the master control tablet; I just took my screenshot from my phone as it was easier for uploading a photo to GitHub. What I need to know to work out if we still need to help out the two temperature sensors is the following:

  1. What is the name of the app you are using? Is it 'zone10e', 'MyAir', 'MyPlace', 'e-zone', etc.?
  2. Can we get you to put some new batteries in those two zones that have the warnings, wait at least 15 minutes and let us know if they are still showing with an error? It looks like form what you have shown me on the master app that they should be healthy, but I am still unsure due to not knowing which app that is.
mitch7391 commented 2 years ago

Closing this issue due to the latest version released covering all the work completed to get HOOBS working. Please continue to comment @QLDRiddler if you need further help with those temperature sensors or feel free to open another issue :)

QLDRiddler commented 1 year ago

Thanks Mitch, I’m actually away this week so won’t get a chance to play until next weekend. However I did realise last night that turning zones on and off in the Apple Home app had no effect on the actual system. Suspecting this may have something to do with all the testing and changes we’ve made so when I do get back home I plan to uninstall everything and start from scratch with the new production version.


From: Mitch Williams @.> Sent: Sunday, August 28, 2022 6:52:29 PM To: mitch7391/homebridge-cmd4-AdvantageAir @.> Cc: QLDRiddler @.>; Mention @.> Subject: Re: [mitch7391/homebridge-cmd4-AdvantageAir] [Support] HOOBS Installation Issue (Issue #70)

Closing this issue due to the latest version released covering all the work completed to get HOOBS working. Please continue to comment @QLDRiddlerhttps://github.com/QLDRiddler if you need further help with those temperature sensors or feel free to open another issue :)

— Reply to this email directly, view it on GitHubhttps://github.com/mitch7391/homebridge-cmd4-AdvantageAir/issues/70#issuecomment-1229409890, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2RODL5MT4WEG4MKJHPHJB3V3MSE3ANCNFSM56UQCGDQ. You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 1 year ago

No worries @QLDRiddler, it sounds like something is still not set right then. Please open a new issue if you face any problems and we will try our best to help you out.