Smanar / Domoticz-deCONZ

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

Domoticz offline after entering API-key in DeCONZ hardware #121

Closed VincentvdH-91 closed 2 years ago

VincentvdH-91 commented 2 years ago

I've completely followed the instruction here on Github to get the deCONZ plugin running in my Domoticz, however at one of the last steps my Domoticz kicks me out and appears 'offline'. Via SSH I've created the API key on my IP-adress, as soon as I enter this API-key into the 'hardware section' in Domoticz, I can no longer access the Domoticz website. The only way to get this fixed is removing the deCONZ folder from my Domoticz/plugins folder on my RPI and restart the Domoticz service.

Without the API-key entered everything looks ok and to be properly installed. Please find screenshots attached. Any ideas how to get this fixed?

Domoticz deCONZ hardware settings - incorrect API Domoticz deCONZ page - incorrect API

Regards, Vincent

Smanar commented 2 years ago

Ha yes, I think it s becuse of that https://github.com/Smanar/Domoticz-deCONZ/issues/82 For the moment, the easier solution is using the http url to access the frontend, the plugin can work with the https one, only the front end can't work for the moment.

VincentvdH-91 commented 2 years ago

Thanks for your quick response, but I'm not using the https URL at all, everything is done on the http URLs

Smanar commented 2 years ago

Ha ? Some days ago the url https://phoscon.de/discover was broken, server issue, it's working now on your side ? What is your domoticz version ? (2021.1 ?)

You have something in domoticz logs when (re-)starting the plugin ? On your capture it's the deconz frontend that is freezing, but if I have understand it's all domoticz that is freezed, even you don't go on the deconz front end ?

And if you just try to delete the front end files ? In Domoticz\www\templates ? (but will be re-created on plugin restart)

VincentvdH-91 commented 2 years ago

Hi, The phoscon part is working, I can access my devices via "myIP"/pwa and control the lights & and add new ones there.

Domoticz version is indeed 2021.1

The screenshot is taken before I've entered the correct API, this is also shown in the Domoticz Log "incorrect API". However as soon as I fill in the API in the hardware section, I'm not able to access Domoticz at all. It gives in my browser the "offline" status "myIP"/Offline. When I remove the plugin from the Domoticz folder I can access Domoticz succesfully again, but of course without the deCONZ plugin.

Is there a way to access the crash log to see on what error Domoticz is crashing? As I can't access the webpage I can't go into the "log" there. I've tried to open the crash-log on my RPI, but there's for some reason a permission error (even when I acces it via SSH with a text editor)

Smanar commented 2 years ago

Happy new year ^^

When you have your api keu, can you test it using for exemple a browser ? http://DECONZ_IP:PORT/api/YOU_API_KEY/sensors

Have you tried with "sudo" to read your logs ?

Generaly Domoticz frezze because of python version, but it s strange the plugin is working up you give the good api key, and if you give a random key ? The code probably don't make request before the setting was completed, and it freeze at first python http request.

What is your python version ? and the python request one ? sudo -H pip3 install requests

VincentvdH-91 commented 2 years ago

Thanks, happy new year for you too!

I've made another set of screenshots, divided into 3 parts in the ZIP folder Part 1 - Domoticz running without the deCONZ hardware added, but with the plugin installed Part 2 - deCONZ hardware added, but with pre-filled (incorrect) API Part 3 - Completed API_KEY as per instruction --> Crashed Domoticz

I indeed tried with sudo to read the logs, but that didn't work.

Not taken screenshot, but in first instance I generated the API_KEY with my external IP (instead of the 127.0.0.1), I've not taken screenshots of this trial, but can confirm that this all looks the same as in Part 2 of the screenshots attached --> front end present, Domoticz working, but fault message 'wrong API'.

My Python version is 3.9.2, with the python request one it tells me 'Requirement already satisfied'

02-01-2022.zip

Smanar commented 2 years ago

My Python version is 3.9.2

You are on bulleyes ? This version is not supported yet by domoticz https://www.domoticz.com/forum/viewtopic.php?f=6&t=37376&hilit=Bullseye

Else It's strange because you have made a request to have this error message, and without crash, strange having a crash later ....

VincentvdH-91 commented 2 years ago

That looks indeed like the cause of the issue. As far as I can see there's not a solution yet, I'll workaround it temporarily and await the definitive solution for the bullseye/python issue.

Smanar commented 2 years ago

Yep, they are working on it, but they need to recode some part because the "engine" that execute the python code inside the c++ core.

Smanar commented 2 years ago

I think the beta works fine ATM with BullEyes.

VincentvdH-91 commented 2 years ago

Thanks for confirming that Smanar, which beta are you on currently?

Smanar commented 2 years ago

On 14092, but I m not on bulleyes ^^ It s a return from others users.

VincentvdH-91 commented 2 years ago

I was wondering, as I'm now on 3.9.2, if I should update it to 3.10 straight away, or stick with the newest 3.9 version. To what does 14092 refer?

Smanar commented 2 years ago

14092 is my domoticz build number, but it s a realy old version. On python I m on the version 3.7

And no, don't go to 3.10 (realy too much recent), better to use the 3.9

VincentvdH-91 commented 2 years ago

Ok thanks, but should I go to latest beta for Domoticz or Python? I orignally tought that I needed to update python to latest beta, but am in doubt as you were referring to your Domoticz version.

Smanar commented 2 years ago

Why do you want to upgrade your python version ? Just use the defaut version you have. The problem was with the defaut python version in bulleyes, the 3.9 that crash domoticz.

So if you have bulleyes you just need to use the beta version of domoticz (that support now the 3.9)

VincentvdH-91 commented 2 years ago

For some reason I was under the impression that it was a python issue, but apparently it wasn't. I've just updated my Domoticz to latest beta and can confirm all works perfectly fine now! May thanks for your support.

BluffPearce commented 2 years ago

I had the same issue after a clean install. When i entered the api key, domoticz webpage went offline. I rename the plugin and restarted Domoticz. Did an upgrade to Domoticz V2022.1 (build 14318) and renamed the plugin again to plugin.py The webpage was accesible and the devices where recongized. So it's working (for now)

Smanar commented 2 years ago

Take care not having 2 times the plugin in the "plugin" directory.