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
[tradfri][WIP] Adds basic support for IKEA smart blinds FYRTUR and KADRILJ #6167
Conversation
* adds the "blind" thing and associated data * temporarily assigned zigbee id "0999", needs review Signed-off-by: Manuel Raffel <manidu@outlook.com>
Travis tests were successfulHey @manraf, |
Travis tests were successfulHey @manraf, |
binding.tradfri.name = TRÅDFRI Binding | ||
binding.tradfri.description = Dieses Binding integriert das IKEA TRÅDFRI System. Durch dieses können die TRÅDFRI Lampen und Leuchten gesteuert werden. |
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.
The changes in this file (apart from the obviously blind-related ones) result from me storing the file with UTF8-encoding, as the special characters where not shown on my PC.
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.
That's wrong. Since we use Java 8 the .properties
files need ISO-8859-1 encoding, please revert that.
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.
Thanks for the information, committed with ISO 8859-1.
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/ikea-tradri-roller-blind-via-openhab/82977/4 |
@@ -48,6 +50,10 @@ | |||
public static final Set<ThingTypeUID> SUPPORTED_PLUG_TYPES_UIDS = Collections | |||
.unmodifiableSet(Stream.of(THING_TYPE_ONOFF_PLUG).collect(Collectors.toSet())); | |||
|
|||
public static final Set<ThingTypeUID> SUPPORTED_BLIND_TYPES_UIDS = Collections | |||
.unmodifiableSet(Stream.of(THING_TYPE_BLIND).collect(Collectors.toSet())); | |||
|
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.
remove empty line
Signed-off-by: Manuel Raffel <manidu@outlook.com>
Travis tests were successfulHey @manraf, |
The thing-id is the only whing that is missing, or are there other points? @cdjackson, since you are a ZigBee expert, how can we proceed here, what do you suggest? |
Isn't this related to the Tradfri binding? I'm not really sure who this binding manages its thing ids - I don't know if it's in any way linked to ZigBee or if the Tradfri gateway provides some sort of abstraction? ZigBee exposes a string "Model ID" parameter which may be used - or as I said, maybe the gateway does all the detection to decide what the device is and then exposes something completely different... |
The "official" ZigBee thing id (if there is such a thing - apparently the first version of the binding used some proprietary device's documentation that only applies to lights?) and the Stop/Move command logic. Using the remote, when the blind is moving and any button is pressed, it stops. However, I have no idea how to find the correct CoAP command to send to the Tradfri gateway for this case. Judging from the IKEA app, a "move" (in the sense of "continue the movement you did before receiving a stop") is not naturally supported, but can be implemented in the binding with some custom logic. |
Thanks. My understanding was that this model-id is somehow universally used. Probably the Tradfri gateway is different then. |
There is no such thing - at least not at the ZigBee level. I assume that this comes from the Tradfri gateway and not ZigBee. ZigBee defines a number of parameters that could be used to derive a thing ID, but this derivation will be dependant on the ZigBee gateway. For example there are attributes for model ID and manufacturer - these could be used in some way, but there's no "official" ZigBee thing ID.
I don't know what clusters this is supporting - I assume the window covering cluster, but maybe it's the ZLL level control rather than the HA Window Covering. Sorry - without having one it's hard really to provide a lot of support. |
Yes, that is correct. According to the Zigbee 3.0 Cluster Library the cluster identifier is |
It seems strange to me to use the cluster ID for the thing type. The cluster is used for transferring commands, and typically a device will support multiple clusters and different devices will support the same clusters. So if you are using the cluster ID to define your thing type, how do you differentiate between different devices that may need to be supported that all use the same clusters? Ie there may be different window covering devices that ultimately need to be supported - they could work differently, but I'm unclear how you will differentiate them if you use the cluster ID as the thing type? I would have expected you to use something that defines the device - eg the device model? |
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.
Thank you very much for your first contribution over here. I added some comments.
@@ -137,6 +137,25 @@ | |||
<config-description-ref uri="thing-type:tradfri:device" /> | |||
</thing-type> | |||
|
|||
<thing-type id="0999"> |
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.
Please change the id
to "0102" and its label to "Window Covering Device".
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.
Note that a "Window Covering Device" is device type 0x202. The "Window Covering" cluster is 0x102, but really it seems very strange to use the cluster ID as a device ID.
Up to you though, but there are other devices that will use this cluster - eg window covering controller has device type 0x203
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.
You are right. I mixed it up here. The device id should be used: "0202".
if(StopMoveType.STOP.equals(command)) { | ||
// setPosition(state.getPosition()); | ||
} else { | ||
// (what) TODO (?) |
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.
That is a good question. I am not sure if we are able to interrupt an previous command sent to TRADFRI gateway. I hence suggest to ignore these commands and log a info / warning / debug for the user.
According to the Zigbee Cluster Library is should be possible to send a "stop" on protocol level. Do you know if there is another property beside the position ("5536") available in the TRADFRI COAP interface?
@@ -27,6 +27,8 @@ thing-type.tradfri.0820.label = Kabelloser Dimmer | |||
thing-type.tradfri.0820.description = Der Kabellose Dimmer liefert Daten wie z.B. die Batterieladung. | |||
thing-type.tradfri.0830.label = Fernbedienung | |||
thing-type.tradfri.0830.description = Die Fernbedienung liefert Daten wie z.B. die Batterieladung. | |||
thing-type.tradfri.0999.label = Rollo | |||
thing-type.tradfri.0999.description = Akkubetriebene Rollo mit einstellbarer Position. Liefert au�erdem Daten wie z.B. die Akkuladung. |
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.
Batteriebetriebenes Rollo ...
@cdjackson To be honest I do not know the exact reason why. I would assume the Hue binding started with this while Zigbee 1.0 and ZLL were state of the art. For the lights there were specific Zigbee device ids which are reflected into the thing type ids. Later we / l introduced cluster ids when support for sensors (ZHA) has been implemented. Nowadays with Zigbee 3.0 the You have to keep in mind that most of the bindings depend on a vendor specific layer between the Zigbee protocol and openHAB (e.g. Hue -> HTTP REST API, deCONZ -> HTTP REST API and websocket REST API, TRADFRI -> COAP REST API, and so on). They all have their "own" interpretation / ideas and have to be handled slightly different. It is sometimes hard to align them back in OH. |
Note that the type is not new in ZB3.0 - it has always been available and would have seemed a better fit in any case, but my point is that if there are different devices supporting the same features, you can’t differentiate them with this. If you’re sure that all blinds exposed in this way will always look the same via whatever interface is exposed by Tradfri, then fine - I’m just worried that you will encounter issues later as you simply cannot differentiate different thing types in this way.
Anyway, if that’s the chosen method for Tradfri, then I guess it’s something that may, or may not have to be dealt with one day as you’re at the mercy of device designers...
… On 13 Oct 2019, at 12:35, Christoph Weitkamp ***@***.***> wrote:
@cdjackson <https://github.com/cdjackson> To be honest I do not know the exact reason why. I would assume the Hue binding started with this while Zigbee 1.0 and ZLL were state of the art. For the lights there were specific Zigbee device ids which are reflected into the thing type ids. Later we / l introduced cluster ids when support for sensors (ZHA) has been implemented. Nowadays with Zigbee 3.0 the type will make much more sense. In some bindings the discovery already uses these types to identify the correct thing type.
You have to keep in mind that most of the bindings depend on a vendor specific layer between the Zigbee protocol and openHAB (e.g. Hue -> HTTP REST API, deCONZ -> HTTP REST API and websocket REST API, TRADFRI -> COAP REST API, and so on). They all have their "own" interpretation / ideas and have to be handled slightly different. It is sometimes hard to align them back in OH.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://github.com/openhab/openhab2-addons/pull/6167?email_source=notifications&email_token=AAH6IQ52Y6YQKUOBUO4RP7LQOMBXVA5CNFSM4I5FKPH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCULSI#issuecomment-541410761>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAH6IQ577SWO4RCZWOCKZ7LQOMBXVANCNFSM4I5FKPHQ>.
|
That is not my intention. Indeed my vision would be to have a unique thing type registery - maybe the one from your binding - for all other bindings based on Zigbee protocol and different handlers to delegate commands from OH to the specific interface and handle data provided by them ... |
I will revoke this statement. It seems that I mixed it up. We tried to stick to the device ids for the thing types. |
It makes more sense that way at least ;)
… On 13 Oct 2019, at 13:25, Christoph Weitkamp ***@***.***> wrote:
We tried to stick to those cluster ids for our thing type definitions.
I will revoke this statement. It seems that I mixed it up. We tried to stick to the device ids for the thing types.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://github.com/openhab/openhab2-addons/pull/6167?email_source=notifications&email_token=AAH6IQ4WBX6RO73ASYFKL2LQOMHURA5CNFSM4I5FKPH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCVFQA#issuecomment-541414080>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAH6IQ6DQQU75ETJCIT6MLTQOMHURANCNFSM4I5FKPHQ>.
|
Had a look at my Tradfri gateway with pytradfri, but was not able to find out more as you already know.
Only differences after using remote control:
IKEA Tradfri app shows a "pause" icon while moving to desired position, but I have no idea how to sniff whats sent on the wire when button is pressed. If you need complete pytradfri output of
just let me know... |
Spent some time to analyze my complete environment with pytradfri...
5750:6 = REPEATER verified for my repeater (while 5750:0 = SWITCH, 5750:2 = LIGHT, 5750:3 = PLUG, 5750:4 = SENSOR, 5750:7 = BLIND is already known)
3:{0:VENDOR,1:MODEL,3:FIRMWARE,6:3,9:BATTERY_LEVEL} --> 6:3 = 'BATTERY' (verified for my remote controls, on/off switches, wireless dimmers, open/close remotes and roller blinds) 3:{0:VENDOR,1:MODEL,3:FIRMWARE,6:1 (9:DOESN'T EXIST)} --> 6:1 = 'AC' (verified for my bulbs, panels, transformers and repeaters) DEVICE_BATTERY_LEVEL is only available with 6:3 |
Can someone please provide a jar to manually install this version of the binding for testing? Thanks so much! |
I would like to kindly ask for progress here, although I do not understand what is needed to pursue. |
Hi org.openhab.binding.tradfri-3.0.0-SNAPSHOT.zip Kind regards! |
Works perfectly! Thanks a lot! However, I can only set up the things in PaperUI, not manually. |
@manraf Are you still around and able to finalize this PR? If not please let me know and I will pick it up. |
Thanks a lot for this! Really hope to see this merged soon. First of all, I have the same problem as @sehroriginell. When added via configuration files I'm getting a communication error. No further information in logs (maybe i have to up the log level?) or in thing detail (in paper ui). Second, when the blinds start moving up/down I'm getting a lot (almost on every position update) of errors about value not being between 0 and 100.
And the last problem I bumped into is that the blinds cannot be stop midway. The item receives the position, but doesn't act on it.
|
@cweitkamp I'm currently busy with work and holidays. If you've got the time feel free to pick it up, otherwise I might be able to continue end of January... |
Any news on this? I am about to buy multiple of those and would love to integrate into my openHab setup. Saw it is only 1 reviewer pending. Looking forward. The Prerelease provided above won't work in my case, the *.jar is in my addon-folder but openhab does not show it in the bindings. |
I rebased this branch and did some minor modifications and tweaks (see 2.5.x...cweitkamp:pr-6167). @manraf How should we continue? I can create a new PR to supersed yours or create a PR against your branch. Attached you can find a test version for OH 2.5.X or higher: org.openhab.binding.tradfri-2.5.2-SNAPSHOT.zip @sehroriginell @sveatlo Some questions? When adding the thing via Paper UI does it change its status to Regarding the IAE: In general it will be thrown if the value is less than 0 or greater than 100. I added a check for those thresholds. I hope it will help.
I have to admit that I currently have no idea either. And I am not able to test it. Thus handling of @AlexKay88 I am not sure if it makes sense to add the Signal Repeater because there is absolutely not way to interact with it or any sensor data to read from it. Isn't it? |
Superseded by #6977 |
Recently, IKEA released two new, rechargeable smart blinds "FYRTUR" and "KADRILJ" (first one is lightproof, second one slightly translucent). The changes in this PR add basic support for those blinds to the binding with the possibility to open and close the blinds as well as set the to a specific position (percentage between 0 and 100). Furthermore, the current battery level of the blind is exposed and also the "battery low" status which is triggered if the level is below 10 percent.
The PR is marked [WIP] because the new thing is of type "Rollershutter" and therefore should support Stop/Move commands as well, which have not been implemented yet. Maybe someone can figure this out faster than me. Also, I guess the additions and adjustments of the README and language files could be better. As "blinds" are not mentioned in the "ZigBee LightLink" document, which apparently is the source for all thing type ids, a temporary id of "0999" was used for them. A final id needs to be figured out somehow.