PatchworkBoy / homebridge-edomoticz

Domoticz Homebridge-Plugin
Other
118 stars 43 forks source link

[Domoticz] missing accessories after upgrades #270

Closed freeforall2 closed 1 year ago

freeforall2 commented 1 year ago

Hello,

After upgrading Domoticz and homebridge-edomoticz, a few accessories don't show up anymore in Homebridge (I was using them for years).

Current versions:

Tried the following but didn't get any positive results:

The common point between all missing devices is that they are all coming from the same hardware in Domoticz which is a ConbeeII Zigbee device (added in Domoticz through DeconZ plugin). The missing devices are a mix of temperature sensors and power plug switches.

Log Below is the log. It doesn't show any problem with synchronisation:


[9/30/2023, 12:43:58 PM] Registering platform 'homebridge-edomoticz.eDomoticz'
[9/30/2023, 12:43:58 PM] [Domoticz] Loaded homebridge-edomoticz v2.1.47 child bridge successfully
[9/30/2023, 12:43:58 PM] Publishing bridge accessory (name: Domoticz, publishInfo: {
  username: '0E:7E:C9:2A:76:A6',
  port: 33658,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'ciao'
}).
[9/30/2023, 12:43:59 PM] [Domoticz] synchronizeAccessories in progress...
[9/30/2023, 12:43:59 PM] Homebridge v1.6.1 (HAP v0.11.1) (Domoticz) is running on port 33658.
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Capteur Porte d'entrée (443)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Capteur de mouvement Couloir (445)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Capteur de mouvement Salon (448)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Capteur de présence Couloir Lux (444)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Capteur de présence Salon Lux (447)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Détecteur fumée chambre Parents (438)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Name1 (61)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Gateway Alarm (426)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Gateway Lumière (425)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Gateway Lux (434)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Gateway Vol (430)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Name2 (768)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Parents (778)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Salle d'Eau (754)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Salle-de-Bain (433)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Security Panel (446)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Name1 (4)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Name1 - Fermeture auto (128)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Name2 (13)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Name2 - Fermeture auto (129)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Parents (3)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Parents- Fermeture auto (123)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Parents- Timer 25 min (370)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Salle-à-manger (1)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Salon - Fermeture Auto (436)
[9/30/2023, 12:43:59 PM] [Domoticz] Device: Volets Séjour (2)
[9/30/2023, 12:43:59 PM] [Domoticz] There was an error while getting the MQTT Hardware Device from Domoticz.
Please verify that you have added the MQTT Hardware Device and that the hardware device is enabled.
[9/30/2023, 12:43:59 PM] Homebridge v1.6.1 (HAP v0.11.1) (Google Smart Home) is running on port 58423.

Output of /json.htm?type=command&param=devices_list from domoticz


{
    "result" : 
    [
        {
            "idx" : "450",
            "name" : "Automatic Alarm",
            "name_type" : "Automatic Alarm (Lighting 1/X10)"
        },
        {
            "idx" : "445",
            "name" : "Capteur de mouvement Couloir",
            "name_type" : "Capteur de mouvement Couloir (Light/Switch/Switch)"
        },
        {
            "idx" : "448",
            "name" : "Capteur de mouvement Salon",
            "name_type" : "Capteur de mouvement Salon (Light/Switch/Switch)"
        },
        {
            "idx" : "444",
            "name" : "Capteur de pr\u00e9sence Couloir Lux",
            "name_type" : "Capteur de pr\u00e9sence Couloir Lux (Lux/Lux)"
        },
        {
            "idx" : "447",
            "name" : "Capteur de pr\u00e9sence Salon Lux",
            "name_type" : "Capteur de pr\u00e9sence Salon Lux (Lux/Lux)"
        },
        {
            "idx" : "443",
            "name" : "Capteur Porte d'entr\u00e9e",
            "name_type" : "Capteur Porte d'entr\u00e9e (Light/Switch/Switch)"
        },
        {
            "idx" : "527",
            "name" : "Cloud Cover",
            "name_type" : "Cloud Cover (General/Percentage)"
        },
        {
            "idx" : "835",
            "name" : "Dock station",
            "name_type" : "Dock station (Light/Switch/Switch)"
        },
        {
            "idx" : "438",
            "name" : "D\u00e9tecteur fum\u00e9e chambre Parents",
            "name_type" : "D\u00e9tecteur fum\u00e9e chambre Parents (Light/Switch/Switch)"
        },
        {
            "idx" : "836",
            "name" : "Ecran PC",
            "name_type" : "Ecran PC (Light/Switch/Switch)"
        },
        {
            "idx" : "61",
            "name" : "Name1",
            "name_type" : "Name1 (Temp + Humidity/THGR810, THGN800)"
        },
        {
            "idx" : "426",
            "name" : "Gateway Alarm",
            "name_type" : "Gateway Alarm (Light/Switch/Selector Switch)"
        },
        {
            "idx" : "425",
            "name" : "Gateway Lumi\u00e8re",
            "name_type" : "Gateway Lumi\u00e8re (Color Switch/RGBW)"
        },
        {
            "idx" : "434",
            "name" : "Gateway Lux",
            "name_type" : "Gateway Lux (Lux/Lux)"
        },
        {
            "idx" : "430",
            "name" : "Gateway Vol",
            "name_type" : "Gateway Vol (Light/Switch/Switch)"
        },
        {
            "idx" : "432",
            "name" : "Humidit\u00e9 Salle-de-Bain",
            "name_type" : "Humidit\u00e9 Salle-de-Bain (Humidity/LaCrosse TX3)"
        },
        {
            "idx" : "850",
            "name" : "Humidit\u00e9 Salon",
            "name_type" : "Humidit\u00e9 Salon (Humidity/LaCrosse TX3)"
        },
        {
            "idx" : "412",
            "name" : "iPhone Name3 Home",
            "name_type" : "iPhone Name3 Home (Lighting 1/X10)"
        },
        {
            "idx" : "449",
            "name" : "iPhone Name4 Home",
            "name_type" : "iPhone Name4 Home (Lighting 1/X10)"
        },
        {
            "idx" : "768",
            "name" : "Name2",
            "name_type" : "Name2 (Temp + Humidity/THGN122/123/132, THGR122/228/238/268)"
        },
        {
            "idx" : "833",
            "name" : "Multiprise 1",
            "name_type" : "Multiprise 1 (Light/Switch/Switch)"
        },
        {
            "idx" : "834",
            "name" : "Multiprise 2",
            "name_type" : "Multiprise 2 (Light/Switch/Switch)"
        },
        {
            "idx" : "837",
            "name" : "Multiprise USB",
            "name_type" : "Multiprise USB (Light/Switch/Switch)"
        },
        {
            "idx" : "778",
            "name" : "Parents",
            "name_type" : "Parents (Temp + Humidity/THGN122/123/132, THGR122/228/238/268)"
        },
        {
            "idx" : "851",
            "name" : "Pression Salon",
            "name_type" : "Pression Salon (General/Barometer)"
        },
        {
            "idx" : "526",
            "name" : "Rain",
            "name_type" : "Rain (Rain/RainByRate)"
        },
        {
            "idx" : "754",
            "name" : "Salle d'Eau",
            "name_type" : "Salle d'Eau (Temp + Humidity/THGN122/123/132, THGR122/228/238/268)"
        },
        {
            "idx" : "433",
            "name" : "Salle-de-Bain",
            "name_type" : "Salle-de-Bain (Temp + Humidity/LaCrosse TX3)"
        },
        {
            "idx" : "446",
            "name" : "Security Panel",
            "name_type" : "Security Panel (Security/Security Panel)"
        },
        {
            "idx" : "849",
            "name" : "Temp\u00e9rature Salon",
            "name_type" : "Temp\u00e9rature Salon (Temp/LaCrosse TX3)"
        },
        {
            "idx" : "838",
            "name" : "TV Samsung",
            "name_type" : "TV Samsung (Light/Switch/Switch)"
        },
        {
            "idx" : "788",
            "name" : "TV Socket",
            "name_type" : "TV Socket (Light/Switch/Switch)"
        },
        {
            "idx" : "790",
            "name" : "TV Socket Consumption",
            "name_type" : "TV Socket Consumption (General/kWh)"
        },
        {
            "idx" : "840",
            "name" : "TV Socket Consumption",
            "name_type" : "TV Socket Consumption (RFXMeter/RFXMeter counter)"
        },
        {
            "idx" : "841",
            "name" : "TV Socket Power",
            "name_type" : "TV Socket Power (Usage/Electric)"
        },
        {
            "idx" : "789",
            "name" : "TV Socket Power (W)",
            "name_type" : "TV Socket Power (W) (Usage/Electric)"
        },
        {
            "idx" : "791",
            "name" : "TV Socket Voltage",
            "name_type" : "TV Socket Voltage (General/Voltage)"
        },
        {
            "idx" : "4",
            "name" : "Volets Name1",
            "name_type" : "Volets Name1 (RFY/RFY)"
        },
        {
            "idx" : "128",
            "name" : "Volets Name1 - Fermeture auto",
            "name_type" : "Volets Name1 - Fermeture auto (Lighting 1/X10)"
        },
        {
            "idx" : "13",
            "name" : "Volets Name2",
            "name_type" : "Volets Name2 (RFY/RFY)"
        },
        {
            "idx" : "129",
            "name" : "Volets Name2 - Fermeture auto",
            "name_type" : "Volets Name2 - Fermeture auto (Lighting 1/X10)"
        },
        {
            "idx" : "3",
            "name" : "Volets Parents",
            "name_type" : "Volets Parents (RFY/RFY)"
        },
        {
            "idx" : "123",
            "name" : "Volets Parents- Fermeture auto",
            "name_type" : "Volets Parents- Fermeture auto (Lighting 1/X10)"
        },
        {
            "idx" : "370",
            "name" : "Volets Parents- Timer 25 min",
            "name_type" : "Volets Parents- Timer 25 min (Lighting 1/X10)"
        },
        {
            "idx" : "1",
            "name" : "Volets Salle-\u00e0-manger",
            "name_type" : "Volets Salle-\u00e0-manger (RFY/RFY)"
        },
        {
            "idx" : "436",
            "name" : "Volets Salon - Fermeture Auto",
            "name_type" : "Volets Salon - Fermeture Auto (Lighting 1/X10)"
        },
        {
            "idx" : "2",
            "name" : "Volets S\u00e9jour",
            "name_type" : "Volets S\u00e9jour (RFY/RFY)"
        },
        {
            "idx" : "786",
            "name" : "ZigBee Plugin - Zigate Status  6",
            "name_type" : "ZigBee Plugin - Zigate Status  6 (General/Alert)"
        }
    ],
    "status" : "OK",
    "title" : "GetDevicesList"
}

Any help will be much appreciated as I ran out of ideas :( (I am suspecting a code change in Domoticz that is not compatible anymore with homebridge-edomoticz)

Thanks

PatchworkBoy commented 1 year ago

Need to get Domoticz api output for each IDX and post here… see https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Retrieve_status_of_specific_device

PatchworkBoy commented 1 year ago

(Also, could be because you’re running as a child bridge. Never managed to get child bridge setup working properly & showing all devices here, so can’t really vouch for it’s use 🤷🏼… and your MQTT config looks to be invalid so expect non-instant updates etc)

PatchworkBoy commented 1 year ago

Needs the specific output for the individual IDXs in question, not the device list.

freeforall2 commented 1 year ago

Sure I didn't see your comment, I was just updating my original post with more details for help.

output for idx 836 as an example (a switch for power plug):

{ "ActTime" : 1696073250, "AstrTwilightEnd" : "21:19", "AstrTwilightStart" : "06:03", "CivTwilightEnd" : "20:05", "CivTwilightStart" : "07:17", "DayLength" : "11:45", "NautTwilightEnd" : "20:41", "NautTwilightStart" : "06:41", "ServerTime" : "2023-09-30 13:27:30", "SunAtSouth" : "13:41", "Sunrise" : "07:49", "Sunset" : "19:33", "app_version" : "2023.2", "status" : "OK", "title" : "Devices" }

and output for idx 849 (temperature sensor)

{ "ActTime" : 1696073412, "AstrTwilightEnd" : "21:19", "AstrTwilightStart" : "06:03", "CivTwilightEnd" : "20:05", "CivTwilightStart" : "07:17", "DayLength" : "11:45", "NautTwilightEnd" : "20:41", "NautTwilightStart" : "06:41", "ServerTime" : "2023-09-30 13:30:12", "SunAtSouth" : "13:41", "Sunrise" : "07:49", "Sunset" : "19:33", "app_version" : "2023.2", "status" : "OK", "title" : "Devices" }

freeforall2 commented 1 year ago

(Also, could be because you’re running as a child bridge. Never managed to get child bridge setup working properly & showing all devices here, so can’t really vouch for it’s use 🤷🏼… and your MQTT config looks to be invalid so expect non-instant updates etc)

About the child bridge comment:

And about MQTT config:

Thanks for your help!

PatchworkBoy commented 1 year ago

That’s incomplete… note the level of output at the wiki link = includes result:[] containing hardware type, subtype, switch type, current values etc.

Check your Domoticz security settings due to changes in v2023.x. Does Domoticz user you’re connecting as from homebridge-edomoticz have access to those devices etc within Domoticz > Users?

All probably down to the stricter security in new Domoticz.

freeforall2 commented 1 year ago

Regarding the security settings:

Regarding the output missing HW info etc:

It is the same they mentioned: From Stable 2023.2: /json.htm?type=command&param=getdevices&rid=IDX

Strange let me look to find another command with more details

PatchworkBoy commented 1 year ago

I think you now HAVE to auth as user. Try adding your local ip range or specific local ip addresses of both the Pi and your current device that you’re hitting API from to exemption list (192.168.0.x probably) as well as the loop back address, then see if you get result: [] back from the API. If so, restart homebridge, see if devices appear.

OR connect with auth credentials.

freeforall2 commented 1 year ago

Tried that already :(

Initially the exemption list was like this: 127.0.0.1 Yesterday when I was troubleshooting this issue I changed it to this to be on the safe side: 127.0.0.;192.168.1.

(FYI my local NW is 192.168.1.x vs 192.168.0.x)

freeforall2 commented 1 year ago

I have devices coming from different HW declared in Domoticz (RFXCom, Xiaomi gateway etc). All devices seem to appear fine in Homebridge except for the ones coming from 1 type of HW which is DeconZ (Zigbee Conbee II key) If it was a permission issue the problem should be more general with the exempted NW. Shouldn't it?

freeforall2 commented 1 year ago

Yes that's what I did (with a wildcard though after the last "."). The wild card is not printing when I write here

PatchworkBoy commented 1 year ago

If no result element, it’s either auth issue, or the Deconz device type in Domoticz isn’t outputting correctly.

Do you get result element for different devices from API when you use same method?

freeforall2 commented 1 year ago

Ok we are on something here.

I just tested the API output for a working device and I have much more details

{ "ActTime" : 1696075346, "AstrTwilightEnd" : "21:19", "AstrTwilightStart" : "06:03", "CivTwilightEnd" : "20:05", "CivTwilightStart" : "07:17", "DayLength" : "11:45", "NautTwilightEnd" : "20:41", "NautTwilightStart" : "06:41", "ServerTime" : "2023-09-30 14:02:26", "SunAtSouth" : "13:41", "Sunrise" : "07:49", "Sunset" : "19:33", "app_version" : "2023.2", "result" : [ { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "CustomImage" : 8, "Data" : "Off", "Description" : "", "DimmerType" : "abs", "Favorite" : 0, "HardwareDisabled" : false, "HardwareID" : 5, "HardwareName" : "Xiaomi Gateway", "HardwareType" : "Xiaomi Gateway", "HardwareTypeVal" : 95, "HaveDimmer" : true, "HaveGroupCmd" : true, "HaveTimeout" : false, "ID" : "8CF68748", "Image" : "Speaker", "IsSubDevice" : false, "LastUpdate" : "2021-11-10 13:41:27", "Level" : 10, "LevelInt" : 10, "MaxDimLevel" : 100, "Name" : "Gateway Vol", "Notifications" : "false", "PlanID" : "0", "PlanIDs" : [ 0 ], "Protected" : false, "ShowNotifications" : true, "SignalLevel" : "-", "Status" : "Off", "StrParam1" : "", "StrParam2" : "", "SubType" : "Switch", "SwitchType" : "Dimmer", "SwitchTypeVal" : 7, "Timers" : "false", "Type" : "Light/Switch", "TypeImg" : "dimmer", "Unit" : 7, "Used" : 1, "UsedByCamera" : false, "XOffset" : "0", "YOffset" : "0", "idx" : "430" } ], "status" : "OK", "title" : "Devices" }

PatchworkBoy commented 1 year ago

Right - says to me it’s either the Hardware plugin for that device over in Domoticz… OR, over on the default user in Domoticz, those devices aren’t included yet when you hit “set devices” for that user at /#/Users

freeforall2 commented 1 year ago

I don't have a default user... (since initial installation I removed the "admin" user that comes by default with domoticz for security reasons). I only use admins I created manually. Those admins don't have specific devices declared, they have access to all devices.

Let me try to force adding all devices for all users (because not sure which one would be considered as default since I am the one who created all of them) and see whether there is a change in behaviour

PatchworkBoy commented 1 year ago

Well, let’s rule it out altogether. Make an admin user with all devices for homebridge-eDomoticz to use, and sling user:pass@ in front of IP over in homebridge-edomoticz config…

freeforall2 commented 1 year ago

Thank you so much!!! It is working now! I added all devices to all users and it worked! I see the devices that were missing. I don't know which user Homebridge was picking by default but it is fixed :)

Probably a change in behaviour in the new Domoticz version as you mentioned.