Smanar / Domoticz-deCONZ

deCONZ plugin for Domoticz (Zigbee application)
GNU General Public License v3.0
36 stars 27 forks source link

Lidl xmas LED string support #78

Closed sonar98 closed 3 years ago

sonar98 commented 3 years ago

let's put it in an issue.

2020-12-01 23:15:39.622 (Conbee) onCommand called for Unit 1: Parameter 'Set Level', Level: 20, Hue: 2020-12-01 23:15:39.623 (Conbee) >>>>>>>> / ID: 2289, Name: 'Kerstboom1', nValue: 0, sValue: '' 2020-12-01 23:15:39.624 (Conbee) Send Command /api/B9759983AD/lights/2/state with {'effect': ''} (0 in buffer) 2020-12-01 23:15:39.624 (Conbee) Making Request : http://127.0.0.1:80/api/B9759983AD/lights/2/state with params {'effect': ''} 2020-12-01 23:15:39.637 (Conbee) Request Return : [{"error":{"address":"/lights/2/state","description":"invalid value, , for parameter, effect","type":7}}] 2020-12-01 23:15:39.638 (Conbee) Classic Data : [{'error': {'address': '/lights/2/state', 'description': 'invalid value, , for parameter, effect', 'type': 7}}] 2020-12-01 23:15:39.638 Error: (Conbee) deCONZ error :{'error': {'address': '/lights/2/state', 'description': 'invalid value, , for parameter, effect', 'type': 7}}

Smanar commented 3 years ago

Yep, thx ^^. Ok, it will be fine now.

Not sure if the "off" value need to be none or "none", but other can work.

And about color change, what is working or not ?

sonar98 commented 3 years ago

Effects are all working except none. Effect none does nothing at this moment.

colors are working but not exactly the right colors. The device in domoticz is a RBG dimmer. Shouldn't this be a RGBW dimmer?

Smanar commented 3 years ago

I make with the ebaauw description

  • Set on for on/off. I added support for ontime, but the strip doesn't seem to support it;
  • Set hue (0 - 65535), sat (0 - 254), and bri (0 - 254) as HSL values for colour mode;
  • Set sat to 0 and bri (0-254) for white mode;
  • Set effect and, optionally, effectSpeed and effectColours for effect mode, e.g. {"effect": "flag", "effectSpeed": 10, "effectColours": [[255,0,0],[0,255,0],[0,0,255]]} The effects are: "steady", "snow", "rainbow", "snake", "tinkle", "fireworks", "flag", "waves", "updown", "vintage", "fading", "collide", "strobe", "sparkles", "carnival", "glow";
  • Set "effect": "none" to revert to previous mode (white or colour).

The effect = none is to disable the effect. And yes the device need to be a RGB + Temperature, code updated.

For the color, idk, it s probably due to device, there is same problem used with phoscon, you have the color obtained with full Red, full Green and Full Blue ?

Have added too a way to set speed and color

But idk how will react the device if you set 3 color and the effect use 2 or 4 ...

sonar98 commented 3 years ago

When moving away from page and back again the effect switch looses the choosen value: image

Putting the selector on "none" does nothing. log: 2020-12-02 21:46:13.877 (Conbee) onHeartbeat called 2020-12-02 21:46:16.734 (Conbee) onCommand called for Unit 1: Parameter 'Off', Level: 0, Hue: 2020-12-02 21:46:16.734 (Conbee) Send Command /api/B9759983AD/sensors/2/config with {'mode': 'off'} (0 in buffer) 2020-12-02 21:46:16.735 (Conbee) Making Request : http://127.0.0.1:80/api/B9759983AD/sensors/2/config with params {'mode': 'off'} 2020-12-02 21:46:16.748 Error: (Conbee) Connexion problem (1) with Gateway : 400

sonar98 commented 3 years ago

Looks like the saturation is not set to 100%. Changing color in phoscon works fine when putting saturation to max.

Changing color givrs following log: 2020-12-02 21:52:52.677 (Conbee) onCommand called for Unit 2: Parameter 'Set Color', Level: 100, Hue: {"b":0,"cw":0,"g":255,"m":3,"r":244,"t":0,"ww":0} 2020-12-02 21:52:52.679 (Conbee) Send Command /api/B9759983AD/lights/2/state with {'on': True, 'xy': [0.430195, 0.5284], 'bri': 254, 'transitiontime': 0} (0 in buffer) 2020-12-02 21:52:52.679 (Conbee) Making Request : http://127.0.0.1:80/api/B9759983AD/lights/2/state with params {'on': True, 'xy': [0.430195, 0.5284], 'bri': 254, 'transitiontime': 0} 2020-12-02 21:52:52.708 (Conbee) Request Return : [{"error":{"address":"/lights/2/state","description":"parameter, transitiontime, not available","type":6}},{"error":{"address":"/lights/2/state","description":"parameter, xy, not available","type":6}},{"success":{"/lights/2/state/on":true}},{"success":{"/lights/2/state/bri":254}}] 2020-12-02 21:52:52.709 (Conbee) Classic Data : [{'error': {'address': '/lights/2/state', 'description': 'parameter, transitiontime, not available', 'type': 6}}, {'error': {'address': '/lights/2/state', 'description': 'parameter, xy, not available', 'type': 6}}, {'success': {'/lights/2/state/on': True}}, {'success': {'/lights/2/state/bri': 254}}] 2020-12-02 21:52:52.709 Error: (Conbee) deCONZ error :{'error': {'address': '/lights/2/state', 'description': 'parameter, transitiontime, not available', 'type': 6}} 2020-12-02 21:52:52.709 Error: (Conbee) deCONZ error :{'error': {'address': '/lights/2/state', 'description': 'parameter, xy, not available', 'type': 6}}

Smanar commented 3 years ago

Have updated for the effect "none".

Not corrected the return yet, need more change for that, but you will have it tommorow.

Smanar commented 3 years ago
{
  "etag": "765141a6915c0c78b8399aea0f3096ee",
  "hascolor": true,
  "lastannounced": null,
  "lastseen": "2020-11-29T22:13Z",
  "manufacturername": "_TZE200_s8gkrkxk",
  "modelid": "TS0601",
  "name": "Color dimmable light 13",
  "state": {
    "bri": 2,
    "colormode": "hs",
    "effect": "tinkle",
    "hue": 0,
    "on": true,
    "reachable": true,
    "sat": 0
  },
  "swversion": null,
  "type": "Color dimmable light",
  "uniqueid": "58:8e:81:ff:fe:d8:83:cc-01"
}

You have too "colormode": "hs", or xy ?

sonar98 commented 3 years ago

{ "etag": "8e04bed8d6197a4f5a80d8f03d835f58", "hascolor": true, "lastannounced": null, "lastseen": "2020-12-02T21:01Z", "manufacturername": "_TZE200_s8gkrkxk", "modelid": "TS0601", "name": "Kerstboom", "state": { "bri": 251, "colormode": "xy", "effect": "waves", "hue": 45585, "on": true, "reachable": true, "sat": 254 }, "swversion": null, "type": "Color dimmable light", "uniqueid": "58:8e:81:ff:fe:db:7e:9a-01", "id": "2", "deviceclass": "lights" }

sonar98 commented 3 years ago

And none still not working.

Log: 2020-12-02 22:02:11.303 (Conbee) onCommand called for Unit 1: Parameter 'Off', Level: 0, Hue: 2020-12-02 22:02:11.304 (Conbee) Send Command /api/B9759983AD/sensors/2/config with {'mode': 'off'} (0 in buffer) 2020-12-02 22:02:11.304 (Conbee) Making Request : http://127.0.0.1:80/api/B9759983AD/sensors/2/config with params {'mode': 'off'} 2020-12-02 22:02:11.322 Error: (Conbee) Connexion problem (1) with Gateway : 400

Smanar commented 3 years ago

Harf, need to ask ebaauwn, you have a problem with your device, he is reconised as XY color.

I have added a hack to force "HS" mode waiting for information

You need to delete the "effect selector", it will be recreated on the next restart, with hidding the "off" position, so you will not have

onCommand called for Unit 1: Parameter 'Off', Level: 0, Hue:

Only set level.

Smanar commented 3 years ago

And btw, you can too delete the light widget, same, it will be re-created but with RGB + temperature setting.

sonar98 commented 3 years ago

Colormode still says: xy and sat is set to 127. Full sat should be 254

reloading page now always shows glow as effect: image

colorcircle does not schow the choosen color after reopening. image

Smanar commented 3 years ago

Colormode still says: xy

Yep, it can happen, some ikea device have this bug too, ATM im using a hack, but the plugin can guess it s a bad value, you haven't "xy" field in state but "hue" and "sat". But this problem is from deconz, not the plugin, and this field is not reliable, so better to improve the plugin on my side.

and sat is set to 127. Full sat should be 254

You can have all value, it depend on color, no ? (if you use RGB) The temperature color is working ? or do I need to set "sat" to 0 ?

reloading page now always shows glow as effect:

Corrected, (I think)

colorcircle does not schow the choosen color after reopening.

Idk if i can correct that (it s tuya command, not standard zigbee one), do you have the websocket return when you set a color ?

sonar98 commented 3 years ago

If I want the colors to match the colors in the color picker the saturation needs to be at a maximum (254) value. I can't change the saturation. If setting the levels in the phoscon web app the colors act the same as in domoticz when I put the saturation at 50%.

I can't try anything until saturday because the lights are gift wrapped right now for Saint Nicholas (5 dec) :-)

Smanar commented 3 years ago

Ok, Idk if I m right, but I have found a problem on color gestion. I think the new code will be better

Happy St Nicholas :)

sonar98 commented 3 years ago

Color is working well right now.

sonar98 commented 3 years ago

When switching to warm White it is not working as expected. It does niet change to White mode.

Smanar commented 3 years ago

Set sat to 0 and bri (0-254) for white mode;

So I have made an ugly hack to convert temperature color to brighness ^^

The color probably not correspond, but It will work, new version to test.

sonar98 commented 3 years ago

yes this hack is actually working rather well. I'm thinking if I can come up with a better option for the parameters colors and speed for the effects. the description field works but you have to remember the values etc. Maybe some dummy switches? 3x color picker and 1x speed value?

Smanar commented 3 years ago

IDK, I have searched but

So for the moment I haven't found better way, if you have an idea ?

A custom widget with predefined values set by the user ? But that will be easier using LUA script than python code.

Else I will soon make the changes official, will be better before the 15 january ^^

sonar98 commented 2 years ago

Hi @Smanar

Today we were decorating the X-mas tree again and wanted to use the LED string again. Last year I had two devices in domoticz.

When adding them again this year only an RGB switch shows in Domoticz

image

Did something change?

sonar98 commented 2 years ago

I think I found the problem.

It is now recognized by the conbeeII.

image

In the code it has an if: if Manuf == '_TZE200_s8gkrkxk':

Changed it to: if Model == 'HG06467':

now it works again.

Smanar commented 2 years ago

I have valided the PR but I don't see why if Manuf == '_TZE200_s8gkrkxk': have not worked, it s still the same ....

sonar98 commented 2 years ago

The manufacturername is now filled with another value. It does not show the _TZE200_etc anymore.

New situation: image

Old situation: image

Smanar commented 2 years ago

Arf :( Realy bad idea, so BTW thx a lot for correction ^^