-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle URL #28
Comments
Not sure I understand why this would be needed @genfersee ? Maybe you can describe your use case a bit better. I don't see an issue putting the same URL for both up and down if you only have a toggle option? Your suggestion gets very complicated though because up and down are not exactly how the blinds work on HomeKit. It just requests a value 0-100 for blind position... so what happens with toggle if the value is 50? Anyway, let me know your thoughts. |
Hi @dxdc ! :)
The toggle command sends the contrary of the last command send:
My usecase is that I have a programmable homekit stateless button. I want to link the toggle URL to this button to have:
Hope it helps :):) |
Maybe I'm missing something, but doesn't Homekit already do this? Just click on the blinds button.
Thinking about this some more though, if this feature was added, it won't work with your approach unless the plugin creates this stateless button (similar to the stateless 'stop' button that can be optionally exposed). So, then you are proposing it would just track whatever the last command is and send the opposite, right? |
Or, would it send the toggle_url you have provided? I guess either way, the button needs to be exposed by this plugin. |
Yes, exactly like the secondary stop button: your plugin would create another secondary toggle button, calling the toggle url we would define in config.json. Then,
When setting some action for my stateless programmable button in Homekit interface, I have to set an accessory. Currently, I can only choose "blind up", "blind down" or "blind stop". But I need this "blind toggle" secondary button... |
I meant, why is a toggle button even needed? Isn't the "built-in toggle" of up/down with the existing Homekit button sufficient? Or, is there some other use you're proposing? |
Let me show you the interface I have to setup my stateless programmable button. So what I would need is a toggle button as shown below (currently made via another plugin). Hope it helps :) |
@genfersee I had some time to think about this idea. I realized there is a fundamental problem with the described concept that conflicts with the nature of the plugin. If we expose a button for a separate toggle URL, the plugin will completely lose track of the blind position. Because, we have no knowledge whether the toggle URL will be taking the blinds up or down. This will disrupt the position of the blinds within HomeKit. Furthermore, the other standard functionality (sending stop commands, etc.) wouldn't be available. So, an alternate approach would be to expose a button and let the plugin decide whether to send the up or down command. This could be done by recording which command was sent last (up or down) and sending the opposite command. I'm not sure how popular of an idea this would be though or if it would fit your use case. I think the functionality you're after might be best implemented within Node-RED. There are several HomeKit plugins for Node-RED that I think would allow you to take advantage of the functionality you're looking for and design the correct logic for your use case. For example, you could create a switch that would either send the "up" or "down" command to the blinds based on their current position, time of day, etc. |
Thanks for your answer! I understand the design issue. |
@genfersee OK, I've enabled this feature. Hopefully it will be useful to you! Please see the instructions. Essentially, you'll need to do the following:
Please give it a try and let me know your feedback. |
Hi @dxdc, I have just installed the 1.3.10, and configured config.json as follow:
I have the following error logs: [2020-2-10 7:39:40 PM] Error: Cannot add a Service with the same UUID '00000049-0000-1000-8000-0026BB765291' as another Service in this Accessory without also defining a unique 'subtype' property. |
Hmm. I didn't test the stop and toggle buttons together. Maybe some minor issue there, will correct it. In the meantime, try disabling the stop button and just testing the toggle functionality:
|
@genfersee Just added the missing subtype (I believe). Try: |
@dxdc, |
I see now a small issue:
|
@genfersee I made a number of minor changes to the code that I'm hoping will help with stability within HomeKit and reflecting the correct values. I also changed the way the toggle functionality works that I think is superior. Please update again and test. |
@dxdc this works really great now! I always get a consistent state in main blind icon! I noticed however a strange behavior: [2020-2-11 8:04:03 AM] [Bureau Sud] End Move down (to 59%) |
After a whole reboot of the Pi, I see a strange issue. Before restarting it, when I tested, everything was going ok (except the log I sent just before). Now, when I press either the main blind button, the stop button or the toggle button, they all remains in "ON" state forever until I tap a second time on them. Before, the stop and toggle button were returning to "OFF" state right after tapping, and the blind main icon was waiting for move duration timetout to change state, which was correct. Now this does not work anymore. For example: case where blind is up, blind main icon is showing "ON" and "up", stop and toggle icons are "OFF". I restarted homebridge process and it works fine. ... but issue from my previous post is still present ;) |
@genfersee I saw these issues too and believe I've rectified them. This includes this issue, which I have seen too:
I'm still waiting for some additional testing on another issue, but for now, you can download/manually patch your version for now if you like and report back! I'm hoping I can push this as a new release this week. Appreciate your reporting. https://raw.githubusercontent.com/zwerch/homebridge-blinds/master/index.js |
@dxdc I won't have access to the Pi today, so I will wait your next official release! |
Released. Please open a new issue if you still experience issues. |
@dxdc Thnks for this major release, I will test it over the weekend and let you know! |
Hi @dxdc! After some testing, everything seems to be fixed and works properly, this is really great, thank you so much for your help! |
... and I will be glad to offer you a beer if you have a Paypal account! ;-) |
Sure that would be appreciated! :) You could send it here.. |
@dxdc sent! Thanks again for this custom development! |
Thank you! |
Hello,
I have some Somfy blinds. Would it be possible you add some parameter to enter a « toggle_url »? Then I could avoid to install an extra plugin to add buttons for toggle url.
Thanks in advance!
The text was updated successfully, but these errors were encountered: