Smanar / Domoticz-deCONZ

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

Sensors state not updated #99

Closed Atreiide closed 3 years ago

Atreiide commented 3 years ago

Hello,

First of all thanks for this great work

I just did a fresh install as I made some errors on previous installation but after have added already existing sensor (Xiaomi Door sensor), value of the sensor is not updated. This is updated only if I restart domoticz. Once domoticz is restarted, if I close (or open) the door, value (open/close) is not updated.

I checked directly with conbee api and I can see value is well updated. So issue is on the plugin but can't succeed to debug it

Conbee version : 2.05.88 / 15/10/2020 Conbee firmware : 26660700 Conbee is installed on the same machine than Domoticz and running headless (no gui)

Strange thing : issue is not concerning zigbee plug like OSRAM Smart Plug and Xiaomi temperature sensors but only Xiaomi door sensors, switch, and water sensors

Strange thnig 2 : If I add a brand new Xiaomi switch device, it's working. Device is updated

Smanar commented 3 years ago

Hello

If I add a brand new Xiaomi switch device, it's working. Device is updated

A powered one or battery one ? It seem you have problem with websocket, you can send command, but not receive data like sensor report. When domoticz start it ask itself for value, so they are updated, but after that they are updated only using the websocket.

Have you tried to set the debug level (on the plugin hardware page) as "debug info only" ? Nothing special on it when you restart the plugin (hardware/deconz/update) ? no return when you open or close the door ?

Atreiide commented 3 years ago

A battery one.

Yes. Activated debug level (info only and also Basic + messages) and didn"t seen any specific messages.

"you can send command, but not receive data like sensor report." Yes and no. I can receive values from temperature sensors (battery powered) but not receive from switch, doors and water sensors

Final strange thing : I went away for some hours, didn't applied any change, and all came back functionnal.

That's great but I would like to understand what is the cause as this is not the first time it happen. When you speak about web socket, this is which web socket ? The one from the plugin ? Any way to debug it or monitor it ?

Smanar commented 3 years ago

The deconz server propose a websocket connection, support multiple connexion, there is one betwwen your browser and deconz when using phoscon, there is one domoticz<>deconz, and you can use browser plugin extension to test it too, on my side I m using "Browser websocket client" on firefox.

But you will have error message in domoticz in the connexion fails. And it s not possible having some device working and some other not.

I can receive values from temperature sensors (battery powered) but not receive from switch, doors and water sensors

If you have websocket issues, all need to stop send notifications. You can use phoscon too to check websocket working mode, if values are updated in phoscon and not domoticz > problem.

Can be connexions issue, Xiaomi devices make at least one notification every hour, if you have a device with more than 1 h without notification, it s strange, can be the battery (> 80%), or a connexion issue (visible on logs, need to check routers, perturbations, ...)

BTW, Xiaomi can have issues with Osram > https://community.hubitat.com/t/xiaomi-aqara-devices-pairing-keeping-them-connected/623

Atreiide commented 3 years ago

Yep i heard about issue between OSRAM and Xiaomi devices, after have baught ten OSRAM devices ;-)

Just to be sure to understand : Domoticz-deCONZ plugin is a client of deconz websocket ? Installed "Browser websocket client" but not sure about the url ....Tested with ws://:8080 and ws:///api/:8080 but have "CLOSED. Disconnected by the server."

Is it equivalent to do some curl requests on deCONZ API ?

Smanar commented 3 years ago

On my side I m using as url ws://192.168.1.1:8088 It s deconz IP (or domoticz as you are using same machine), same than for the API, and the websocket port (I can explain how to find it in the API in "config", else it s displayed on log if I m right)

Just to be sure to understand : Domoticz-deCONZ plugin is a client of deconz websocket ?

Yep

Is it equivalent to do some curl requests on deCONZ API ?

REST Request are 1 Request > 1 Answer, Websocket connexion is a permanent connexion.

But I m stupid, there is a beta feature in phoscon to have all : http://phoscon.de/pwa Go to check in help / api information, you will have all you need, API, Config, websocket, ect ...

Atreiide commented 3 years ago

Ok found port using API /config. Thanks for your time to help ! :-)

Atreiide commented 3 years ago

Solved