home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.54k stars 29.91k forks source link

Using Fibaro FGR222 in ventian Blind Mode is not responding correct values #115632

Open skipper2020 opened 5 months ago

skipper2020 commented 5 months ago

The problem

Hello, I use several Fibaro fgr222 roller shutter modules in venetian blind mode. In the module you can only set whether it reports changes to the standard value (multilevel switch), but then only the position value of the blind and not the opening angle of the slats. Or it can report to the manufacturer's proprietary attribute with both values (Property 145). When the module is configured to report to the proprietary attribute it works for reporting the opening angle of the slats, but not for the position of the blinds. I looked at the adjustments in discovery.py. There is an adjustment, but the value for the primary value does not match the attributes in the MANUFACTURER_PROPRIETARY Class. I tried to adapt the code, but since I'm not a Python developer it doesn't seem to work and I need help here. I have already successfully created an adjustment to detect whether the module is running in Venetian blind mode. See my code after the text.

Best regards Timo

Part of the discovery.py

ZWaveDiscoverySchema(
        platform=Platform.COVER,
        hint="shutter_tilt",
        manufacturer_id={0x010F},
        product_id={0x1000, 0x1001},
        product_type={0x0301, 0x0302},
        primary_value=ZWaveValueDiscoverySchema(
            command_class={CommandClass.MANUFACTURER_PROPRIETARY},
            property={"fibaro"},
            property_key={"venetianBlindsPosition"},
            endpoint={0},
            type={ValueType.NUMBER},
        ),
        data_template=CoverTiltDataTemplate(
            current_tilt_value_id=ZwaveValueID(
                property_="fibaro",
                command_class=CommandClass.MANUFACTURER_PROPRIETARY,
                endpoint=0,
                property_key="venetianBlindsTilt",
            ),
            target_tilt_value_id=ZwaveValueID(
                property_="fibaro",
                command_class=CommandClass.MANUFACTURER_PROPRIETARY,
                endpoint=0,
                property_key="venetianBlindsTilt",
            ),
        ),
        required_values=[
            ZWaveValueDiscoverySchema(
                command_class={CommandClass.CONFIGURATION},                                      
                property={10},                                                                  
                endpoint={0},                                                                    
                value={2},
            )
        ],
    ),

What version of Home Assistant Core has the issue?

core-2024.4.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Z-Wave JS

Link to integration documentation on our website

https://github.com/home-assistant/core/tree/dev/homeassistant/components/zwave_js

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 5 months ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zwave_js` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zwave_js` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zwave_js documentation zwave_js source (message by IssueLinks)

MartinHjelmare commented 5 months ago

Please download diagnostics of your Z-Wave device and attach it as a text file here by dragging and dropping the file in a comment.

The diagnostics tool is available by clicking the three dots menu of the Z-Wave device in the device page in the Home Assistant GUI.

Thanks!

skipper2020 commented 5 months ago

Here you have a diagnostic file of one of my fgr modules they are all the same firmware and all in the same configuration. zwave_js-32b45b91c71ede80825663ac98c3f313-Raffstore_2-d7352ff29f3e711cb7ca04c539e6fa96.json

MartinHjelmare commented 5 months ago

It's not clear what's not working in your experience. Please clarify that. I can see that the _target_position_value won't be set correctly in the entity with this combination of discovery template and cover entity. It expects to use a Multilevel Switch command class for cover position.

https://github.com/home-assistant/core/blob/b1bd9dc22cde0af241d217c2a36a773442fcb6b8/homeassistant/components/zwave_js/cover.py#L108-L110

skipper2020 commented 5 months ago

If the configuration property 10 is set to the value 2 (as in my case) then the module reports exclusively to the Manufactory Proprietary attribute of the device. However, if you choose a different configuration, you will not get the position of the slats and the blinds when you ajust them. In my opinion, discovery.py needs to be adjusted so that the primary value would be set by the manufacturer proprietary properties. There are two values in the property: "venetianBlindsPosit" which represents the position of the blinds and "venetianBlindsTilt" which represents the opening angle of the slats. This property has just the ability of set and don't differ between current and target value.

Hence my query as to how I can customize this so that I can test this configuration.

Thanks for the support. best regards

MartinHjelmare commented 5 months ago

Right, but when you say "it doesn't seem to work", what doesn't seem to work?

I think we need a way to customize the target position value in the CoverTiltDataTemplate.

skipper2020 commented 5 months ago

Ah I understand what you mean. I don't get the position in HA in which hight are my blinds. Yeah sounds like a way to have the position in the CoverTiltDataTemplate.

Would it be possible like this code? But I don't know what is necessary to do in the CoverTiltDataTemplate

ZWaveDiscoverySchema(
        platform=Platform.COVER,
        hint="shutter_tilt",
        manufacturer_id={0x010F},
        product_id={0x1000, 0x1001},
        product_type={0x0301, 0x0302},
        primary_value=CoverTiltDataTemplate(
            current_tilt_value_id=ZwaveValueID(
                property_="fibaro",
                command_class=CommandClass.MANUFACTURER_PROPRIETARY,
                endpoint=0,
                property_key="venetianBlindsPosition",
            ),
            target_tilt_value_id=ZwaveValueID(
                property_="fibaro",
                command_class=CommandClass.MANUFACTURER_PROPRIETARY,
                endpoint=0,
                property_key="venetianBlindsPosition",
            ),
        ),
        data_template=CoverTiltDataTemplate(
            current_tilt_value_id=ZwaveValueID(
                property_="fibaro",
                command_class=CommandClass.MANUFACTURER_PROPRIETARY,
                endpoint=0,
                property_key="venetianBlindsTilt",
            ),
            target_tilt_value_id=ZwaveValueID(
                property_="fibaro",
                command_class=CommandClass.MANUFACTURER_PROPRIETARY,
                endpoint=0,
                property_key="venetianBlindsTilt",
            ),
        ),
        required_values=[
            ZWaveValueDiscoverySchema(
                command_class={CommandClass.CONFIGURATION},                                      
                property={10},                                                                  
                endpoint={0},                                                                    
                value={2},
            )
        ],
    ),
MartinHjelmare commented 5 months ago

No, that won't work. I think you'll need to learn some Python to solve this.

skipper2020 commented 5 months ago

Yeah that's why I need some help ;-)

MartinHjelmare commented 5 months ago

I don't have time to tell you exactly how to solve this. If you want to try and solve this you should first read the relevant code and understand how it works. The relevant code is in cover.py, discovery.py and discovery_data_template.py.

clempat commented 2 months ago

Hey @skipper2020, I am experiencing a similar issue. I haven't had the chance to fully debug it yet, but I really want to find a solution.

Initially, I had multiple FGR-222 units that were working well with regular blinds (Parameter 3 set to 0 and parameter 10 set to 1).

However, the problem arises with my venetian blinds (Parameter 3 set to 1 and parameter 10 set to 2). When I send a command to adjust the blind position, they start moving, after a few seconds, Home Assistant updates the state to the current position while the blinds are still in motion. They become stuck in this state (virtually on Home Assistant). Sending the same commands after the motion would fix the state.

An other interesting point is that reinterviewing the device bring the correct position.

Do you think this is the same issue?

skipper2020 commented 2 months ago

Hey @clempat I think it’s exactly the same issue or reason why it fails with your devices. At the moment my bad and dirty work arround is an automation which executes the service to update all values when one value of the fgr222 changes.

The reason why we have the issue is becsuse when the fgr222 is in venetian blind mode it responds only to the manufactorer proprietary value but HA still wants to read the positon from the multilevel switch value.

I am happy about every kind of help with it. If you have a bug fix I can test it with my test system. I have my zwave-ui container linked to both systems the production and test.

Fireblade900rr commented 2 months ago

Yes, same issue for the FRGM-222 Roller Shutter Module, also Up Down Stop is not working

Fireblade900rr commented 2 months ago

And now a new problem, if i open or close the blinds the switch shows the state for a second then returns to unknown. Its impossible to detect if they're open or closed cause blinds postion is still not shown

PAC1985 commented 2 weeks ago

I also have the same problem with shelly wave shutter