dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 502 forks source link

Power-on behavior #1055

Closed TimmyUll closed 5 years ago

TimmyUll commented 5 years ago

When updating and change power-on behavior on Hue-lights to "last uses color and brightness". Then connect them to conbee again. The Power-on behavior changes back to 100% White light regardless what previous state was.

Mimiix commented 3 years ago

@theCroh That works exactly the same :)

TheAlphaLaw commented 3 years ago

Has anyone found a way to do this with Hass.IO deCONZ addon?

I can't get the above to work in either. This should be built in by now...

theCroh commented 3 years ago

@theCroh That works exactly the same :)

Okay. How do I do this: "-- after editing general.xml (in /usr/share/deCONZ/zcl)." when there is no deCONZ folder in /use/share/ folder of my Hass.IO system? I have no idea, where the general.xml is but I'm sure, it's not in the folder mentioned in the guide.

Mimiix commented 3 years ago

You should ask in the HA git/helpchannels then, as i have no clue where it stores it. @theCroh

Either way. The HA Addon does provide a deCONZ web interface and you can change attribute in the on/off cluster (0x4003) afaik.

theCroh commented 3 years ago

I got the settings enabled in Hass.IO deCONZ addon by following these instructions: https://community.home-assistant.io/t/where-to-find-general-xml-in-deconz/206739/5

Basically, you first need to use command "docker cp addon_core_deconz:/usr/share/deCONZ/zcl/general.xml ." (without the quotes but including the dot) in Terminal in Home Assistant to copy the settings file from the docker container. Then you need to edit it and while restarting deCONZ (when it's booting up), use command "docker cp general.xml addon_core_deconz:/usr/share/deCONZ/zcl/" to copy the file back inside the container. I was having a hard time getting the timing right so I just restarted deCONZ in one window and repeated the command for a while in another window. That way I could apply the settings.

I also tried to edit the file inside the container using Portainer addon but found no way to make it work since deCONZ needs to be restarted in order to apply the settings and restarting seems to reset the container.

theCroh commented 3 years ago

I'm still unable to get this to work with at least Philips Hue Being light.

"OnOff cluster 0x0006, PowerOn OnOff attribute 0x4003 to value Previous (0xff)."

"Level Control cluster 0x0008, PowerOn Level attribute 0x4000 to value 255 (0xff)."

"Color Control cluster 0x0300, PowerOn Color Temperature attribute 0x4010 to value 65536 (0xffff)."

SHxKM commented 3 years ago

@theCroh - same here but with ZHA (using Conbee) which to me indicates these values may have been updated since @ebaauw latest post.

Edit: but 65535 works! I only needed to change:

OnOff cluster 0x0006, PowerOn OnOff attribute 0x4003 → 0xff Level Control cluster 0x0008, PowerOn Level attribute 0x4000 → 255 Color Control cluster 0x0300, PowerOn Color Temperature → 65535

I didn't need to change the X & Y values (I couldn't persist them anyway).

theCroh commented 3 years ago

@theCroh - same here but with ZHA (using Conbee) which to me indicates these values may have been updated since @ebaauw latest post.

Edit: but 65535 works! I only needed to change:

OnOff cluster 0x0006, PowerOn OnOff attribute 0x4003 → 0xff Level Control cluster 0x0008, PowerOn Level attribute 0x4000 → 255 Color Control cluster 0x0300, PowerOn Color Temperature → 65535

I didn't need to change the X & Y values (I couldn't persist them anyway).

I can set the values as you say but the lamp still turns on with the default warm bright light.

My OnOff cluster looks like this: 0006

Level Control cluster like this: 0008

And Color Control cluster like this: 0300

Am I missing something obvious?

SHxKM commented 3 years ago

@theCroh - Sometimes it takes a light a little time to commit its state, maybe you were doing the same as I was an immediately disconnecting it to see if it works? :)

ebaauw commented 3 years ago

I can set the values as you say but the lamp still turns on with the default warm bright light.

Some lights carry the attributes, but don't honour them. What type of light is this? What do the PowerOn attributes report after power cycling the light?

What's the color mode after power on? If it's xy, you might need to set PowerOn X and PowerOn Y. Afaik, only Hue lights support these. To set these from the deCONZ GUI, you need to comment out the regular Current X and Current Y attributes in general.xml: https://github.com/dresden-elektronik/deconz-rest-plugin/blob/f46e3321715f755a057c19992e51ce9cf6f01e35/general.xml#L2138-L2139 Next, uncomment the PowerOn versions: https://github.com/dresden-elektronik/deconz-rest-plugin/blob/f46e3321715f755a057c19992e51ce9cf6f01e35/general.xml#L2207-L2210 Make sure to restart deCONZ for the changes to take effect.

Note that the PowerOn versions use the Philips Manufacturer Code 0x100b.

theCroh commented 3 years ago

@theCroh - Sometimes it takes a light a little time to commit its state, maybe you were doing the same as I was an immediately disconnecting it to see if it works? :)

This is probably the issue. User stupidity error also known as ID-10T error in customer support lingo. I read from somewhere that it takes about seven seconds for the values to stick and my tests may very well have been:

  1. Turn the light on ✔️
  2. Adjust it somehow ✔️
  3. Instantly turn the light off ❌
  4. Turn the light on
  5. Swear
  6. Tinker something and repeat from 1

Some lights carry the attributes, but don't honour them. What type of light is this? What do the PowerOn attributes report after power cycling the light? What's the color mode after power on? If it's xy, you might need to set PowerOn X and PowerOn Y. Afaik, only Hue lights support these. To set these from the deCONZ GUI, you need to comment out the regular Current X and Current Y attributes in general.xml:

It's Philips Hue Being (this one https://www.philips-hue.com/en-gb/p/hue-white-ambiance-being-ceiling-light/3261031P6). The values seem to stick after reboot and color mode is "Color temperature" so the problem is probably sitting in front of the keyboard as suggested by @SHxKM above 😄

Sorry for the bother and thank you for the help.

ebaauw commented 3 years ago

The light needs to save the settings to non-volatile memory, similar to creating a scene or adding a group. After writing, I like to wait a couple of seconds and then read back the attributes, just in case.

jonferreira commented 3 years ago

Hey all.

Have a couple sockets / relays I'd like to change default behavious but can't seem to do it. Soon as I click "read" the all get the PowerOn option Greyed out:

image

Smanar commented 3 years ago

Generaly it mean "not supported".

jonferreira commented 3 years ago

Generaly it mean "not supported".

Agree but for what I could read these support PowerOn.

That particular screenshot is from a BlitzWolf SHP13 and I just come across this https://github.com/dresden-elektronik/deconz-rest-plugin/issues/2988#issuecomment-793995630

Also I just tried the same on a Hue Bloom which deffo supports it (you can set it via the official Hue app) and same thing happens, greyed out

Smanar commented 3 years ago

If I m right you have an error message displayed just after you press the "read" button ? Some device use another attribute, like osram https://github.com/dresden-elektronik/deconz-rest-plugin/issues/2725#issuecomment-620025371

On z2m, if i m right they are using 0x8002 on cluster 0x0006 for this tuya device, with thoses values const dict = {0x00: 'off', 0x01: 'on', 0x02: 'restore'};

For another it s on cluster 0x0000 attribute 0xFFF0

jonferreira commented 3 years ago

If I m right you have an error message displayed just after you press the "read" button ? Some device use another attribute, like osram #2725 (comment)

On z2m, if i m right they are using 0x8002 on cluster 0x0006 for this tuya device, with thoses values const dict = {0x00: 'off', 0x01: 'on', 0x02: 'restore'};

Thanks for a quick reply. I've not seen any error when I click "read", only change I've seen where the two lines greyed out after clicking "read".

Would you mind sharing how I'd be able to write 0x8002 via deconz, i.e. how to write new attributes that aren't listed on that window?

BTW this is what I see in the logs when I click "read":


22:50:04:983 ZCL got data for node=0x0A2B, cl=0x0006, at=0x0000, status=0x00, type=0x10
22:50:06:704 ZCL read cluster: 0x0006, attribute: 0x0000
22:50:06:705 ZCL read cluster: 0x0006, attribute: 0x4001
22:50:06:705 ZCL read cluster: 0x0006, attribute: 0x4002
22:50:06:706 ZCL read cluster: 0x0006, attribute: 0x8001
22:50:06:706 ZCL cmd-req nwk: 0x3A0F, profile: 0x0104, cluster: 0x0006 cmd: 0x00
22:50:06:756 ZCL got data for node=0x3A0F, cl=0x0006, at=0x0000, status=0x00, type=0x10
22:50:06:756 ZCL got data for node=0x3A0F, cl=0x0006, at=0x4001, status=0x00, type=0x21
22:50:06:757 ZCL got data for node=0x3A0F, cl=0x0006, at=0x4002, status=0x00, type=0x21
22:50:06:757 ZCL got data for node=0x3A0F, cl=0x0006, at=0x8001, status=0x00, type=0x30```
Smanar commented 3 years ago

Easy, it s just a xml file to edit /usr/share/deCONZ/zcl/general.xml

Then restart deconz, but I m not sure for path.

jonferreira commented 3 years ago

Easy, it s just a xml file to edit /usr/share/deCONZ/zcl/general.xml

Then restart deconz, but I m not sure for path.

OK thanks, will see if I can figure out how to do that on the docker image

jonferreira commented 3 years ago

Easy, it s just a xml file to edit /usr/share/deCONZ/zcl/general.xml

Then restart deconz, but I m not sure for path.

So good news and bad news.

Good news are that this worked perfectly first try, pretty easy thanks to your explanation.

Bad news is that, even though with the attribute now set to ON I see some weird behaviour.

Power Off Unplug (wait few seconds) Plug in Socket goes On - perfect! Power Off Unplug (wait few seconds) Plug in Socket stays off!

Smanar commented 3 years ago

Lol, effectively, it s a strange working mode ...

But not more idea to explain that, perhaps a timer ?