dresden-elektronik / deconz-rest-plugin

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

_TZ3000_xzqbrqk1 inverted state #4634

Closed bastshoes closed 3 years ago

bastshoes commented 3 years ago

Describe the bug

After upgrade to 2.10.04 blinds switch reports inverted state.

{
    "etag": "c692cfa81a495f8f33fdc1f2f4fbdab4",
    "hascolor": false,
    "lastannounced": null,
    "lastseen": "2021-03-24T12:32Z",
    "manufacturername": "_TZ3000_xzqbrqk1",
    "modelid": "TS130F",
    "name": "Livingroomr Blinds",
    "state": {
        "bri": 254,
        "lift": 100,
        "on": true,
        "open": false,
        "reachable": true
    },
    "swversion": null,
    "type": "Window covering device",
    "uniqueid": "5c:02:72:ff:fe:ca:a1:9b-01"
}

Steps to reproduce the behavior

Upgrade to 2.10.04 from 2.09.03

Expected behavior

Report proper state

Screenshots

Environment

deCONZ Logs

Additional context

Mimiix commented 3 years ago

@Smanar Did you integrate it?

bastshoes commented 3 years ago

Last known working version is 2.09.03

Smanar commented 3 years ago

IDK what happen, I m comparing the version 2.9.3 and 2.10.4, https://github.com/dresden-elektronik/deconz-rest-plugin/compare/v2.9.3...v2.10.4 And the only difference I m seing is the productid change from "11830304(2) Switch" to "Zigbee curtain switch", but the code handle them the same way.

Remove            R_GetProductId(taskRef.lightNode) == QLatin1String("11830304(2) Switch") ||
Add                  R_GetProductId(taskRef.lightNode) == QLatin1String("Zigbee curtain switch") ||

You are sure for versions ? No beta one ?

bastshoes commented 3 years ago

Yes. I'm sure.

I've tried all betas (2.10.03, 2.10.02, 2.10,01) and all reports inverted state. When I've returned to 2.09.03 all works fine.

I've noticed one strange thing. State shows correctly after upgrade from 2.09.03 to any version. But it will be inverted on first device state change.

bastshoes commented 3 years ago

@Smanar I guess I've found the problem.

If I sent GET API call on curtain switch I see the following in the logs

19:39:35:701 Websocket 172.18.0.1:58902 send message: {"attr":{"id":"7","lastannounced":null,"lastseen":"2021-03-24T16:39Z","manufacturername":"_TZ3000_xzqbrqk1","modelid":"TS130F","name":"Livingrooml Blinds","productid":"11830304(2) Switch","swversion":null,"type":"Window covering device","uniqueid":"5c:02:72:ff:fe:ca:a1:e4-01"},"e":"changed","id":"7","r":"lights","t":"event","uniqueid":"5c:02:72:ff:fe:ca:a1:e4-01"} (ret = 366)

ProductId is still prevoius one - "productid":"11830304(2) Switch"

That is way it's changed behavior.

How can I change productid?

bastshoes commented 3 years ago

Deleting device and adding it again gives right productid and fixes the issue.

Smanar commented 3 years ago

ha yes nice, I think the old one was memorised on the database, good to know, thx a lot, I think you will not be the only one with this kind of issue with all the chnage I do all the time.

bastshoes commented 3 years ago

For sure. Do we have any tool, that can check item productid and change it on start?

Smanar commented 3 years ago

It more my fault ^^, produc id is not made to be changed at every version, but this code will move again soo, deconz will use another approch to manage devices, easier for us and for you.

bastshoes commented 3 years ago

Will repair required?

Smanar commented 3 years ago

For the future modification ? IDK yet, I hope no, but the code will use JSON file, so big change, easier to custom with users shy with c++ or without linux machine.

github-actions[bot] commented 3 years ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] commented 3 years ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.