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

[Beta] v3.3.0-beta Testing #45

Closed mitch7391 closed 2 years ago

mitch7391 commented 2 years ago

3.3.0-beta.2 (2022-02-18)

Special thanks to the amazing uswong and ztalbot2000 for adding these new features!

Notable Changes

Other Changes

Bug Fixes

mitch7391 commented 2 years ago

A quick question before I head to bed, but do those lights have the dimming ability or are they simple on/off lights? If they are simple on/off lights, then you will need to use this slightly different config for them (remember you might need to do the cache trick again if changing them.

kaim2000 commented 2 years ago

@mitch7391 yeah they are dimmable and dimming feature actually works when controlling them using Home App i.e. if I increase brightness they increase IRL. Seems to just be homebridge saying there's an issue when there maybe isn't one because the lights are working

uswong commented 2 years ago

one weird issue -- two lights seem to be presenting issues.

Can you check whether you have lights called Kitchen Light or Scullary Light. Make sure the light names are exactly the same appear in MyPlace App and the light names are case sensitive as well.

kaim2000 commented 2 years ago

@uswong, I named the lights Kitchen Light and Scullary light for displayname and name - the lights are called "Kitchen" and "Scullary" on MyPlace (I checked if there was maybe a trailing space that I couldn't see but there isn't). On my config file the state_cmd_suffix is labelled "Kitchen" and "Scullary" correctly. Since the lights are working perfectly through the Home App I feel it might just be homebridge throwing an error when there isn't one. I don't think it needs fixing since it works, was just curious why the homebridge terminal says error when there isn't one.

uswong commented 2 years ago

ok, it is the ambiguity issues with your light names. you must have other lights called Kitchen xx, and Scullary xx.

kaim2000 commented 2 years ago

@uswong Ah Okay, I will do some renaming. I have added all of my lights but it seems to have taken a massive performance knock -- takes a good 20 seconds for Home App to update all the accessories and then when I turn a light on/off sometimes nothing happens or it takes 20-30seconds for the light to turn on/off. Do you think I should try different Queues?

kaim2000 commented 2 years ago

I'm not sure if its the naming which is presenting an issue - there are 6 lights with the name "Kai XXX" i.e. Kai LED, Kai Light etc, and the same with some other room descriptors. These are all working fine, but it seems the Kitchen light (of which there are only three "Kitchen" Variants is still giving the issue (along with about 4 other lights). I'm going to send my homebridge log to @mitch7391, not sure if it could help in diagnosing the issue but hopefully it does. Will also send my config.json

uswong commented 2 years ago

Sorry the late reply.

If you have a light named Kitchen, and also have lights named Kitchen xx1, kitchen xx2 etc, then the light Kitchen can be confused with all other lights starting with Kitchen. In this case you can name the light Kitchen to something like Kitchen xx0 to make it permutationally unique with the others lights with the words Kitchen in it.

One other option is that you can use underscore _ in place of space on all other lights starting with Kitchen.

The key is that the all lights' name got to be permutationally unique in order to prevent any confusion.

there are 6 lights with the name "Kai XXX" i.e. Kai LED, Kai Light etc

These 6 lights work because they all have two words and permutationally unique with one another.

uswong commented 2 years ago

takes a good 20 seconds for Home App to update all the accessories and then when I turn a light on/off sometimes nothing happens or it takes 20-30seconds for the light to turn on/off.

I did experience long delay once in a while during my testing on My son's MyPlace system. He has 77 lights and 1 garage door with 10 zones aircon system. For a big system, the time taken for the data to retrieve from the system can range from 3 seconds to an extreme 60 seconds. Below is a histogram of time taken for data to be retrieved from the MyPlace system in my son's house. It takes an average of 6 seconds to retrieve. This histogram has ~5000 data points. There are quite a number of cases in excess of 20 seconds. As such, it is not unusual to have quite a delay once in a while.

Having said that if the long delay is happening all the time, then it is something to be investigated.

image

kaim2000 commented 2 years ago

Sorry the late reply.

If you have a light named Kitchen, and also have lights named Kitchen xx1, kitchen xx2 etc, then the light Kitchen can be confused with all other lights starting with Kitchen. In this case you can name the light Kitchen to something like Kitchen xx0 to make it permutationally unique with the others lights with the words Kitchen in it.

One other option is that you can use underscore _ in place of space on all other lights starting with Kitchen.

The key is that the all lights' name got to be permutationally unique in order to prevent any confusion.

there are 6 lights with the name "Kai XXX" i.e. Kai LED, Kai Light etc

These 6 lights work because they all have two words and permutationally unique with one another.

Thank you, this fixed it. Didn't realise that having one light named "Kitchen" and then another named "Kitchen LED" would cause that but it's all fixed now

kaim2000 commented 2 years ago

takes a good 20 seconds for Home App to update all the accessories and then when I turn a light on/off sometimes nothing happens or it takes 20-30seconds for the light to turn on/off.

I did experience long delay once in a while during my testing on My son's MyPlace system. He has 77 lights and 1 garage door with 10 zones aircon system. For a big system, the time taken for the data to retrieve from the system can range from 3 seconds to an extreme 60 seconds. Below is a histogram of time taken for data to be retrieved from the MyPlace system in my son's house. It takes an average of 6 seconds to retrieve. This histogram has ~5000 data points. There are quite a number of cases in excess of 20 seconds. As such, it is not unusual to have quite a delay once in a while.

Having said that if the long delay is happening all the time, then it is something to be investigated.

image

Appreciate it. My average time seems to be slightly longer (±10s) with it almost never taking less than 5 seconds. If this is normal that's completely fine, just want to check if there is perhaps an issue. What I've noticed is when I click a light in the Homekit app, it takes about 6-7 seconds to show up in homebridge terminal (i.e. [Cmd4] Setting Kai Wall Lights On 0), but once it does show up in the terminal it takes about a second to actually turn the light on or off. Is this perhaps a network issue or something homebridge related, or is it completely normal?

Last thing is sometimes when I press a light in HomeKit app, it immediately flips back to its initial state but the actual light changes i.e. Kai Wall light is off IRL -- turn on Kai Wall Light using Homekit -- HomeKit shows Kai Wall Light as on for a second -- HomeKit shows Kai wall light is off -- ±5 seconds later Kai Wall light turns on IRL but HomeKit still shows it as being off. It then takes a few closes and opens of the HomeKit app for it to display the right state for the light. Really not sure what's happening here

kaim2000 commented 2 years ago

Seems letting the system sit for a bit helped it out -- response time is much, much quicker now. Still occasionally get the issue described previously though where the light state on HomeKit flips back to the original state but the light changes IRL, and every now and then HomeKit seems to get stuck on updating -- but once updated response time is very quick. Thanks so much for all the updates and effort

kaim2000 commented 2 years ago

@mitch7391 @uswong If you're ever in South Africa I'd love to invite you for a drink!

mitch7391 commented 2 years ago

@kaim2000 are your lights all sorted now? Thanks Ung Sing for helping out!

Seems letting the system sit for a bit helped it out -- response time is much, much quicker now.

Please keep us updated on how performance feels for you; these MyPlace systems are crazy huge vs the aircon only based systems and a lot of work has been done to optimise this the best we can. I do fear we are reaching the limits of what the current plug-in can handle with bash and may need to start learning some new skills to improve further in the future.

uswong commented 2 years ago

it takes about 6-7 seconds to show up in homebridge terminal (i.e. [Cmd4] Setting Kai Wall Lights On 0), but once it does show up in the terminal it takes about a second to actually turn the light on or off

The 6-7 seconds delay in this case is due to Cmd4 which at the moment is beyond our control. Cmd4 is a layer between our AdvAir.sh shell script and your iPhone. The moment the setting command appears on homebridge terminal that is when our shell script takes over.

when I press a light in HomeKit app, it immediately flips back to its initial state but the actual light changes i.e. Kai Wall light is off IRL

I experienced that myself before but I have not seen that phenomena for a while now. Try changing the queueType to WoRm2. That is what I am currently set to.

image

mitch7391 commented 2 years ago

Try changing the queueType to WoRm2. That is what I am currently set to.

We have been through so much in this change feature that I forgot about WoRm2 and should update the config to reflect that!

ztalbot2000 commented 2 years ago

Hi all,

I looked over the changes made since my last look. Sorry, my health is extremely poor and you never know what you will get.

Anyway I'm happy with it all. I do have one question though. AdvAir.sh used to be able to handle the characteristic TemperatureDisplayUnits. It is no longer there. Have you decided to do something else with it? I know it was hard coded as Celsius.

I noticed there are still the few Unit Tests left. Again depending on how I feel, I will have a look.

ttyl, John

On Sat, Feb 19, 2022 at 11:19 PM Mitch Williams @.***> wrote:

Try changing the queueType to WoRm2. That is what I am currently set to.

We have been through so much in this change feature that I forgot about WoRm2 and should update the config to reflect that!

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

mitch7391 commented 2 years ago

Hey John,

TemperatureDisplayUnits has been removed from the script as it is not needed there (or never has been). As it is not polled or calling for anything in the script, it can just be set in the config.json only as a cached constant. I had been meaning to ask if you it would break our unit tests if I just remove the test files for it.

mitch7391 commented 2 years ago

Another issue has been found today on the beta that Ung Sing and I have been able to confirm. If more than one zone is turned off at the same time (via Siri or scene or automation), it will open your constant zone (typically z01) to 100%. We are looking into the cause/fix and will push out as the next beta bump when we figure it out.

uswong commented 2 years ago

Ok, let me have a closer look and will let you know.

ztalbot2000 commented 2 years ago

Hi All,

I suspected it was removed. If you poll for it in your config.json, it will break AdvAir. I can comment out the tests. If there is a real query to get the temperatureDisplayUnits, this would be even better.

I am now looking at AdvAir.sh Set Fan On 1 192.168.0.173 TEST_ON The response used to be "Setting url: http://192.168.0.173:2025/setAircon?json={ac1:{info:{state:on,mode:vent,fan:auto}}} " It now returns: "Setting url: http://192.168.0.173:2025/setAircon?json={ac1:{info:{state:on,mode:vent}}}"

I need to know if this is the correct data to return. In other words, is AdvAir sending the right URL to the AirCon for a Fan

ttyl, John

On Sun, Feb 20, 2022 at 7:06 AM uswong @.***> wrote:

Ok, let me have a closer look and will let you know.

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

uswong commented 2 years ago

Hey John,

It now returns: "Setting url: http://192.168.0.173:2025/setAircon?json={ac1:{info:{state:on,mode:vent}}}"

Yes, that is the one.

uswong commented 2 years ago

If more than one zone is turned off at the same time (via Siri or scene or automation), it will open your constant zone (typically z01) to 100%.

Found the issue and have coded in some logic to resolve it.

The problem: The problem was a close succession of Get/Set commands if you are closing more than 1 zone at the same time. We need the Get command because we need to know the number of zones open, then decide whether it is safe to close the zone or not. Based on the API, when the aircon is set, the json file will only be available for retrieval in 4s. As such, if we have a Get/Set command and followed closely by another Get/Set command (probably < 1s), the json file retrieved will be empty, as such, the subsequent Set command will assume zoneOpen to be 0 which in turn trigger the opening of the constant zone and set it to 100%.

mitch7391 commented 2 years ago

Very good find and very nice work Ung Sing. John has a PR in at the moment to sort out more unit tests that still fail; but could I get you to create a PR for this fix after I have merged that? Thanks for sorting this one so quick :)

mitch7391 commented 2 years ago

I have merged John's PR Ung Sing; you should be good to go when you are ready.

uswong commented 2 years ago

Done.

mitch7391 commented 2 years ago

Merged, will test myself tonight after work and then publish it as v3.3.0-beta.4.

uswong commented 2 years ago

Sorry Mitch, I have done another PR. This will be it.

I have done some improvement to the code related to the multiple simultaneous zone closing:

If there are many zone-closing commands done within a very short period of time (<10 seconds), only one queryAirCon() will be called by the first zone-closing command, and the subsequent zone-closing commands will determine the zoneOpen from the zoneOpen.txt cache file instead of making more queryAirCon() calls. The calls to queryAirCon() will most likely fail anyway if they are done within a very short time.

mitch7391 commented 2 years ago

All good Ung Sing :) merged again!

mitch7391 commented 2 years ago

Your fix works unbeautifully Ung Sing; tested out with a few scenes and automations that close more than one zone at a time. I have published the next beta v3.3.0-beta.4 that contains this bug fix :)

kaim2000 commented 2 years ago

Hi All! Sorry for my absence, I've been quite sick the past two days. Will test the new beta version - I have not yet added my AC (just the lights so far), but once I do I will revert with feedback. So far lights are working brilliantly -- changing queue to WoRm 2 seems to have helped a lot!

kaim2000 commented 2 years ago

Hi All, Tried adding the AC and can see it on Homekit but it doesn't do anything on MyPlace i.e. turning on HomeKit doesn't turn on IRL or on MyPlace. I think this could have something to do with the fact that I have two aircon systems each with two zones (z01 and z02 for both). I just tried configuring it once for z01 and z02 in the hopes that it would work for at least one of the aircon systems but no luck. I'm attaching the config in case I've made a mistake. Please let me know if this is a mistake I've made with config or if its due to the dual aircon system.

{
                    "type": "TemperatureSensor",
                    "subType": "tempSensor1",
                    "displayName": "Dylan_Room",
                    "currentTemperature": 25,
                    "statusLowBattery": "BATTERY_LEVEL_LOW",
                    "name": "Dylan_Room",
                    "manufacturer": "Advantage Air Australia",
                    "model": "e-zone",
                    "serialNumber": "Fujitsu e-zone2",
                    "queue": "A",
                    "polling": [
                        {
                            "characteristic": "currentTemperature"
                        },
                        {
                            "characteristic": "statusLowBattery"
                        }
                    ],
                    "state_cmd": "'/usr/local/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh'",
                    "state_cmd_suffix": "z01 ${IP}"
                },
                {
                    "type": "TemperatureSensor",
                    "subType": "tempSensor2",
                    "displayName": "Kai_Room",
                    "currentTemperature": 25,
                    "statusLowBattery": "BATTERY_LEVEL_LOW",
                    "name": "Kai_Room",
                    "manufacturer": "Advantage Air Australia",
                    "model": "e-zone",
                    "serialNumber": "Fujitsu e-zone2",
                    "queue": "A",
                    "polling": [
                        {
                            "characteristic": "currentTemperature"
                        },
                        {
                            "characteristic": "statusLowBattery"
                        }
                    ],
                    "state_cmd": "'/usr/local/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh'",
                    "state_cmd_suffix": "z02 ${IP}"
                },
                {
                    "type": "Switch",
                    "displayName": "Dylan",
                    "on": "FALSE",
                    "name": "Dylan",
                    "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": "z01 ${IP}"
                },
                {
                    "type": "Switch",
                    "displayName": "Kai",
                    "on": "FALSE",
                    "name": "Kai",
                    "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": "z02 ${IP}"
                },
                {
                    "type": "Fan",
                    "displayName": "Fan",
                    "on": "FALSE",
                    "rotationSpeed": 100,
                    "name": "Fan",
                    "manufacturer": "Advantage Air Australia",
                    "model": "e-zone",
                    "serialNumber": "Fujitsu e-zone2",
                    "queue": "A",
                    "polling": [
                        {
                            "characteristic": "on"
                        },
                        {
                            "characteristic": "rotationSpeed"
                        }
                    ],
                    "state_cmd": "'/usr/local/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh'",
                    "state_cmd_suffix": "${IP}"
                },
                {
                    "type": "Lightbulb",
                    "displayName": "Aircon Duration",
                    "on": "FALSE",
                    "brightness": 0,
                    "name": "Living",
                    "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": "timer ${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/local/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/local/lib/node_modules/homebridge-cmd4-advantageair/AdvAir.sh'",
                            "state_cmd_suffix": "${IP} fanSpeed"
                        }
                    ]
                }
mitch7391 commented 2 years ago

Hey @kaim2000, I might get you to create a separate issue for this one as I don’t believe it is due to the beta; and we can help fault find for you there without distracting from the beta too much more :) I have had a user with two aircons once before in the early stages of this project, so I believe this should work only for your aircon 1 without the temp sensors so far. Iv got to get back to sleep for night shift but I’ll take a look this evening for you.

ztalbot2000 commented 2 years ago

I don't know if any of you got my last email. Sending stuff through GitHub seems precarious. Here it is anyway:

Hi,

I still don't understand the problem and how it can happen. If Cmd4 executes a "Set" command, there is no possible "Get" by Cmd4, before or after; because of WoRm and "WoRm2"

The next HomeKit "Get" in WoRm will be directly from the device. Your Cached file though returns possibly old data of the last 2 minutes. The next HomeKit "Get" in WoRm2 will return whatever state Cmd4 knows of it, Which could have been previously "Set". A polled "Get" will always return what's your cached file has in the last two minutes.

It seems that following all "Set" commands, you should update the systemData so the next "Set" or "Get" has correct data to work with. Or even better, All "Set" commands need to do a getSystemData before and after. No 4 seconds required.

I will see what your latest solutions entail.

Ttyl, John

To that end I created a branch b_zBeta in my repo that solves this. If we had more unit tests against the other features, I could test against it.

What is nice about getting the systen]mData on every "SeT, which really does not happen often, is that the data is now correct for "Gets" and no need to create a separate ID file.

I wish I could test more. I have only the unit tests to go by. I need your help otherwise.

Ttyl, John

On Mon, Feb 21, 2022 at 9:16 PM Mitch Williams @.***> wrote:

Hey @kaim2000 https://github.com/kaim2000, I might get you to create a separate issue for this one as I don’t believe it is due to the beta; and we can help fault find for you there without distracting from the beta too much more :) I have had a user with two aircons one before in the early stages of this project, so I believe this should work only for your aircon 1 without the temp sensors so far. Iv got to get back to sleep for night shift but I’ll take a look this evening for you.

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

kaim2000 commented 2 years ago

@mitch7391 Cool no problem - can see how its unrelated.

One thing which I think might be of interest is with the Garage door. I've added my driveway gate which was installed using the garage module (this one was installed the right way around i.e. MyPlace indicates closed when the gate is closed). Since the update obviously my garage which was installed the wrong way around shows open when closed, but I'm fine with that and know about the fix (at this point its just a question of deciding if I want the gate or garage to display correctly). However, the issue is if I'm opening my Gate in the Home App and then press the button to make it stop opening, the state goes weird and keeps saying "opening". Then if I press it again to start closing the gate, half of the time it starts closing and the other half it starts opening further. Then when it does eventually close, Home App still shows "opening" and after about 3/4 seconds of the gate being closed it actually starts to open again. Had to remove it and re add it to my config file when that happened because I couldn't get the gate to stay closed. I'm really not sure if that's an issue with your plugin or with MyPlace, but just thought I should let you know. sorry if I described the situation poorly.

mitch7391 commented 2 years ago

Sorry for my absence, I've been quite sick the past two days.

Hope you are feeling better, missed this one before!

One thing which I think might be of interest is with the Garage door. I've added my driveway gate which was installed using the garage module (this one was installed the right way around i.e. MyPlace indicates closed when the gate is closed). Since the update obviously my garage which was installed the wrong way around shows open when closed, but I'm fine with that and know about the fix (at this point its just a question of deciding if I want the gate or garage to display correctly).

That is really frustrating that Advantage Air has messed this up. We could get around this with the little software constant we could add for flip to flip the logic. You could have it set on one and not the other. Cool you have your gate added, as a garage door; I thought we might need to add a gate as something separate in HomeKit.

However, the issue is if I'm opening my Gate in the Home App and then press the button to make it stop opening, the state goes weird and keeps saying "opening". Then if I press it again to start closing the gate, half of the time it starts closing and the other half it starts opening further. Then when it does eventually close, Home App still shows "opening" and after about 3/4 seconds of the gate being closed it actually starts to open again.

This, I believe is a HomeKit issue as I have a garage door added through Remootio and it only has a reed senor on one end. If the sensor is met, it is closed, if the sensor is not met, then it is assumed open. From what I saw on Advantage Air's website they use the same. So meaning we only know it is a position 100% or position 0% and HomeKit can handle garage doors that give percentage open feedback for doors that are partially open. My garage door through Remootio had the exact same issue when my wife panicked and hit the open/close button many times and it got stuck in some weird mode and we had no idea (as we were not home) of the garage door was open or not. It stayed like this until I rebooted the plugin for it.

Had to remove it and re add it to my config file when that happened because I couldn't get the gate to stay closed. I'm really not sure if that's an issue with your plugin or with MyPlace, but just thought I should let you know. sorry if I described the situation poorly.

Next time I would say careful not to hit the button more than once from HomeKit and if it does get stuck like this, reboot the child bridge for cmd4 if you have child bridges set up or restart Homebridge itself. You shouldn't need to go as far as you did with removing the config. Lucky I had this same issue as you with my Remootio garage door or I may have been confused lol

mitch7391 commented 2 years ago

Just double checked and found HomeKit does not have a separate accessory icon for a 'gate' and uses the 'garage door opener'; guess we can say we inadvertently added gate support lol

kaim2000 commented 2 years ago

Thanks Mitch. Do you know where I would insert the flip? If you could point me to the line number if in the Advair.sh file or where in the garage door config.

This, I believe is a HomeKit issue as I have a garage door added through Remootio and it only has a reed senor on one end. If the sensor is met, it is closed, if the sensor is not met, then it is assumed open. From what I saw on Advantage Air's website they use the same. So meaning we only know it is a position 100% or position 0% and HomeKit can handle garage doors that give percentage open feedback for doors that are partially open. My garage door through Remootio had the exact same issue when my wife panicked and hit the open/close button many times and it got stuck in some weird mode and we had no idea (as we were not home) of the garage door was open or not. It stayed like this until I rebooted the plugin for it.

Thanks, makes sense. I will just advise everyone in the house not to use the HomeKit app to stop/start the gate mid open/close. Should be fine then.

kaim2000 commented 2 years ago

Hey @kaim2000, I might get you to create a separate issue for this one as I don’t believe it is due to the beta; and we can help fault find for you there without distracting from the beta too much more :) I have had a user with two aircons once before in the early stages of this project, so I believe this should work only for your aircon 1 without the temp sensors so far. Iv got to get back to sleep for night shift but I’ll take a look this evening for you.

@mitch7391 Do I just create a new thread in issues? No rush on this, but might as well add it if that's good.

mitch7391 commented 2 years ago

Thanks Mitch. Do you know where I would insert the flip? If you could point me to the line number if in the Advair.sh file or where in the garage door config.

It is not something we have added yet but can do without too much trouble I believe. We can push it as another beta update. Also the solution to edit your script like you have done applies that change to both your gate and garage door at present. Once we change the logic to include a flip, it would require a small config change on the one that needs flipping and no script changes for you. Leave it with us!

Thanks, makes sense. I will just advise everyone in the house not to use the HomeKit app to stop/start the gate mid open/close. Should be fine then.

Yeah I know that sucks, but seems to be a limitation through HomeKit for the type of gate/garage door.

Do I just create a new thread in issues? No rush on this, but might as well add it if that's good.

Just go to the 'issues' tab above and click the green 'new issue' and select the type you think it best falls under. We can get started on a fault finding process for you there and see if we can get you sorted.

ztalbot2000 commented 2 years ago

Hi all,

I can say that there is no specific line number in Cmd4 that will help you. Cmd4 works off of a table of characteristics and another for devices. Mucking with one mucks with them all for getValue.

I think I understand your predicament though. It might require a bit of McGyvering to get around. I'll have to think about it some more.

Ttyl, John

Sent from Zarf’s iPad Air 2

On Feb 22, 2022, at 9:06 AM, Mitch Williams @.***> wrote:

 Thanks Mitch. Do you know where I would insert the flip? If you could point me to the line number if in the Advair.sh file or where in the garage door config.

It is not something we have added yet but can do without too much trouble I believe. We can push it as another beta update.

Thanks, makes sense. I will just advise everyone in the house not to use the HomeKit app to stop/start the gate mid open/close. Should be fine then.

Yeah I know that sucks, but seems to be a limitation through HomeKit for the type of gate/garage door.

Do I just create a new thread in issues? No rush on this, but might as well add it if that's good.

Just go to the 'issues' tab above and click the green 'new issue' and select the type you think it best falls under. We can get started on a fault finding process for you there and see if we can get you sorted.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

uswong commented 2 years ago

Just double checked and found HomeKit does not have a separate accessory icon for a 'gate' and uses the 'garage door opener'; guess we can say we inadvertently added gate support lol

Anything that has a UpDown LeftRight movements are under the categroy things, so garage, gate, blinds, etc are all supported.

@kaim2000 since you have a gate which is configured correctly by AdvantageAir, then it is not good to change the code as I have suggested before, as the same code is used by your garage and your gate and also your blinds if you have blinds. Like what @mitch7391 suggested is that we can put in some logic to flip it as per device via a constant in state_cmd_suffix in the config file.

uswong commented 2 years ago

Like what @mitch7391 suggested is that we can put in some logic to flip it as per device via a constant in state_cmd_suffix in the config

quoting myself haha...

The more I think about it, the more compiling I feel we should just add a few lines of code in AdvAir.sh to do it. The installers are human and can make minor mistakes like that and if we have a easy way out, why not just do it! If the installer comes back and fixes it, all we need to do is to change our config!

mitch7391 commented 2 years ago

Anything that has a UpDown LeftRight movements are under the categroy things, so garage, gate, blinds, etc are all supported.

Yep that is correct, I was thinking more from the Homebridge API side of things with what characteristics need to be added to the script. There is actually no accessory for Gate, so it seems all developers just use the Garage Door Opener and therefore the same characteristics are used. Blinds will use the Window Covering accessory which has slightly different characteristics that would need to be added to the script.

The installers are human and can make minor mistakes like that and if we have a easy way out, why not just do it! If the installer comes back and fixes it, all we need to do is to change our config!

My thoughts exactly! :p

uswong commented 2 years ago

Blinds will use the Window Covering accessory which has slightly different characteristics

Yes, that's right! not too hard to add it.

My thoughts exactly! :p

I have actually done it! :) I will do a PR later today or tomorrow to let @kaim2000 try it out.

mitch7391 commented 2 years ago

Next version v3.3.0-beta.5 has been released. The two features added by Ung Sing are as follows:

kaim2000 commented 2 years ago

@mitch7391 @uswong Thanks for the updates! Garage Flip works brilliantly, and the AC update is working perfectly as well! Absolutely amazing.

kaim2000 commented 2 years ago

Now I might have another challenge for you... We have 2 advantage air setups in our house! One runs on the tablet I've been configuring, and another runs on a separate tablet (the other system just controls 2 additional AC's). I tried adding the other tablet as a 2nd platform but homebridge gave me errors about having two cmd4 platforms defined... Do you think it's possible to run both of the AdvAir tablets on one homebridge setup?

kaim2000 commented 2 years ago

Possible issue with the garage door flip -- it worked fine at first, saying that the door was closed when it was, but now about 20m later I got a notification on my phone saying "Garage Door Opened", even though it wasn't. Now when I check on Home App it says Garage Door is open whilst its closed..

uswong commented 2 years ago

Do you think it's possible to run both of the AdvAir tablets on one homebridge setup?

Unfortunately I don't think so. You will need to have a second homebridge running on a different machine.