Open derDeno opened 1 year ago
Someone posted an extension in the homeassistant forums: https://community.home-assistant.io/t/ikea-rodret-dimmer-remote-e2201-zha-control-anything/590081/2
Problem: It seems like he copied the extension out of a terminal window and some parts are missing, so the syntax broke. This is the code he added to https://pastebin.com/DuCNMwyA:
The code looks like heavily inspired by this posting, so we can fix it I thin: https://github.com/Koenkk/zigbee2mqtt/issues/15725#issuecomment-1428389352
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['RODRET Dimmer'],
model: 'RODRET',
description: 'RODRET remote control',
vendor: 'IKEA',
fromZigbee: [fz.command_on, fz.command_off],
exposes: [e.battery().withAccess(ea.STATE_GET), e.action(['brightness_down_click', 'brightn>
'brightness_down_release', 'brightness_up_click', 'brightness_up_hold', 'brightness_up_>
toZigbee: [tz.battery_percentage_remaining],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
const version = device.softwareBuildID.split('.').map((n) => Number(n));
const bindTarget = version[0] > 2 || (version[0] == 2 && version[1] > 3) || (version[0] == 2 &&>
coordinatorEndpoint : 901;
await endpoint.bind('genOnOff', bindTarget);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
await reporting.batteryPercentageRemaining(endpoint);
}
};
module.exports = definition;
That the action is always null
is expected, see https://www.zigbee2mqtt.io/guide/faq/#why-is-the-action-property-always-empty
Regarding the battery:
Could you check if the issue is fixed with the following external converter: https://gist.github.com/Koenkk/688987a60de3f7bc13fc20b2413b76a1
configuration.yaml
as ext_converter.js
configuration.yaml
:
external_converters:
- ext_converter.js
I tried your suggestion. Seems that z2m accepts the remote, but no events seems to be fired in HA when I try to push the buttons.
And the battery part?
By adding the following converter I was able to get the actions. I don't think this is fully right, but it does work:
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['RODRET Dimmer'],
model: 'E2201',
vendor: 'IKEA',
description: 'RODRET wireless dimmer/power switch',
fromZigbee: [fz.battery, fz.command_on, fz.command_off, fz.command_move, fz.command_stop],
toZigbee: [tz.battery_percentage_remaining],
exposes: [
e.battery().withAccess(ea.STATE_GET),
e.action(['brightness_down_click', 'brightness_down_hold', 'brightness_down_release', 'brightness_up_click', 'brightness_up_hold', 'brightness_up_release']),
],
ota: ota.tradfri,
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
const binds = ['genOnOff', 'genLevelCtrl', 'genPollCtrl', 'genPowerCfg'];
await reporting.bind(endpoint, coordinatorEndpoint, binds);
await reporting.batteryPercentageRemaining(endpoint);
},
};
module.exports = definition;
I updated to the latest version of Z2M [1.32.2] and the E2201 is now recognized but not responding to any button presses.
I also ran the little JSON snippet from the Wiki to unbind the device - still no luck.
Also I noticed no button events are exposed?
Any ideas?
UPDATE: Remote seems to work now with the latest HA update.
This is very strange... I just downloaded the most recent version of koenkk/zigbee2mqtt:latest (f7a8b612ea8c). And while the device does show up under the correct name (RODRET Dimmer), it also shows up as "unsupported".
I am not using any custom converters. Based on #18381 , the device should have been supported in the latest version. And it is confusing to me to see people here reporting that it works for them.
Is there anything else I need to do in order to get the device to work?
[Edit - it did eventually show up after a HAss update, another restart of Z2M, and a repairing. Not sure if all the steps were actually required, but it does work now :) ]
My Rodret paired fine, all values look normal, except the "action" does not change when I press the buttons. This is with version 1.32.2. Home Assistant also does not get any button presses.
My Rodret paired fine, all values look normal, except the "action" does not change when I press the buttons. This is with version 1.32.2. Home Assistant also does not get any button presses.
Maybe a silly question, but could it be this?
Do any actions show up in the Zigbee2MQTT logs when you press buttons? (go to Z2M/Logs, and filter by your device name in the "filter by text" box - then try pressing some buttons)
With my unit, I see the actions in the logs (on/off, brightness_move_up/down).
Also, I have to ask - how do I figure out my Z2M version? (Edit: never mind, I found it hiding under Settings/About :) )
My Rodret paired fine, all values look normal, except the "action" does not change when I press the buttons. This is with version 1.32.2. Home Assistant also does not get any button presses.
Maybe a silly question, but could it be this?
Do any actions show up in the Zigbee2MQTT logs when you press buttons? (go to Z2M/Logs, and filter by your device name in the "filter by text" box - then try pressing some buttons)
No, nothing in the logs. With all my other IKEA remotes I see the action in the z2m interface change, even if it goes back immidiately.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
I had the same issue. In most of the cases the binds were not set correctly after pairing the device. After restarting a couple of times, repairing multiple times, and some manual bind / unbind operations, it finally worked out for me.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Hello all, I have the same problem (I tried the external converter without success). Do you have any idea ? This problem is not solve ?
Thanks & regards,
I deleted and rejoined the Rodret with the current version of z2m, and now it works as expected.
Strangely enough, I am now seeing the same issue @Shellfishgene mentioned.
I now have 3 Rodret remotes, all successfully paired to Z2M. For one of them, I see no action in the logs when pressing buttons. I see the device_announce message when resetting it, but that is it. Even after reconfiguring, or deleting and re-pairing the remote, I see the same behavior
Even more strangely:
Same for me, 3 Rodret, 2 of the work perfectly fine. The third pairs, but no actions or battery satus.
I'm going to tell you how i did it:
pairing the device to zigbee2mqtt my Coordinator as "target" just had "genPollCtrl" ticked. (No Action reported while pressing a button, no linkquality shown) I wanted to bind it directly to a ikea tradfri psu.
so while staying in the bind menu i pressed the pairing button 4 times to get it to pair. while it started blinking i immediately added the "LevelCtrl" checkbox to the Coordinator and pressed on the blue heart box to "bind" it. i also pressed the pair box for my 2nd pairing TARGET (tradfri psu) with the checkbox "OnOff" ticked. i prepared both target settings before i pressed the blue heart "bind" box. you need to press them both fast when you get the rodret remote into pairing mode.
It worked this way, cause the pairing window is like 10 seconds after the rodret led starts lighting up.
I´m having the same issue, only managed to get the actions to work once, and it seemed pretty random, never managed to get it working again
I'm going to tell you how i did it:
pairing the device to zigbee2mqtt my Coordinator as "target" just had "genPollCtrl" ticked. (No Action reported while pressing a button, no linkquality shown) I wanted to bind it directly to a ikea tradfri psu.
so while staying in the bind menu i pressed the pairing button 4 times to get it to pair. while it started blinking i immediately added the "LevelCtrl" checkbox to the Coordinator and pressed on the blue heart box to "bind" it. i also pressed the pair box for my 2nd pairing TARGET (tradfri psu) with the checkbox "OnOff" ticked. i prepared both target settings before i pressed the blue heart "bind" box. you need to press them both fast when you get the rodret remote into pairing mode.
It worked this way, cause the pairing window is like 10 seconds after the rodret led starts lighting up.
I´m not sure I understand the procedure you described there: how can you be in the bind menu if you are pairing it to a different router (the tardfri psu)?
Strangely enough, I am now seeing the same issue @Shellfishgene mentioned.
I now have 3 Rodret remotes, all successfully paired to Z2M. For one of them, I see no action in the logs when pressing buttons. I see the device_announce message when resetting it, but that is it. Even after reconfiguring, or deleting and re-pairing the remote, I see the same behavior
Even more strangely:
- the other two remotes work just fine, only one of them has the issue
- If I pair the remote to another system (HA with SkyConnect), the actions are seen just fine. So the problem seems to be limited to Z2M, and intermittent
I´m feeling tempted to get a SkyConnect
I just tried adding two Rodret (E2201) devices with Z2M v1.34.0 coordinator zStack3x0 revision 20220219. They do pair and interview succeeds, but they do not respond once paired (no events emitted on button presses and bind operations fail).
I just tried adding two Rodret (E2201) devices with Z2M v1.34.0 coordinator zStack3x0 revision 20220219. They do pair and interview succeeds, but they do not respond once paired (no events emitted on button presses and bind operations fail).
… and with the latest release (1.35.0), it now pairs as well as works (but required a re-interview after first pair)
The device just seems flaky. The first two times after pairing, I could not get the action to work, but after the third time, the action seems to work reliably now (well at least for the last few hours). Will see if that is now a permanent condition.
Edit: The original one just works flawlessly after that. Then I got another one; the second one paired correctly the first time and also works without a hitch.
No button-events might be the reason of an incomplete pairing of the device, which is a bit tricky when you dont know the process:
Pairing the device with the zigbee controller (after pressing the button on the ikea device 4 times quickly) is only half the work that has to be done.
In the 2nd step you have to trigger the configuration in the zigbee-device and then hold the ikea-button for 10 seconds.
After that everything should be fine.
@Tortur3 - where is this documented?
Editing to clarify - I am asking because this would be the first IKEA (or zigbee) device that requires such additional steps. Out of 100+ that I have seen so far. And neither the device manual nor the Z2M page for the device mention it.
Also, when you say "trigger the configuration in the zigbee-device" are you actually referring to the "reconfigure" button under the device page in Z2M?
@Tortur3 it would be very helpful to get answers for the questions from @bogd !
@bogd or did you get the rodret working?
@splizz1st - I was never able to get the RODRET to work reliably with Z2M, so I just gave up (I still have a large collection of the "old" Ikea on/off switches, which work just fine, so I kept using those). Even when the RODRET was connected and I could see the actions, it would just stop working after a while.
I assume the problems will eventually be fixed, so I just wait until that happens :)
Please keep in mind that I haven't tested the device in a couple of months by now, so the problems might have already been fixed.
@bogd oh thanks for the feedback, I've only just seen it. I've had the same experience and have had enough of the old Ikea switches ;-). But of course RODRET would be nice.
My experience: one of my RODRET worked well while I had problems with another one, which didn't report the button presses. I have tried several times repairing and cluster binding (I noticed that the working device had the "LevelCtrl", "OnOff", "genPollCtrl", and "PowerCfg" boxes checked, while the one which didn't work only the "genPollCtrl"), and so on. Nothing worked.
Since the RODRET I bought came from a kit with an IKEA bulb, I decided to pair it directly to the bulb, and when I paired it by following the instructions - by pressing the internal button for ten seconds at a close distance from the bulb - to my surprise it also started working in Z2M: I can see the actions and the battery level.
Not sure why the same 10-seconds button press didn't work when RODRET was close to the coordinator instead of the bulb, but I thought this could help somebody.
Turning "LevelCtrl", "OnOff", "genPollCtrl", and "PowerCfg" seems to have made it pair as well, "LevelCtrl" does error out tho
What happened?
The status page returns null for actions and battery.
What did you expect to happen?
Expected to see available actions and battery status
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
1.32.1-dev commit: 313865b
Adapter firmware version
20210708
Adapter
SONOFF Zigbee 3.0 USB Dongle Plus, TI CC2652P + CP2102(N)
Debug log
No response