-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Basic implementation of Zwave Rollershutters #2313
Conversation
@@ -92,6 +93,10 @@ | |||
[COMMAND_CLASS_DOOR_LOCK], | |||
TYPE_BOOL, | |||
GENRE_USER), | |||
('rollershutter', | |||
[COMMAND_CLASS_SWITCH_MULTILEVEL], |
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.
Doesn't this mean that all multilevel switches will be forwarded to the rollershutter component ?
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.
No, it get filtered by the next two arguments. The index type and genre.
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.
Type_whatever and genre_whatever would have forwarded all multilevel switches.
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.
Ofcourse untested 🙏 , neither of us have that combination.
Anyone that do have a dimmer and a rollershutter device that can test?
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.
Are there any other ways to channel this correctly. I see there will be problems with identifying devices correctly to the correct component. I understood the code as this:
If command class is switch multilevel AND the command class contains a type with button AND the type has genre with user, it will be detected as rollershutter.
Or have I misunderstood this? Open for suggestions :)
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.
I got time to add your changes. Thank you @wokar 👍
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.
@wokar Is there a list somewhere that we can use to find what specific command class is mapped to which number?
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.
@turbokongen For the zwave constants I use the openhab project as a reference - the ZWaveCommandClass.java contains the mapping you want.
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.
Yes, that list I am aware of, but the specific class is what I am interessted in. In this case MOTOR_CONTROL_CLASS_B is 6. Is there a list that those mappings are available?
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.
Soooo.... we need to fix test coverage for other things too now to pass? 😄 |
3c37f6a
to
ca05cc9
Compare
Looks good! 🐬 |
@turbokongen my raspberry crashed on the weekend so I could not test your solution with my Fibaro rollershutter. Now I got the raspberry up and running again and my zwave devices are working fine, but the rollershutter seems not to work at all with the current code :( |
I don,t have the device myself, but I had @nunofgs who does have it, help me with the testing. |
I have discovered a flaw in the discovery code, can you try with my latest: |
Last night I figured out that the if-statement: if specific_device_class is not None and \
specific_device_class != node.specific:
continue is the problem. Since the specific_device_class is now a list I changed it to: if specific_device_class is not None and \
node.specific not in specific_device_class:
continue After that change the rollershutter showed up, but I could not control the device from the UI. I will continue testing and open a PR with my changes. |
Just download the changes I made now :) |
MAde a mistake in the code try latest. |
Ugh... Not working. |
Please test latest. https://github.com/turbokongen/home-assistant/tree/zwave_garagedoor |
Did a bit of cleanup of the rollershutter code, take a look at https://github.com/wokar/home-assistant/tree/zwave_rollershutter Rollershutter works fine now, execpt for the stop button. It did work the first time, but now ot is ignored or it changes direction. I also tested your component discovery and it I had to add GENERIC_COMMAND_CLASS_BINARY_SENSOR to the 'sensor' platform to get my fibaro motion sensor working. I also changed the *_WHATEVER entries to be not in a list, otherwise the |
Was too tired yesterday to spot my mistakes. Please test latest :) |
Please try the latest at: Hopefully all will be good now :) My zwave network atleast looks like it did before. |
Perfect! All my devices show up and work as expected. |
:+1 |
@turbokongen Hi again! I just tested the latest changes in your zwave_garagedoor branch, and almost everything works as expected, except the I changed the following and everything is working perfectly: diff --git i/homeassistant/components/rollershutter/zwave.py w/homeassistant/com
index 50ef2ed..60fa1fe 100644
--- i/homeassistant/components/rollershutter/zwave.py
+++ w/homeassistant/components/rollershutter/zwave.py
@@ -61,11 +61,11 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, Rollershut
def move_up(self, **kwargs):
"""Move the roller shutter up."""
- self._node.set_dimmer(self._value.value_id, 0)
+ self._node.set_dimmer(self._value.value_id, 100)
def move_down(self, **kwargs):
"""Move the roller shutter down."""
- self._node.set_dimmer(self._value.value_id, 100)
+ self._node.set_dimmer(self._value.value_id, 0)
def stop(self, **kwargs): |
I fixed this issue last night in a different branch. It is already merged,
|
Oooooo!!! This is rollershutter. Wil issue a fix right away! |
Replaced by cover component. |
Description:
Basic Implementation for Zwave Rollershutter devices.
This also blocks tested rollershutter device from switch and light.
This is only tested with Fibaro FGRM-222 rollershutter device, and should be considered a basic implementation. For the future, other devices may need to be added for blocking.
Thank you @nunofgs for providing the information to make this possible, testing and debug. 👍
Thank you @wokar for providing code for better filtering. This will make future filtration easier. 👍
Related issue (if applicable): fixes #
#2053
Checklist:
If code communicates with devices:
tox
run successfully. Your PR cannot be merged unless tests pass