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] jq is Required Globally and not Installed #77

Closed turnipcode closed 1 year ago

turnipcode commented 1 year ago

Hi!

I have installed CMD 4 Advantage air on Homebridge but it is not working.

It is stating that I need JQ, yet JQ is installed.

Hoping for some guidance as I need this to get my air con in HomeKit.

Screenshot 2022-12-11 at 6 32 22 am Screenshot 2022-12-10 at 3 26 07 pm Screenshot 2022-12-10 at 3 20 50 pm

mitch7391 commented 1 year ago

Hi Marty, we will definitely get this up and running for you! Looks like you have Homebridge installed on a Mac from the screenshots?

Can I please get you to run the following command from your terminal and please paste the response here?

which jq
turnipcode commented 1 year ago

Thanks Mitch

/opt/homebrew/bin/jq

mitch7391 commented 1 year ago

Awesome, we will need to move jq over to where it should have been installed (not sure why this happens to some users, so probs not your fault!). But, yep this looks the same as a previous user, just to be 100% sure can you confirm there is this file path?

cd /opt/homebrew/Cellar/jq/1.6/bin/jq

Just slightly changes the next command I was going to give you to fix the issue.

turnipcode commented 1 year ago

This is what comes up when I run the above

.jq - commandline JSON processor [version 1.6]

Usage:  /opt/homebrew/Cellar/jq/1.6/bin/jq [options] <jq filter> [file...]
    /opt/homebrew/Cellar/jq/1.6/bin/jq [options] --args <jq filter> [strings...]
    /opt/homebrew/Cellar/jq/1.6/bin/jq [options] --jsonargs <jq filter> [JSON_TEXTS...]

jq is a tool for processing JSON inputs, applying the given filter to
its JSON text inputs and producing the filter's results as JSON on
standard output.

The simplest filter is ., which copies jq's input to its output
unmodified (except for formatting, but note that IEEE754 is used
for number representation internally, with all that that implies).

For more advanced filters see the jq(1) manpage ("man jq")
and/or https://stedolan.github.io/jq

Example:

    $ echo '{"foo": 0}' | jq .
    {
        "foo": 0
    }

For a listing of options, use /opt/homebrew/Cellar/jq/1.6/bin/jq --help.
martylaw@martys-mbp ~ % .
martylaw@martys-mbp ~ % 
mitch7391 commented 1 year ago

Sweet, you will just need to run the following command:

sudo cp /opt/homebrew/Cellar/jq/1.6/bin/jq /usr/local/bin/

Please note the space between the two files paths, but if you copy/paste, then there should be no issue. Give it a reboot after this for good measure and run the 'Config Creator' and 'Configuration Check', and hopefully all is up and running! If not, let me know what the next problem is haha...

turnipcode commented 1 year ago

Thanks Mitch

Really appreciate your help :)

I have run the script, uninstalled and reinstalled with CMD4 (using command line) and Advantage Air (suing HB)

Just got the below error

Screenshot 2022-12-11 at 2 01 34 pm

turnipcode commented 1 year ago

Have since restarted it and the CMD 4 Json is empty again.....doesn't seem to "stick" then when that happens I lose the set up in the advantage air plugin too

turnipcode commented 1 year ago

Thanks Mitch...is now working :)

mitch7391 commented 1 year ago

Have since restarted it and the CMD 4 Json is empty again.....doesn't seem to "stick" then when that happens I lose the set up in the advantage air plugin too

This is very strange, I would suggest normally with config changes you have to 'save' it first and reboot, but I am fairly certain we don't have to do a save after ConfigCreator, did you end up doing anything different to resolve the last issue you had Marty? Just so I can log it away in my brain fro future :) glad to hear you are all up and running though!

mitch7391 commented 1 year ago

My fellow dev has pointed out that what you have experienced here with the 'config not sticking' is due to the order of how you did things:

I have run the script, uninstalled and reinstalled with CMD4 (using command line) and Advantage Air (suing HB)

Running the script has created the config you saw, then uninstalling the plugins would have wiped the config and then reinstalling the plugins without running the scripts again would have seen no config for them. Also I do recommend installing both plugins via the Homebridge web UI and not via command line; just to keep things simple and not set yourself up for something to go wrong :)