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

[Support] Unable to connect to Air con unit #51

Closed l80n63 closed 2 years ago

l80n63 commented 2 years ago

Hi there CMD4 Advantage community.

I am having issues with my homebridge setup for advantage air. I have been using olde versions of the CMD4 plugin for a while successfully but after a recent update everything broke. It is driving me mad trying to fix this as it should be trivial. I am having the issue where I get a constant error of More than 500 errors were encountered in a row for___ as per the screenshot I have attached. I have recently reinstalled the entire Raspbery Pi OS on my machine, followed the steps of installing homebridge and CMD4 plugin as per each GitHub’s page and still receiving this issue. I read through the troubleshooting steps of a gentlemen who had the same issue after transferring to a pi from. Mac and none of his steps have worked. I’d like someone who has more per ties in this field to review what I have done and provide me with some ti[s on where to get started. Sorry for long code but iOS won’t let me upload .json CE662026-C1F5-4B61-BF31-86C62E06F6BA

{
    "bridge": {
        "name": "Homebridge 869B",
        "username": "0E:45:59:74:86:9B",
        "port": 51594,
        "pin": "[902-47-334](tel:902-47-334)"
    },
    "accessories": [],
    "platforms": [
        {
            "platform": "Cmd4",
            "name": "Cmd4",
            "outputConstants": false,
            "statusMsg": true,
            "timeout": 5000,
            "stateChangeResponseTime": 0,
            "constants": [
                {
                    "key": "${IP}",
                    "value": "172.17.65.192"
                }
            ],
            "queueTypes": [
                {
                    "queue": "A",
                    "queueType": "WoRm"
                }
            ],
            "accessories": [
                {
                    "type": "Fan",
                    "displayName": "Fan",
                    "on": "FALSE",
                    "rotationSpeed": 100,
                    "name": "Fan",
                    "manufacturer": "Advantage Air Australia",
                    "model": "e-zone",
                    "serialNumber": "Fujitsu e-zone2",
                    "queue": "A",
                    "polling": true,
                    "state_cmd": "/usr/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh",
                    "state_cmd_suffix": "${IP}"
                },
                {
                    "type": "Switch",
                    "displayName": "Leighton",
                    "on": "FALSE",
                    "name": "Leighton",
                    "manufacturer": "Advantage Air Australia",
                    "model": "e-zone",
                    "serialNumber": "Fujitsu e-zone2",
                    "queue": "A",
                    "polling": true,
                    "state_cmd": "'/usr/local/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh'",
                    "state_cmd_suffix": "z07 ${IP}"
                },
                {
                    "type": "Thermostat",
                    "displayName": "Aircon",
                    "currentHeatingCoolingState": "OFF",
                    "targetHeatingCoolingState": "OFF",
                    "currentTemperature": 25,
                    "targetTemperature": 25,
                    "temperatureDisplayUnits": "CELSIUS",
                    "name": "Aircon",
                    "manufacturer": "Advantage Air Australia",
                    "model": "e-zone",
                    "serialNumber": "Fujitsu e-zone2",
                    "queue": "A",
                    "polling": [
                        {
                            "characteristic": "currentHeatingCoolingState"
                        },
                        {
                            "characteristic": "targetHeatingCoolingState"
                        },
                        {
                            "characteristic": "currentTemperature"
                        },
                        {
                            "characteristic": "targetTemperature"
                        }
                    ],
                    "state_cmd": "/usr/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh",
                    "state_cmd_suffix": "${IP}",
                    "linkedTypes": [
                        {
                            "type": "Fan",
                            "displayName": "Fan Speed",
                            "on": "TRUE",
                            "rotationSpeed": 100,
                            "name": "Fan Speed",
                            "manufacturer": "Advantage Air Australia",
                            "model": "e-zone",
                            "serialNumber": "Fujitsu e-zone2",
                            "queue": "A",
                            "polling": [
                                {
                                    "characteristic": "on"
                                },
                                {
                                    "characteristic": "rotationSpeed"
                                }
                            ],
                            "state_cmd": "/usr/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh",
                            "state_cmd_suffix": "${IP}fanSpeed"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        }
    ]

}
mitch7391 commented 2 years ago

Hi @l80n63, first mistake I see is you need a space between ${IP} and fanSpeed in "state_cmd_suffix": "${IP}fanSpeed".

Have you sent a simplified version of your config? Do you have temperature sensors and how many zones do you have?

Did you also use the ‘shell check tool’ detailed in the install instructions? Does this pass all checks?

mitch7391 commented 2 years ago

Also @l80n63 it could be worth trying the beta version we have going and see if you issue disappears on that version.

l80n63 commented 2 years ago

Hi Mitch, I appreciate the fast reply.

I have since fixed the $IP issue as I was trying to do space deletion fix that the other user said resolved his issue. I do not have a simplified config, this was only created earlier today using the data from your wiki on here. I have a single aircon with multiple zones attached, currently I am just testing the one for myself before I can duplicate that block of code adding the other zones to HomeKit. And yes curl does return a version number, I have 7.74.0 installed.

mitch7391 commented 2 years ago

Ah yep that makes sense then. Can I get you to revert the ‘no space’ and make sure you save you config and then delete the Homebridge UI cache for the Thermostat (let me know if you do not know how to do this).

jq and curl both return a version number for you too? If you want, try the beta version and it will require no further config changes or any extra effort. We have made a lot of under the good changes that I would be curious to see if those have helped with this issue that (now) three users have reported.

l80n63 commented 2 years ago

Ok, I can fix the no space issue. Both also return version numbers for me as per the instructions. I am keen to try the beta version to provide feedback but have not manually installed a Homebridge plugin before. I have found the beta branch in your GitHub repo but if you could inform me how to overwrite the stable stream with the beta files I’d give it a crack.

mitch7391 commented 2 years ago

On the Homebridge web UI, go to the ‘Plugins’ tab, located ‘homebridge-cmd4-advantageair’, click the spanner icon, click ‘Install Previous Version’ and select the beta version from the drop down menu :)

l80n63 commented 2 years ago

Hey, I have installed the beta as per your instructions Mitch. Unfortunately the error still persists. Do I have to update anything in my config for the new beta? I also tried removing cached accessories again after the upgrade to little use.

mitch7391 commented 2 years ago

The beta should require no further changes to your config if it’s still looks as above. Sounds like this is a different issue then.

Can you fill out the following info for me please that was missed in the original ticket creation? Just so I better understand what you are working with :)

Advantage Air System:

Homebridge Environment:

ztalbot2000 commented 2 years ago

Hi Mitch,

I'm surprised that your homebridge-ui plugin to check his installation did not find the error. As while he did put an IP, without the space it should not have conformed to a proper IP address.

You could check this,

Ttyl, John

On Fri, Feb 25, 2022 at 2:39 AM Mitch Williams @.***> wrote:

Hi @l80n63 https://github.com/l80n63, first mistake I see is you need a space between ${IP} and fanSpeed in "state_cmd_suffix": "${IP}fanSpeed".

Have you sent a simplified version of your config? Do you have temperature sensors and how many zones do you have?

— Reply to this email directly, view it on GitHub https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/issues/51#issuecomment-1050609259, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX53B7IAEPGCJ7HFZPTU44W2LANCNFSM5PJQRDCQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

mitch7391 commented 2 years ago

That is a very fair point John, in this beta I need to update the server.js file for checking the new ‘MyPlace extras’, I will look at adding this check too… The list never ends!

l80n63 commented 2 years ago

Hey, I have attached the information required below. The only error the self checker in the web platform is finding is to remove the the single quote marks within the double quotes in "state_cmd": "/usr/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh", It previously looked like: "’state_cmd": "/usr/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh’",

This produces an error for each one until I remove those single quotes then check passes. However it still has not resolved the issue.

Advantage Air System:

Control Unit: MyAir4 Temperature Sensors: No Homebridge Environment: Raspbian GNU/Linux Bullseye (11)

Node.js Version: node -v 16.4.0 NPM Version: npm -v 8.3.1 Homebridge Version: V1.4.0 according to logs homebridge-cmd4 Version: 6.1.2 homebridge-cmd4-AdvantageAir Version: 3.3.0 beta 5 Operating System: Raspbian on raspberry pi 4

mitch7391 commented 2 years ago

Thanks for taking the time to grab this info for me @l80n63. Can you please try the two following commands from your terminal and let me know what each responds with?

which jq
which curl
l80n63 commented 2 years ago

Sure thing, Which jq brings back /usr/bin/jq Which curl brings back /usr/bin/curl

mitch7391 commented 2 years ago

Ok, sweet both of those are in the correct folder and Homebridge will see them. We can cross that off the list!

Can I get you to navigate to your tmp folder. Just in your terminal type:

cd /tmp

Then this command to see all files:

ls -al

And have a look in one of the many files of the naming convention AirconError-*.log (where will a bunch of numbers). Look at the most recent one with the following command (substituting for the number of the file):

sudo nano AirconError-*.log

Can you paste the contents here or take a take a screenshot?

l80n63 commented 2 years ago

I have attached screenshots of the air con unit details and the error log as per the instructions image 60C8DE45-288D-450A-A758-ECC52348AA20

mitch7391 commented 2 years ago

Hey @l80n63, thank you for getting this to me. I will have to get back to you tomorrow afternoon/evening (sorry for the inconvenience). I have a 30th to go to tonight and plans for most of the day tomorrow.

@uswong feel free to jump in in the meantime but I will have to check out for now; otherwise I will take a look tomorrow.

uswong commented 2 years ago

Hi @l80n63, the return code: 7 means the plugin fails to connect to host. The host here is your aircon system.

Can you try for me at the terminal command line: curl -s -g "http://172.17.65.192:2025/getSystemData"

you should get a whole page of text starting with {"aircons":{"ac1":{"info" etc...

If you don't, try http://172.17.65.192:2025/getSystemData on your browser, you should get the same thing.

If not, then your aircon system is not communicating with the plugin at all.

One thing to try is to reboot your android unit of the aircon system and make sure that you aircon system is connected to your home WiFi network.

l80n63 commented 2 years ago

No problem Mitch, you have been very helpful during this process so far and I appreciate the time you have given up so far. I did follow the advice of @uswong and initially it did not produce anything back. I then restarted the android tablet as suggested and voila the error has disappeared and the HomeKit plugin works. Thanks for the tip and I feel so dumb for not following IT tip #1. However we are not entirely out of the weeds yet. The other accessories I have configured for the individual rooms like mine (Leighton) do not seem to function. They follow the state of the android tablet but when trying to do through HomeKit/homebridge’s accessories, it does not change on the android tablet and stays to the position it says. So for example, if it is on, and I press off on the iPad, it will turn off on the iPad momentarily then return to on.

uswong commented 2 years ago

The other accessories I have configured for the individual rooms like mine (Leighton) do not seem to function.

Do you have temperature sensor for this room?

Based on the config file you posted earlier, it appears that you have temperature sensor for this room as you have configured it as a Switch.

If this room has no temperature sensor, then you should configure it as a lightbulb accessory. Just in case this is the case, an example as follow:

  {
        "type": "Lightbulb",
        "displayName": "Leighton",
        "on": "FALSE",
        "brightness": 50,
        "name": "Leighton",
        "manufacturer": "Advantage Air Australia",
        "model": "e-zone",
        "serialNumber": "Fujitsu e-zone2",
        "queue": "A",
        "polling": [
            {
                "characteristic": "on"
            },
            {
                "characteristic": "brightness"
            }
        ],
        "state_cmd": "'/usr/local/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh'",
        "state_cmd_suffix": "z07 ${IP}"
    },
l80n63 commented 2 years ago

Ah, my mistake again. Thank you for that tip. That now works for me even though it is strange having a lightbulb as your fan control but its the price you pay for not having a native HomeKit air conditioner. Thanks to the two of you @mitch7391 and @uswong you have been massive helps. I’ll lave this open for another 3 days if I hit anything then will close this thread.

mitch7391 commented 2 years ago

I then restarted the android tablet as suggested and voila the error has disappeared and the HomeKit plugin works. Thanks for the tip and I feel so dumb for not following IT tip https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/issues/1.

@l80n63 I am absolutely spewing I did not suggest this sooner haha it will be one of the first times I have not suggested it, as each time I do suggest it, it was not the problem! If your tablet this locked up (which happens on occasion), then it will show the errors you experienced; but many other things in an incorrect setup can show that same issue. Glad it was a simple fix in the end!

As a non temperature sensor user, you can use the switch accessories if you want to but you will only have control of open/close and not how much percentage open/close. HomeKit does not have an appropriate accessory for zone percentage control, that is why we make use of the LightBulb accessory until they give us something better to use. You can read about it on the Wiki tab if you are interested.

Hope it is all working now and sorry for the late reply; my commitments this weekend ran longer than expected!

@uswong thank for the help in my absence!

uswong commented 2 years ago

Just for future reference, I have just resolved JohnW's issue with the same return code : 7, ie the homebridge lost communication with the hosts (the MyPlace Andoid tablet).

A reboot in this case did not resolve the problem.

Eventually we found that the IP address of MyPlace system has changed. The change of the IP address was mostly likely due to a blackout and when the power came back, the router has assigned a different IP address to the MyPlace tablet.

mitch7391 commented 2 years ago

Oh yep that will definitely do it! Nice find Ung Sing :)

mitch7391 commented 2 years ago

@l80n63 how has everything been looking on your system? No further issues?

l80n63 commented 2 years ago

Hey @mitch7391, everything seems to be working very solid the past week. This has been amazing, let me know if future beta updates come out so I can provide feedback to your team but this beta build I have now seems to be working flawlessly. Thanks to everyone for the help as well

mitch7391 commented 2 years ago

Glad to hear it and thanks for the update :) if you are curious to be 'signed up' for future beta testing, all you had to do is go to watch in the top right hand corner of the page, select custom and then Releases. This will give you an email every time I release a new version; including beta versions which people will not know about unless I create an issue for it.