Support tilt for covers in ZHA

Yes, my devices use firmware version 0.0.52.5 and there is no update offered.

About the tilt position updates: The Nextentro Config app (which uses Bluetooth) shows tilt position updates way more often than HA.

bluetooth and zigbee are two completely independent interfaces. I think it is clear that the controller itself has the exact position. Whether it also communicates it, I can not say yet. Often the last position does not come through. It may be due to zigpy or the controller. I will check with the zigbee sniffer.

1 Like

I just saw that you created a pull request, thanks!

Did you find out anything about the tilt position update frequency?

@josef109 Is “tilt” and “lift” the same attribute in ZCL Window Covering cluster are “Tilt” and “Lift” separate attributes and if so should not Home Assistant’s cover component really support them as different device actions?

https://github.com/home-assistant/core/blob/bacbe4aa58e02a25217c07d23c45fccc70325a5e/homeassistant/components/cover/device_action.py

Reference:

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: