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
Venetian blind support for proprietary Fibaro FGRM-222 Roller Shutter devices #24405
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as its been labeled with a integration ( This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people. |
6a25e98
to
45d02d9
Compare
Awesome, looking forward so much for this to land 🎉 |
I propose to make it configurable. Hardcode to a default of 99 or 50 (49?), and let the user be able to configure an override. Somebody other than us might have a third opinion about what open means, we never know. Even in my case I might use this feature to set "open" to around 90, because fully open allows the light to bounce off the slat and directly into my eye in some situations, which is inconvenient. Whereas a very tiny downwards angle already prevents that but still has the "open" feeling. Because of that, I would be fine with whatever hardcoding you go for. |
OK, I added a parameter (see config example above). |
Thanks for the update! For lack of pushing rights to your branch, leaving this diff here (should be better readable than text comments in this case): diff --git a/homeassistant/components/zwave/cover.py b/homeassistant/components/zwave/cover.py
index 3542df9..b1fe772 100644
--- a/homeassistant/components/zwave/cover.py
+++ b/homeassistant/components/zwave/cover.py
@@ -2,7 +2,7 @@
import logging
from homeassistant.core import callback
from homeassistant.components.cover import (
- DOMAIN, SUPPORT_OPEN, SUPPORT_CLOSE, ATTR_POSITION)
+ DOMAIN, SUPPORT_OPEN, SUPPORT_CLOSE, ATTR_POSITION, ATTR_TILT_POSITION)
from homeassistant.components.cover import CoverDevice
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import (
@@ -252,17 +252,17 @@ class FibaroFGRM222(ZwaveRollershutter):
else:
# Limit the range to [0-99], as this what that the ZWave command
# accepts.
- tilt_position = max(0, min(99, kwargs.get(ATTR_POSITION)))
+ tilt_position = max(0, min(99, kwargs.get(ATTR_TILT_POSITION)))
_LOGGER.debug("setting tilt to %d", tilt_position)
self._value_tilt.data = tilt_position
def open_cover_tilt(self, **kwargs):
"""Set slats to horizontal position."""
- self.set_cover_tilt_position(position=self._open_tilt_position)
+ self.set_cover_tilt_position(tilt_position=self._open_tilt_position)
def close_cover_tilt(self, **kwargs):
"""Close the slats."""
- self.set_cover_tilt_position(position=0)
+ self.set_cover_tilt_position(tilt_position=0)
def set_cover_position(self, **kwargs):
"""Move the roller shutter to a specific position. My tests:
|
I applied the patch @andre-richter supplied. I can't test this right now... |
@home-assistant/z-wave, I have independently verified the functionality of this PR on my Fibaro controllers. The code works for @ChristianKuehnel as well, hence two real-life tests in total. Feel free to start your review :) BR, |
@balloob, sorry to bother you on this one. It's not visible to us who is in the @home-assitant/z-wave group. Since it seems like this PR is getting little attention, wanted ask you if you could ping/delegate somebody for review or tell us who to talk to? Thanks, |
Pinging again since this is now over two weeks old. @dmulcahey @Adminiuga please let us know how we can help you to drive this to closure. Thanks, |
@ChristianKuehnel can you please rebase it? showing conflicts with the current dev. |
59f380a
to
926a8c2
Compare
I just squashed the changes and rebased them on dev. |
I don't have a lot of experience in the zwave quirks/workarounds or covers, but the python looks fine to me. I can't speak for the required openzwave patch though. |
I would argue that QA/review on this one has already been done by the openzwave guys themselves, since the respective patch is already upstream in openzwave master. |
Ping =/ Guys believe me I am not comfortable nagging here all the time. But we still got no idea who would be responsible for zwave code in the homeassistant team at the moment. I tried to ping @pvizeli on the corresponding zwave patch but he seems busy. Best, |
self._open_tilt_position = 50 # type: int | ||
if open_tilt_position is not None: | ||
self._open_tilt_position = open_tilt_position | ||
_LOGGER.debug('open_tilt_position: %s', open_tilt_position) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want side effects, eg logging, in init method.
@MartinHjelmare I just removed the init statement. So the rest is fine and can be merged? |
Someone that knows the zwave integration should review here. |
@MartinHjelmare Could you do us a big favor and reach out in your internal channels who currently owns this? We tried to ping all people that, from the outside, looked responsible, but no luck so far in finding someone who wants to own this. Thanks a lot, |
Rebased on top of 0.98.1: https://github.com/andre-richter/home-assistant/tree/0.98.1_fibaro_222_tilt |
I think we should close this PR, since it depends on another PR that hasn't been merged yet. If the dependency is merged a new PR can be opened. |
Any chance to get more traction on the other PR? Its been ignored for 3 months straight now :( And it's not even a complicated patch that needs much review, because it is just a cherry-pick from the master open-zwave repo where the code has been reviewed by open-zwave maintainers and is merged already. |
Still can't speak for the HA ozw1.4 fork, but I'm in the process of updating the HA zwave component for OZW1.6 which should re-align HA with the OZW master. Downside is I'm still a few weeks out most likely from having the updated component ready to go. |
Let's close this for now. As soon as the library is ready we can accept this again. |
1.6 sounds good. Let's wait for that 👍 |
The library changes was just merged: home-assistant/open-zwave#6 Not sure if we need to wait for a release or if the master branch is being used... |
The Fibaro FGR-222/FGRM-2222 ZWave roller shutter devices have a proprietary command class to support setting the tilt angle of venetian blinds (= type of window cover). This PR adds the support to HA for this. This allows the user to set the height of the blinds and the tilt angle separately. Original patch by @ChristianKuehnel #24405.
Breaking Change:
Should not break anything
Description:
The Fibaro FGR-222/FGRM-2222 ZWave roller shutter devices have a proprietary command class to support setting the tilt angle of venetian blinds (= type of window cover). This PR adds the support to HA for this. This allows the user to set the height of the blinds and the tilt angle separately. It can be used to create nice scenes, e.g. blinds down and angle at 30% so that there is still some light coming.
Related issue (if applicable): fixes #
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: