PatchworkBoy / homebridge-edomoticz

Domoticz Homebridge-Plugin
Other
118 stars 44 forks source link

Domoticz devices not showing in Homebridge/Homekit #282

Closed ronzelver closed 1 month ago

ronzelver commented 1 month ago

After I have moved my Domoticz instance to a new platform, I have successfully restored the backup and the connections to all USB connected RX/TX devices. I can see and control everything from within Domoticz. After reconfiguring the homebridge/edomoticz plugin it successfully connects to Domoticz but it doesn't load any of the devices?!?

OS: Ubuntu 24.04 LTS NodeJS: 20.12.2 Homebridge: 1.8.2 Edomoticz: 2.1.49 Domoticz: 2024-4

Startup logging of the plugin: [5/18/2024, 3:56:41 PM] [Domoticz] Restarting Process... [5/18/2024, 3:56:41 PM] [Domoticz] Launched child bridge with PID 6707 [5/18/2024, 3:56:41 PM] Registering platform 'homebridge-edomoticz.eDomoticz' [5/18/2024, 3:56:41 PM] [Domoticz] Loaded homebridge-edomoticz v2.1.49 child bridge successfully [5/18/2024, 3:56:41 PM] Loaded 0 cached accessories from cachedAccessories.0EADC3EB1675. [5/18/2024, 3:56:41 PM] [Domoticz] synchronizeAccessories in progress... [5/18/2024, 3:56:41 PM] Homebridge v1.8.2 (HAP v0.12.1) (Domoticz) is running on port 35354.

I have already removed/re-registered the plugin in Homekit without results. All other plugins (Nefit Easy, Daikin, Ring) are working correctly with Homebridge/Homekit.

PatchworkBoy commented 1 month ago

Child bridging has never worked with this plug-in that I’m aware of I’m afraid (unless someone can tell me otherwise).

Does it work when not configured as a child bridge?

Have you tried clean reinstall of plug-in after backing current config / cache up and removing?

ronzelver commented 1 month ago

Even without bridging it doesn't load any devices. With the previous working setup I was able to get bridging working as well, but maybe because everything was already cached/persistent from the non-bridged setup.

I have done a clean install of the plugin, after removing all config/cache and restarting homebridge, but still no results?!?

PatchworkBoy commented 1 month ago

I suspect something's invalidated something in sign / paired client keys (in persist/AccessoryInfo..json

Unfortunately usually means dropping the specific file for the root bridge, and removing / repairing bridge with Home

I think... (or not, cos that would logically affect all plugins, so ignore that I think it's this:)

OR (and I'd check this first) the user the plugin is auth-ing as to Domoticz hasn't had devices added to it via setup > users > (user) set devices button, or a user hasn't been created in Domoticz and configured in the plugin? Go make a new user in Domoticz,set devices and add what you want exposed to them, then config plugin to use that user and reboot the bridge.

PatchworkBoy commented 1 month ago

nudge to ping a notification for edits to prev reply

ronzelver commented 1 month ago

I have used the same user account in Domoticz as before, but I have reconfigured the device allocation for this user, but still no changes.

ronzelver commented 1 month ago

Is there a way I could add additional logging to troubleshoot this issue? The default -D flag doesn't really add anything useful. I have reconfigured homebridge and only the Edomoticz plugin from scratch and I have verified the connection with the Domoticz instance (port 6144 for remote clients) using netstat:

$ netstat | grep 6144 tcp 0 0 localhost:52816 localhost:6144 ESTABLISHED tcp6 0 0 localhost:6144 localhost:52816 ESTABLISHED

I also see a confirmation of the incoming connection in Domoticz:

... Status: Incoming Domoticz connection from: 127.0.0.1

Both Domoticz and HomeBridge run on the same Ubuntu server.

But still no accessoires....

As a test I changed the remote client port in the Domoticz configuration and this resulted in the following error message: [5/19/2024, 11:01:06 AM] [Domoticz] There was a problem connecting to Domoticz.

ronzelver commented 1 month ago

I have restored a backup of the previous working version (with all cached information) and all Domoticz accessories result in similar log messages:

[5/19/2024, 11:21:17 AM] [homebridge-edomoticz] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.

I have also reverted Domoticz back to an older version (2023.2) and re-installed the plugin, but still no success...

PatchworkBoy commented 1 month ago

If a clean install of plugin and re-pairing with the bridge doesn't work, the problem is between plugin and Domoticz, which can only be the user it's connecting as.

All the plugin does is issue a https request to json.htm with basic auth to get device list.

Recreate that in postman / node-red or similar and check the Domoticz API response when using all same details as configured in plugin.

ronzelver commented 1 month ago

I have finally found the issue, I was using the remote client port (default 6144) to Domoticz and now I changed it back to the default web interface port 8080 in the plugin. I don't know why I turned up to use this other port (probably because of another unrelated issue). Anyway, many thanks for your responses and suggestions, highly appreciated!