Closed TimofeyK closed 4 years ago
Hey @TimofeyK đź‘‹
Thanks for raising the feature request.
So I initially tried to have the fan service map the fan mode but that wasn't working great, because then the fan speed for the heater/cooler could no longer be controlled (the Home app won't show the fan speed slider if another service implements the fan speed characteristic for the same accessory).
So eventually my final solution is to have 4 services showing as grouped accessories in the Home app, with:
I have done some testing and everything seemed to work fine (I had to do some major refactoring of the code but that was expected).
I will publish a new version with that new feature tonight on npm
(I'll update this ticket when done).
Then it would be great if you could give me your feedback about that new version!
Wow! I thought you probably haven’t even see the request and turned out you already redesigned the whole plugin! :)
I will try it as soon it’s available via npm
Alright, @TimofeyK I just released version 1.2.0
of the plugin including these changes.
Have a try and let me know if that works as you expect.
đź‘Ť
Hey @yenoiwesa This works beautifully! I installed last night and played with modes for a while. Can't break it so far :-)
A separate Fan Speed accessory was a bit confusing at first but then I realised that its On/Off action is essentially the same as physical On/Off button on the aircon controller - it turns on last used mode. I like this solution, very logical!
I'd probably name Heater/Cooler accessory "Heat / Cool" or "Heat & Cool" because Home app shows long name as "Heating &..." on Favourite accessories page (one line is used for room name so accessory name can't wrap to the next line)
@yenoiwesa I saw this twice but can’t replicate it at will
Exactly the same happened when turning Dry mode while Cooling was on
@TimofeyK I had this issue a few times and then I was completely unable to reproduce it again somehow, after restarting the homebridge server.
I think it is caused by a race condition. The problem with dealing with multiple accessories, and in particular the Heater/Cooler one, is that Siri sends request to set the state of these accessories when opening the detailed view. I try to do my best to catch all these requests and accumulate them to send just one cohesive state change to the daikin airbase, but (and this is my best guess) I assume sometimes it escapes the time limit of the debouncing?
If you manage to find a pattern that reproduces this issue consistently, please do let me know. I never had the issue when operating the aircon through Siri though, so for me it's not really a deal breaker.
As per the names, are you able to edit them directly from the Home app? (maybe after ungrouping them?) Each service supports the Name
characteristic.
If not, I might change the names as you suggest.
I only seen this twice and both times I switched between Cool, Fan and Dry several times within few minutes but no any certain pattern
I can rename of cause. What I meant is the default name. Not a big deal anyway
@TimofeyK I published a new patch release that includes the name change as you suggested.
Regarding the bug, I think I found the cause of the issue: Sometimes (I don't know when or why exactly), when the state of the Heater/Cooler changes without a user interaction on that service (say when it is turned off because you enabled Fan mode), the Home app will send a request to the accessory to set that state again (the state it is already in). But since the state is off it sends a request to turn off heater cooler. I was catering for that case by making sure to only send that request if it is in heat or cool mode, but due to a timing issue, the airbase still has the previous value (the airbase takes some time to refresh its values after a set).
So I will have to change my promise caching mechanism to be able to force a cached value I guess, with the value I set previously. I'll be working on that!
I installed the update and so far it’s working perfectly. Wasn’t able to break it
Noticed a tiny UI inconsistency which I wouldn’t bother fixing. Writing it up just in case you’ll be bored one day :)
Changing Fan speed slider to 0% turns off the aircon. When you turn it on again the speed is still shown as 0% until values are re-read from the airbase controller
@TimofeyK I just released v1.2.3
which contains the bug fix for the Dry/Fan mode turning off after turning it on from cool mode (phew..).
Now, I just tested the second bug you described above and... I can definitely reproduce. Homekit is killing me lol, it turns out that mapping multiple accessories to just one physical device is not that easy. I'll have a look at it when I have a chance, but since it is purely cosmetic (unlike the Dry/Fan mode one) I might decide to leave it as is.
Thanks again for your help!
@TimofeyK I finally found the cause of the issue with the inconsistent fan speed rotation. Homekit is picky and refuses to have a fan inactive with a fan rotation speed other than 0. Everything works fine when that happens but the display in the Home app 🤷‍♂
I fixed the issue in release 1.2.4
. Try it out and let me know.
Hopefully everything is good and I can close this issue :-)
What can I say @yenoiwesa I think it’s too perfect. Let’s close the issue before we break something :)
@TimofeyK nice! I'll close it quickly then!!! hehe
Hey Matthieu! Thank you for such great quality plugin. It's superior to my Cmd4/bash integration so I am switching to your work :-)
There are a couple of options missing so far and Fan mode support is one of them
With HomeKit not supporting Fan mode directly the only solution I found is to create a separate Fan accessory
When Fan accessory is turned On the HeaterCooler changes to Off state and vice versa
I used this approach in my script and it worked well with the only issue that when you turn devices On in Home app the other one will not refresh and shown as On until HomeKit will query it again. With a single proper plugin this should work better
Fan service supports RotationSpeed characteristic so I think the code for that can be reused
It would be great if you add this