openhab / org.openhab.binding.zigbee

openHAB binding for ZigBee
Eclipse Public License 2.0
74 stars 112 forks source link

IKEA Styrbar - Only 2 of 4 buttons show up as channels #832

Open magx2 opened 7 months ago

magx2 commented 7 months ago

I can confirm what Cplant wrote here that IKEA Styrbar has only 2 buttons available in OH instead of 4.

I’m on OH 4.1, using a Sonoff Zigbee dongle with the openHAB Zigbee-Binding.

If I pair the Styrbar button with openHAB, it works great for two of the four buttons (the ones for on/off). The other two buttons, however, (the ones that control the light temperature) do not appear under Channels:

source: https://community.openhab.org/t/ikea-styrbar-only-2-of-4-buttons-show-up-as-channels/153793

What info you would like to get in order to be able to fix this bug?

cdjackson commented 6 months ago

The binding works by detecting device services, and then trying to create channels based on what it finds. If the device works in a non-standard way, then of course this won't work. Without detailed information on the device, it's pretty much impossible for me to know what this device does and how it works. If we can find out how it works, then in principal someone could create a static definition (as XML) so that this overrides the automatic discovery.

magx2 commented 6 months ago

I have this device. What do you want me to do?

śr., 17 kwi 2024, 00:05 użytkownik Chris Jackson @.***> napisał:

The binding works by detecting device services, and then trying to create channels based on what it finds. If the device works in a non-standard way, then of course this won't work. Without detailed information on the device, it's pretty much impossible for me to know what this device does and how it works. If we can find out how it works, then in principal someone could create a static definition (as XML) so that this overrides the automatic discovery.

— Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.binding.zigbee/issues/832#issuecomment-2059993245, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWTLHSERDUTMUK3B6OCJWDY5WOCPAVCNFSM6AAAAABGJC3LDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJZHE4TGMRUGU . You are receiving this because you authored the thread.Message ID: @.***>

cdjackson commented 6 months ago

We need to find out how it works. You can try the fingerprint command, but again, this uses standard mechanisms to discover the services and if the device is doing something non-standard, then it probably won't discover it.

You can also set up a sniffer using a second Ember dongle to try and sniff the data on the network to see what happens when the button is pressed.

Or maybe there's information elsewhere on the web that describes how it works?

magx2 commented 6 months ago

Is this the fingerprint you are talking about? https://community.openhab.org/t/ikea-styrbar-only-2-of-4-buttons-show-up-as-channels/153793/5?u=magx2

I know zigbee2mqtt supports all 4 buttons: https://www.zigbee2mqtt.io/devices/E2001_E2002.html

magx2 commented 6 months ago

From zigbee2mqtt docs:

Zigbee-herdsman handles the core Zigbee communication. The module zigbee-herdsman-converters handles the mapping from individual device models to the Zigbee clusters they support.

Here is the mapping:

cdjackson commented 6 months ago

The fingerprint seems to indicate there's only 1 endpoint, so I'd expect only 1 button.

I had a quick look at the herdsman converters - it seems (if I understand them right) that the buttons just break down the different parts of the level control functionality. Is anything received at all when you press these buttons? (ie is anything displayed in the log if you have debug logging enabled).

For reference

|>| Node Descriptor
| |> Logical Type               END_DEVICE
| |> MAC Capabilities           [REDUCED_FUNCTION_DEVICE]
| |> Stack Compliance           22
| |> Server Capabilities        []
| |> Buffer Size                82
| |> Incoming Transfer Size     82
| |> Outgoing Transfer Size     82
|
|>| Power Descriptor
| |> Available Power Sources    [MAINS]
| |> Current Power Source       MAINS
| |> Current Power Mode         RECEIVER_ON_IDLE
| |> Power Level                FULL
|
|>| ZDO
| |> ManagementBindRequest      TIMEOUT
| |> IeeeAddressRequest         SUCCESS
| |> ManagementLqiRequest       SUCCESS
| |> ManagementRoutingRequest   NOT_SUPPORTED
|
|>| Basic Information
| |> Generic Device Class       0
| |> Generic Device Type        226
| |> Manufacturer Name          IKEA of Sweden
| |> Model Indentifier          RODRET Dimmer
| |> Product Code               ByteArray [value=45 32 32 30 31]
| |> Product URL
| |> Date Code                  20221114
| |> Application Version        1
| |> Software Build ID          1.0.47
| |> Hardware Version           1
| |> Zcl Version                8
| |> Stack Version              113
| |
| |>| Endpoint 1
| | |> Profile                  0104  ZIGBEE_HOME_AUTOMATION
| | |> Device Type              0820  NON_COLOR_CONTROLLER
| | |> Device Version           1
| | |
| | |>| Input Clusters
| | | |
| | | |>| Cluster 0000 Basic
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | |
| | | | |>| Commands Received
| | | | | |> 0000 ResetToFactoryDefaultsCommand
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  ZCL Version                               >> UNSIGNED_8_BIT_INTEGER          8
| | | | | |> 0001  Application Version                       >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0002  Stack Version                             >> UNSIGNED_8_BIT_INTEGER          113
| | | | | |> 0003  HW Version                                >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0004  Manufacturer Name                         >> CHARACTER_STRING                IKEA of Sweden
| | | | | |> 0005  Model Identifier                          >> CHARACTER_STRING                RODRET Dimmer
| | | | | |> 0006  Date Code                                 >> CHARACTER_STRING                20221114
| | | | | |> 0007  Power Source                              >> ENUMERATION_8_BIT               3
| | | | | |> 0008  Generic Device Class                      >> ENUMERATION_8_BIT               0
| | | | | |> 0009  Generic Device Type                       >> ENUMERATION_8_BIT               226
| | | | | |> 000A  Product Code                              >> CHARACTER_STRING                ByteArray [value=45 32 32 30 31]
| | | | | |> 000B  Product URL                               >> CHARACTER_STRING
| | | | | |> 4000  SW Build ID                               >> CHARACTER_STRING                1.0.47
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| | | |
| | | |>| Cluster 0001 Power Configuration
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0020 Poll Control
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 1000
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster FC7C
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | |
| | |>| Output Clusters
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0006 On/Off
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0000 OffCommand
| | | | | |> 0001 OnCommand
| | | | | |> 0002 ToggleCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | |
| | | |>| Cluster 0008 Level Control
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0000 MoveToLevelCommand
| | | | | |> 0001 MoveCommand
| | | | | |> 0002 StepCommand
| | | | | |> 0003 StopCommand
| | | | | |> 0004 MoveToLevelWithOnOffCommand
| | | | | |> 0005 MoveWithOnOffCommand
| | | | | |> 0006 StepWithOnOffCommand
| | | | | |> 0007 StopWithOnOffCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| | | |
| | | |>| Cluster 0019 Ota Upgrade
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0001 QueryNextImageCommand
| | | | | |> 0003 ImageBlockCommand
| | | | | |> 0006 UpgradeEndCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  Upgrade Server ID                         >> IEEE_ADDRESS                    E0798DFFFEA7C935
| | | | | |> 0001  File Offset                               >> UNSIGNED_32_BIT_INTEGER         -1
| | | | | |> 0002  Current File Version                      >> UNSIGNED_32_BIT_INTEGER         16777287
| | | | | |> 0006  Image Upgrade Status                      >> ENUMERATION_8_BIT               0
| | | | | |> 0007  Manufacturer ID                           >> UNSIGNED_16_BIT_INTEGER         4476
| | | | | |> 0008  Image Type ID                             >> UNSIGNED_16_BIT_INTEGER         65535
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         4
| | | |
| | | |>| Cluster 1000
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
magx2 commented 6 months ago
<Logger name="org.openhab.binding.zigbee" level="debug" additivity="false">
    <AppenderRef ref="ZIGBEE"/>
</Logger>

I've added this for logging but I didn't get anything meaningful. Any advice?

cdjackson commented 6 months ago

Doo you see anything when you press the other buttons - ie the ones that do work ok?

magx2 commented 6 months ago

Yes, if I press on/off I'm getting some logs

czw., 18 kwi 2024, 00:30 użytkownik Chris Jackson @.***> napisał:

Doo you see anything when you press the other buttons - ie the ones that do work ok?

— Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.binding.zigbee/issues/832#issuecomment-2062587154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWTLHWXPQ33YLHJJLRKNL3Y53ZXDAVCNFSM6AAAAABGJC3LDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGU4DOMJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

cdjackson commented 6 months ago

As far as I can tell, this probably ought to work. What channels are actually provided for the two buttons that work?

The next step will be to enable TRACE level debugging for the binding and reinitialise the device. This will allow me to see what's going on with the device discovery and the initialisation, but first please let me know what the channels are and also please provide the logs showing the data received for the buttons that work.

magx2 commented 6 months ago

obraz

Up and down works as dimmer, left/right do not work

obraz

I will provide you logs this week

cdjackson commented 6 months ago

Ok, thanks.

From looking at the fingerprint, I'd assumed that the 2 that worked were on and off and the other 2 were brightness. So what do you expect the other two buttons should do?

magx2 commented 6 months ago
<Logger name="org.openhab.binding.zigbee" level="trace" additivity="false">
    <AppenderRef ref="ZIGBEE"/>
</Logger>

Should I add something more?

magx2 commented 6 months ago

From looking at the fingerprint, I'd assumed that the 2 that worked were on and off and the other 2 were brightness. So what do you expect the other two buttons should do?

I had this paired to smart bulb that could change brightness and color temp. The usage can be described as:

In general both up/down and left/right works the same, the change only different properties of the bulb. With OH+rules I've already copied the up/down functionality.

cdjackson commented 6 months ago

Hmmm - were these functions handled through some sort of rule? I don't think there's a direct way to control the colour temp in this way, so either there's a rule involved, or there's some way to program the remote to send very specific commands. I also just noted that the device doesn't seem to support the colour control cluster, so I guess you use some other command (probably one of the level control commands?) and this triggers a rule?

I somehow need to work out what the low level commands are...

magx2 commented 6 months ago

Check this video: https://www.youtube.com/watch?v=NF5G5wziwso . There are no rules or Ikea gateway, just pure connection Styrbar-Bulb

cdjackson commented 6 months ago

Ok, then I don't know. According to the fingerprint, the device does not support colour control which I think is the way it should be controlling the colour temp.

magx2 commented 6 months ago
<Logger name="org.openhab.binding.zigbee" level="trace" additivity="false">
  <AppenderRef ref="ZIGBEE"/>
</Logger>

Should I add something more?

Should I click styrbar with this enabled?

cdjackson commented 6 months ago

I think this logging should be fine, but I'd need to see the initialisation to get a bit more detail. You've already said that nothing is received when you click the buttons, so changing to TRACE logging won't change that. I need to find out what commands are being used so I can configure the device.

As I said above, the device (apparently) doesn't support colour control, so I'm not sure what commands it sends to change the bulb colour. The other option is to find a sniffer and sniff what's happening on a working system.

magx2 commented 6 months ago

Do you want me to turn off trace logging and pair styrbar one more time?

cdjackson commented 6 months ago

We need TRACE logging on for the pairing/discovery to see fully what's happening with the channel discovery. However, my thinking around looking at the discovery was when I thought the channels were around on/off and level control - not colour control. I'm not sure this will really help though as it probably won't tell us how the colour control is managed given that the device doesn't seem to be reporting the colour control cluster.

Still, getting the full log, with TRACE, won't hurt.

However...

I just found this issue -: https://github.com/Koenkk/zigbee2mqtt/issues/1232

And this comment -:

image

This seems to indicate that the Ikea bridge is programming the device to do something "special". I'll continue to read this thread (tonight - I need to go out and do some work in the garden now) as I suspect it might have the info I'm looking for so for now let's hold off - no sense wasting your time just yet :)

magx2 commented 4 months ago

Hey, any update on this?

cdjackson commented 4 months ago

No - I'm not sure what else can be done. I don't have this device or the Ikea gateway to be able to work out how it is configured - as above - it looks like the Ikea gateway is sending extra configuration to implement this. It might be possible to program a scene or something, but without the device I'm simply unable to do much.

magx2 commented 4 months ago

Can I send you 12 pounds so you would buy this device https://www.ikea.com/gb/en/p/styrbar-remote-control-smart-white-60488366/ (no gateway is required)?

Edit: I can send you also extra 7 pounds for this lightbulb that I'm using

cdjackson commented 4 months ago

Unfortunately I'm not living in the UK at the moment - I'm in New Zealand. We don't have an Ikea here (yet) - although one is meant to open soon. I think that makes things a bit difficult to buy stuff...

But if I understand the issue (which possibly I don't) it seems that the Ikea gateway is configuring the remote to do something with the buttons. It states above that "removing and pairing again looses the ability to control the color_temp with the remote" and that pairing with the Ikea bridge seems to be different than pairing direct to a coordinator. The issue also states "it seems the tradfri hub does some special setup".

My guess is that the hub is configuring scenes - but that is a guess. The linked issue is very long with hundreds of comments and I'm not had the time to read through this to work out what the solution is. Are you able to spend some time looking at this to see if you can find the relevant info?

magx2 commented 4 months ago

that the Ikea gateway is configuring the remote to do something with the buttons

There is no gateway. In Ikea's use case Styrbar is connecting directly to the bulb(s). Check this video - https://www.youtube.com/watch?v=NF5G5wziwso

My guess is that the hub is configuring scenes

Yeah, but in OH I do not see those buttons at all... If the device would show me 4 buttons instead of 2 I would do everything in OH without a problem

cdjackson commented 4 months ago

There is no gateway.

Strange - the zigbeemqtt thread talks about the Ikea bridge doing some configuring of the device. How does it join a network? Where is the coordinator? Does the bulb act as a coordinator, in which case how are other devices connected to the network? The video is not really particularly informative - we need to understand technically how this works.

Yeah, but in OH I do not see those buttons at all

Sure - but that's a whole different issue. At the moment, the device is not sending any data when you press the buttons. Until it does that, we can't work out how to configure the binding to receive the data as I have no idea what it is.

magx2 commented 4 months ago

How does it join a network? Where is the coordinator? Does the bulb act as a coordinator

I think there is no network/zigbee mesh. Styrbar is communicating directly with a light bulb so either styrbar is an coordinator or lighbulb.

Check this video it shows you how it's pairing light bulbs with styrbar and motion sensor without gateway

cdjackson commented 4 months ago

I think there is no network/zigbee mesh.

So every light is connected to only the single remote - nothing else? That seems very limiting if each bulb is effectively its own network

magx2 commented 4 months ago

On the video guy connected a remote and motion sensor to one bulb. idk but maybe you can connect multiple remotes to a bulb

cdjackson commented 4 months ago

On the video guy connected a remote and motion sensor to one bulb

Sure - but that doesn't make it a good thing to do. Normally a device can only be included in a single network, so if the bulb is acting as the coordinator, then it can't be in an OH network.

This probably uses the Light Link system that was used in the past for Hue. In any case, if you want to connect it to OH, then it needs to join the OH mesh network.

magx2 commented 4 months ago

so if the bulb is acting as the coordinator, then it can't be in an OH network.

But if you restart the bulb and the remote they can join zigbee network as normal devices. In this moment I have 3 bulbs and 1 styrbar remote that are in my zigbee/OH network and I can control them via OH

obraz

cdjackson commented 4 months ago

Sure - so you can have them in a normal network, or directly connected. Again, this is similar to the Hue bulbs. However, if they are in a normal network, then, from what I've read and linked above, the gateway is doing some configuration to configure the device to send other commands.

At the moment I don't have much information on how this works, so it's pretty much impossible to know how to implement it. Unfortunately I don't have the time to read hundreds of messages to see how or if zigbee2mqtt got it working so it would be helpful if you can try and find this (as I suggested earlier). We need to know how to make the device send commands for all buttons, then we need to work out what the commands are, and then we can look to implement something in OH.