Support tilt for covers in ZHA

Thanks for the great work!
Unfortunately, it doesn’t quite do, what it’s so supposed to, for me. I’ve just tried it with my NodOn Roller Shutter. The controls show up fine but when I use the tilt service, tilting works while the shutter starts to open or close respectively. And then, controlling it seems impossible until I press stop, since the directions seem to counteract each other.

NodOn has no way of trying the Relais via another app, so I can’t be sure, ZHA is to blame. NodOn claims to support tilting blinds, though.

@srslykev Please test how your devices behave when they receive ZigBee tilt commands without having this ZHA change active.

You can do this by sending custom ZigBee commands via Home Assistant. Here is an example script, which you can call in the services tab in the dev tools:

alias: Set Tilt Position
icon: mdi:boom-gate-up
mode: single
fields:
  entity:
    name: Entity
    required: true
    selector:
      entity:
        domain: cover
  value:
    name: Value
    required: true
    selector:
      number:
        min: 0
        max: 100
sequence:
  - service: zha.issue_zigbee_cluster_command
    data:
      ieee: "{{ (device_attr(entity, \"identifiers\") | list).0.1 }}"
      endpoint_id: 6
      cluster_id: 258
      command: 8
      command_type: server
      params:
        percentage_tilt_value: "{{ 100 - value }}"

I get an ‘Unknown Error’ running that service. Maybe I’ve got the wrong cluster or endpoint id? I checked in the diagnostic data.

Those ids are the ones from the ZigBee standard. If your device supports tilt, that should work. Maybe the ieee parameter isn’t correctly read. You could try hardcoding the IEEE, you can find it in the ZigBee infos on the HA device page. (You might have to remove the colons, not sure about that.)

I hardcoded the IEEE in the first place, since HA prompted it wouldn’t support templates in services.
Instead, I tried accessing the cluster command via device infos → manage zigbee device. I got the same result.
So maybe the roller shutter isn’t handling the command correctly?

So you get the same error when using the following things?

  • The zha.issue_zigbee_cluster_command service
  • The “manage Zigbee device” interface
  • The new tilt ZHA feature developed by @josef109

If yes, then I’d say your device isn’t handling the Zigbee command correctly. Because for me (with the “Nexentro Blinds Actuator Mini” device) all those 3 things work fine.

So NodOn support claims, this might be due to Home Assistant. But shouldn’t the cluster command be the same no matter what hub I use?

ZHA uses the default cluster commands from the ZigBee standard. It could be that the device supports tilt commands via ZigBee, but doesn’t follow the standard. Meaning it uses different cluster ids or commands ids.

This happens quite often and is the reason why the GitHub - zigpy/zha-device-handlers: ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices. repository exists. You could try creating an issue there.

Is your device one of those?
https://www.zigbee2mqtt.io/devices/SIN-4-RS-20.html
https://www.zigbee2mqtt.io/devices/SIN-4-RS-20_PRO.html
If yes, then that would also hint towards non-standard tilt commands. Because that pages don’t mention tilt. If you compare them with the page for my device, then you’ll see that it mentions tilt.
(Note: Those pages are from Zigbee2MQTT. That’s not directly relevant for ZHA, but can be a good indicator for supported features of devices.)

If you can figure out which cluster ids or command ids your device uses for tilt commands then you could create a script like the one I posted above and use that until a device handler is implemented for your device.

Thanks for your detailed answer. I’m using SIN-4-RS-20. NodOn claims tilt support on their website and customer support assured me they were working on further compatibility. I’ll try and ask them about the used cluster commands.

Apparently, NodOn use custom attributes for tilt runtime calibration. Those aren’t accessible via the Home Assistant interface, as far as I can tell. Is there another way to access these attributes in order to calibrate the runtime?

Unless a ZHA device handler is implemented your only way is to use a custom script like the one I posted in post #22

@josef109 Why did you close the PR? Will you create a new one?

@josef109 I found your new PR and saw that it is still in draft state and a few changes were requested. Do you plan to continue working on it?

@josef109 Any updates on your pull request? → ZHA cover tilt by josef109 · Pull Request #93301 · home-assistant/core · GitHub

ZHA cover tilt support is needed for devices like example the blinds actuator by Insta GmbH, see this ZHA Device Handlers (quirks) request → [Device Support Request] Insta GmbH Nexentro Blinds Actuator Mini · Issue #1397 · zigpy/zha-device-handlers · GitHub

I have been running and testing ZHA cover tilt by josef109 · Pull Request #93301 · home-assistant/core · GitHub as custom integration for a few weeks now. It works extremely well, I have not seen any problem so far. I really wonder why ZHA does not support window blinds with tiltable slats (as other cover implementations do e.g. Z2M or Zwave).

I think the tilt support is essential for using ZHA cover.
I know it’s hard to understand if you don’t have such “Venetian blinds”, but they are very common in office buildings and modern energy efficient houses with large windows where you need to control solar heat with the tilt function of the cover (We spent €400 more per window in our new house to have tilting blinds as opposed to roller blinds. )

@josef109 awesome work, thank you very much. (I own you a beer)

I see you still regularly update this PR by merging HA:dev. Can you please go the last step and get the missing things done?

Is there anything I can help?

Greetings from Halle,Germany - Michael

FYI, there is a new pull request for this by @tomasbedrich to ZHA integration in Home Assistant core:

Awesome work. Is it already included in the latest release of Home Assistant? I am on 2023.10.5. Or do I have to go for a beta release? I’m using couple Nexentro Blind Actuators to control my Venetian blinds, but at the moment none of the the new tilt services is availabe in Home assistant. Do I have to remove them from my zigbee network and add them again, to make this new function work?

The PR was just merged 5 days ago, so it is not in 2023.10.5. It looks like it is available in 2023.11 beta, although the beta release notes don’t mention it yet.

@frenck According to GitHub you created the releases 2023.11.0b0 and 2023.11.0b1, so maybe you can answer that. It looks like PR #102072 was already included in 2023.11.0b0, but is not mentioned in the release notes (and doesn’t have a milestone assigned on GitHub). Was it missed?

#102072 is in the release 2023.11 :+1:t2:

@tomasbedrich @josef109 Thanks for all your work
(and goodbye to my custom ZHA)

1 Like