Skip to content

Add initial support for Eria Adurosmart Wireless Dimming Switch #4211

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

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

SwoopX
Copy link
Collaborator

@SwoopX SwoopX commented Jan 17, 2021

See #3383 and #1730

@SwoopX SwoopX linked an issue Jan 17, 2021 that may be closed by this pull request
@mdolnik
Copy link
Contributor

mdolnik commented Jan 19, 2021

I ran into a compiler error with this branch/commit:

bindings.cpp: In member function ‘bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor*)’:
bindings.cpp:2803:9: error: expected ‘)’ before ‘sensor’
         sensor->modelId() == QLatin1String("Adurolight_NCC")
         ^~~~~~

This is fixed by adding and OR operator to the line above after HG06323:

eg

// LIDL
sensor->modelId() == QLatin1String("HG06323") ||
// Eira
sensor->modelId() == QLatin1String("Adurolight_NCC")

@mdolnik
Copy link
Contributor

mdolnik commented Jan 19, 2021

After successfully compiling I am still having the same issues as my previous comment in issue 1730 where:

  • I can get it connected to deCONZ but not Phoscon
  • Every button press will flash the green LED on the remote. When it's not paired, the LED does not light up on every button press.
  • When deCONZ is in debugging mode I get the following output on any button press where 0x5517 is the ID of the Eria switch:
22:08:54:556 CTRL skip polling while permit join is set
22:08:54:563 CTRL skip polling while permit join is set
22:08:54:574 APS-DATA.indication from child 0x5517
22:08:54:673 CTRL skip polling while permit join is set
22:08:54:682 CTRL skip polling while permit join is set

With the code that was recently added for this switch, is there any specific brand/model that should be selected in Phoscon? I have tried:

  • Other
  • Ikea TRÅDFRI remote control
  • Phillips Hue dimmer switch
  • Phillips Tap

Not sure if it would help, but for either of these brands/models, when I am in the pairing mode in Phoscon, I will get the something similar to the following output in deCONZ debugging:

22:26:53:681 APS-DATA.indication from child 0x5517
22:26:53:682 void deCONZ::zmNode::setFetched(deCONZ::RequestId, bool) fetched item: 7, node: 0x5517
22:26:53:682 FP indication 0x0000 / 0x8005 (0x00158D000198D590 / 0x5517)
22:26:53:682                       ...     (0x00158D000198D590 / 0x5517)
22:26:53:682 ZDP indication search sensors 0x00158D000198D590 (0x5517) cluster 0x8005
22:26:53:683 ZDP indication search sensors 0x00158D000198D590 (0x5517) clear timeout on cluster 0x8005
22:26:53:732 CTRL skip polling while permit join is set

I am very unfamiliar with this code so I don't have any idea what most of it does.

Is there anything specific I should try? Including modifying any certain parts of the code?

@SwoopX
Copy link
Collaborator Author

SwoopX commented Jan 19, 2021

Thanks for checking. I meanwhile corrected the small error in the code.

How does the switch look like in deconz GUI after you've paired it? Has a corresponding sensor resource been created in the REST API? If the device got paired correctly and everything worked out as expected, you should see some [INFO] - XYZ messages in the logs upon each button press. Right now, those should indicate that there's no button map found (this is the part where you need to provide me some input to create it).

You'll not see the device in Phoscon unless explicitly supported there, which must be requested in the Phoscon beta repository.

@mdolnik
Copy link
Contributor

mdolnik commented Jan 22, 2021

Well I somehow managed to bork my Ubuntu installation by installing a wrong driver so I currently cannot use any mouse or keyboard, and I never set up a means to remote into it. This means I'll have quite the trouble being of any help right now until I un-fudge my OS.

At this point I'm a little hesitant to try messing around with this on my Raspberry Pi in case I mess up my setup, so I'll try my best from memory...

How does the switch look like in deconz GUI after you've paired it?

A couple things I remember:

  • I was able to "pair" it without Phoscon listening and it would show up in deCONZ and:
    • Only one circle appears on the right side of the deCONZ node
    • The Eria remote lights up green on each button press, but deCONZ does not seem to register any button presses.
  • When I "pair" it with Phoscon listening:
    • Phoscon does not register that anything was found, but deCONZ does.
    • Both circles appear on the right side of the deCONZ node.
    • The Eria remote lights up green on each button press, and the circle on the left side deCONZ will flash green on every button press.

Has a corresponding sensor resource been created in the REST API?

How would I be able to tell is one was created? Regardless I would be going off memory at this point, but I can see if anything rings a bell.

If the device got paired correctly and everything worked out as expected, you should see some [INFO] - XYZ messages in the logs upon each button press.

Does this answer my previous question? Is this referring to the REST API?

I don't remember anything in the CLI output specifically saying [INFO] but I do recall some logs with square brackets, but I can't recall any patterns that occurred on EVERY button press except for what I mentioned above. I could be wrong though.

Would these [INFO] logs have included the ID (in my case 0x5517)? I was only looking through the logs for anything in/around that ID.

You'll not see the device in Phoscon unless explicitly supported there, which must be requested in the Phoscon beta repository.

What would be the steps for this? Alternatively would it be easier to classify it as a Phillips Hue dimmer switch since the buttons are the same and it looks similar?

Sorry I'm not much help at the moment, I'll try to see if I can get my Ubuntu working this weekend, and if not, I'll try debugging on my Pi.

@mdolnik
Copy link
Contributor

mdolnik commented Jan 24, 2021

So I managed to get my Ubuntu up and running again and did a bit of investigating...

Has a corresponding sensor resource been created in the REST API?

I think I can now confidently that no sensor has been created.

While debugging with print statements I noticed whenever any buttons are pressed, the code ends up getting to line 1021 in DeRestPluginPrivate::apsdeDataIndication() in de_web_plugin.cpp and the line sensorNode = getSensorNodeForAddress(ind.srcAddress()); seems to not return a sensorNode as the following if statement is never entered.

I am also not getting the [INFO] - No button map for... message nor any [INFO] - messages.

What would be involved in getting the sensor resource / sensor node set up?

@manup manup added this to the v2.10.1-beta milestone Feb 15, 2021
@SwoopX
Copy link
Collaborator Author

SwoopX commented Feb 22, 2021

@mdolnik Sorry, I guess this one slipped through. The reason is that the manufacturer code and mac prefix are identical to the Xiaomi's and therefore, neither model ID nor manufacturer name are querried. The solution for this should be starting sensor search in Phoscon and then reading the basic cluster in deconz GUI while the device is awake (just press a button on the device and press the read button 1-2 seconds afterwards).

@manup manup merged commit 3f3d10c into dresden-elektronik:master Feb 22, 2021
@SwoopX SwoopX deleted the eria branch February 22, 2021 22:06
@mdolnik
Copy link
Contributor

mdolnik commented Feb 26, 2021

@SwoopX

Juts an FYI the merged branch above does not resolve this issue, which I'm sure is already known since nothing was changed since 65acc33 on Jan 19th, but I just wanted to confirm this is still an issue.

I found the culprit as to why the sensorNode is not being created for this switch:

else if (node->nodeDescriptor().manufacturerCode() == VENDOR_JENNIC ||
modelId.endsWith(QLatin1String("86opcn01"))) // Aqara Opple prevent client clusters creation, client clusters aren't used, fpSwitch is created for 0xfc00 cluster.
{

This code will ignore all nodes with VENDOR_JENNIC

One work-around that works for me is to change the logic in an if statement above:

if (modelId == QLatin1String("ZYCT-202") || modelId == QLatin1String("ZLL-NonColorController"))
{
fpSwitch.outClusters.push_back(ci->id());
}

To:

if (modelId == QLatin1String("ZYCT-202") ||
    modelId == QLatin1String("ZLL-NonColorController") ||
    // Eria Adurosmart Wireless Dimming Switch.
    modelId == QLatin1String("Adurolight_NCC"))
{
    fpSwitch.outClusters.push_back(ci->id());
}

Which essentially whitelists this specific model (which there are no other existing ) before it is backlisted for its manufacturer code.

After this change, I am now getting the following [INFO] - No button map for outputs:

  • On Button:
    • [INFO] - No button map for: Adurolight_NCC, unicast to: 0x0000, endpoint: 0x01, cluster: 0xFCCC, command: 0x00, payload: 000000, zclSeq: 174
  • Up Button:
    • [INFO] - No button map for: Adurolight_NCC, unicast to: 0x0000, endpoint: 0x01, cluster: 0xFCCC, command: 0x00, payload: 000100, zclSeq: 177
  • Down Button:
    • [INFO] - No button map for: Adurolight_NCC, unicast to: 0x0000, endpoint: 0x01, cluster: 0xFCCC, command: 0x00, payload: 000200, zclSeq: 180
  • Off Button:
    • [INFO] - No button map for: Adurolight_NCC, unicast to: 0x0000, endpoint: 0x01, cluster: 0xFCCC, command: 0x00, payload: 000300, zclSeq: 183

But I'm not sure how to proceed or what to make of cluster 0xFCCC which is labeled unknown in the deCONZ GUI.

@mdolnik
Copy link
Contributor

mdolnik commented Feb 26, 2021

Also regarding the manufacturer codes, is there a reason that this branch used VENDOR_JENNIC

{ VENDOR_JENNIC, "Adurolight_NCC", jennicMacPrefix}, // Eria Adurosmart Wireless Dimming Switch

When there is already a definition for VENDOR_ADUROLIGHT

#define VENDOR_ADUROLIGHT 0x122D

Does the vendor have to match the mac prefix?

@mdolnik
Copy link
Contributor

mdolnik commented Mar 1, 2021

Refer to the new Pull Request #4495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eria Adurosmart Wireless Dimming Switch - Request Support
3 participants