Description
Describe The Bug:
I use homebridge-gsh to expose a switch from https://github.com/paolotremadio/homebridge-automation-presence to android phones for presence detection with mutliple devices, and so on.
Sometimes, the accessories set in homebridge-automation-presence (switches and motion sensors (as switches)) are like re-added in google home on the android phone (not associated to an home, removed from automations, ...).
Other accessories doesn't face this issue.
I have noticed that the serialNumber of homebridge-automation-presence is set to 'n/a', not sure if this is an issue ?
Expected behavior:
Accessories are not reset.
Environment:
- Node.js Version: v22.14.0
- NPM Version: 10.9.2
- Homebridge Version: 1.9.0
- Homebridge GSH Plugin Version: v3.1.2
- Homebridge Config UI X Plugin Version: v4.73.0
- Operating System: OpenSUSE Tumbleweed VM + Docker (homebridge/homebridge)
Additional info/tests:
- In Apple Home there is no issue (never happended a re-add / reset of these accessories)
- When restarting GSH bridge, Homebridge, or the whole homebridge container (docker) (even removing / recreating it), or if I reboot the host VM => there is no issue.
However: If i recreate the host VM and re-run the homebridge container (keeping same container exposed volumes, same data, as the containers' volumes data are not on the VM) => these (and only these) homebridge-automation-presence accessories gets removed. On the Google Home App I see this:
- accessories are offline waiting homebridge up
- then they are all disabled
- then after a few minutes, the other accessories are bring back with correct state and automation-presence ones are removed / dissapear
- these removed / missing accessories then reappear after a short time but as new ones
I found a manual workaround which works all the time:
- disable homebedige-gsh plugin,
- recreate the VM and rerun the homebrige docker container,
- wait a few minutes that all is well started
- enable homebridge-gsh plugin
- restart homebridge
- once homebridge-gsh bridge starting up, stop it asap
- wait a few minutes that all plugins are well started (and a bit more to be sure)
- start homebridge-gsh
=> Then my automation-presence accessories are all good like before, not removed and re-added.
maybe the easiest way is to expose the discovery delay of homebridge-gsh in the config, so I can set it to a few minutes, I guess it could fix the issue for me ?
To Reproduce:
- Install homebridge-automation-presence and homebridge-gsh.
- set some presence accessories:
{
"accessory": "AutomationPresence",
"name": "Home Presence",
"masterPresenceOffDelay": 1200,
"_bridge": {
"username": "0E:83:FD:0F:18:FE",
"port": 23109
},
"zones": [
{
"name": "Phones",
"triggers": [
{
"name": "HomeKit"
},
{
"name": "Android"
}
]
},
{
"name": "Motion",
"triggers": [
{
"name": "HueMotion"
}
]
}
]
}
- add homebridge-gsh to your google home.
- move the automation-presence accessories to some home and room and add one (for example the 'Android' one) to an arrive/leave automation.
- wait few hours / days and they will be reset and appear back as new accessories in Google Home, or remove the VM, recreate it and rerun docker homebridge.
Homebridge Config:
{
"bridge": {
"name": "Homebridge 5199",
"username": "0C:A2:6A:0F:17:FA",
"port": 51694,
"pin": "",
"advertiser": "bonjour-hap",
"bind": []
},
"accessories": [
{
"accessory": "AutomationPresence",
"name": "Home Presence",
"masterPresenceOffDelay": 1200,
"_bridge": {
"username": "0E:83:FD:0F:18:FE",
"port": 23109
},
"zones": [
{
"name": "Phones",
"triggers": [
{
"name": "HomeKit"
},
{
"name": "Mel"
}
]
},
{
"name": "Motion",
"triggers": [
{
"name": "HueMotion"
}
]
}
]
},
{
"_bridge": {
"username": "0E:83:FD:0F:18:11"
},
"name": "Trigger-5s",
"interval": 0.083,
"accessory": "Schedule",
"serial": "123456701"
},
{
"_bridge": {
"username": "0E:83:FD:0F:18:11"
},
"name": "Trigger-10s",
"interval": 0.17,
"accessory": "Schedule",
"serial": "123456702"
},
{
"_bridge": {
"username": "0E:83:FD:0F:18:11"
},
"name": "Trigger-1m",
"interval": 1,
"accessory": "Schedule",
"serial": "123456703"
},
{
"name": "Robots-OperatingLightning",
"stateful": true,
"dimmer": false,
"reverse": false,
"time": 1000,
"random": false,
"resettable": false,
"brightness": 0,
"disableLogging": false,
"_bridge": {
"username": "0E:3D:5E:12:B9:77",
"port": 40902
},
"accessory": "DummySwitch"
}
],
"platforms": [
{
"name": "Config",
"port": 8581,
"host": "172.15.250.10",
"auth": "form",
"theme": "red",
"tempUnits": "c",
"lang": "auto",
"proxyHost": "homebridge.home.lan",
"platform": "config"
},
{
"devices": [
{
"name": "The Frame Chambre",
"ip": "192.168.10.36",
"mac": "d0:D0:03:33:68:3F",
"inputs": [
{
"type": "app"
}
]
}
],
"platform": "SamsungTizen",
"_bridge": {
"username": "0E:7E:9E:03:A3:CA",
"port": 35982
}
},
{
"name": "Google Smart Home",
"token": "",
"notice": "Keep your token a secret!",
"debug": true,
"instanceDenylist": [
"0E:3D:5E:12:B9:77",
"0E:DC:D0:06:AB:B7",
"0E:B6:87:DD:85:6C",
"0E:E6:3B:DA:A3:90",
"0E:76:55:B7:3D:A9",
"0E:9B:07:40:F3:B1",
"0E:D0:CF:B8:77:C6"
],
"betaServer": false,
"_bridge": {
"username": "0E:0B:FE:6A:36:41",
"port": 35258
},
"platform": "google-smarthome"
},
{
"clientid": "",
"simulator": false,
"language": {
"api": "fr-FR"
},
"SIEMENS-HM676G0S6-68A40E2C038A": {
"addprograms": "custom",
"programs": [
{
"name": "Chaleur tournante 4D",
"key": "Cooking.Oven.Program.HeatingMode.HotAir",
"selectonly": false,
"options": {
"Cooking.Oven.Option.SetpointTemperature": 180,
"BSH.Common.Option.Duration": 3600,
"Cooking.Oven.Option.FastPreHeat": true
}
},
{
"name": "Chaleur tournante éco",
"key": "Cooking.Oven.Program.HeatingMode.HotAirEco",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 3600
}
},
{
"name": "Mode pizza",
"key": "Cooking.Oven.Program.HeatingMode.PizzaSetting",
"selectonly": false,
"options": {
"Cooking.Oven.Option.SetpointTemperature": 190,
"BSH.Common.Option.Duration": 1200
}
},
{
"name": "Grill air pulsé",
"key": "Cooking.Oven.Program.HeatingMode.HotAirGrilling",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 1200
}
},
{
"name": "Cuisson basse température",
"key": "Cooking.Oven.Program.HeatingMode.SlowCook",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 25200
}
},
{
"name": "Convection naturelle",
"key": "Cooking.Oven.Program.HeatingMode.TopBottomHeating",
"selectonly": false,
"options": {
"Cooking.Oven.Option.SetpointTemperature": 180,
"BSH.Common.Option.Duration": 3600,
"Cooking.Oven.Option.FastPreHeat": true
}
},
{
"name": "Convection naturelle éco",
"key": "Cooking.Oven.Program.HeatingMode.TopBottomHeatingEco",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 3600
}
},
{
"name": "Cuisson de sole",
"key": "Cooking.Oven.Program.HeatingMode.BottomHeating",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 3600
}
},
{
"name": "Maintien au chaud",
"key": "Cooking.Oven.Program.HeatingMode.KeepWarm",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 2700
}
},
{
"name": "Chauffe plats",
"key": "Cooking.Oven.Program.HeatingMode.PreheatOvenware",
"selectonly": false,
"options": {
"BSH.Common.Option.Duration": 1200
}
},
{
"name": "Cuisson Surgelé",
"key": "Cooking.Oven.Program.HeatingMode.FrozenHeatupSpecial",
"selectonly": false,
"options": {
"Cooking.Oven.Option.SetpointTemperature": 195,
"BSH.Common.Option.Duration": 2700
}
}
]
},
"_bridge": {
"username": "0E:D0:CF:B8:77:C6",
"port": 32596
},
"platform": "HomeConnect"
},
{
"platform": "TadoPlatform",
"name": "TadoPlatform",
"homes": [
{
"id": 405839,
"name": "Home",
"username": "",
"password": "",
"polling": 30,
"temperatureUnit": "CELSIUS",
"geolocation": {
"longitude": "4.9450014",
"latitude": "45.6941387"
},
"presence": {
"anyone": false,
"accTypeAnyone": "OCCUPANCY",
"user": [
{
"active": false,
"name": "iPhone FVT",
"accType": "OCCUPANCY"
}
]
},
"weather": {
"temperatureSensor": false,
"solarIntensity": false,
"accTypeSolarIntensity": "LIGHTBULB",
"airQuality": false
},
"extras": {
"centralSwitch": false,
"runningInformation": false,
"presenceLock": true,
"accTypePresenceLock": "ALARM",
"boostSwitch": false,
"sheduleSwitch": false,
"turnoffSwitch": false,
"childLockSwitches": [
{
"active": false,
"name": "Living Room VA0027400704",
"serialNumber": "VA0027400704"
},
{
"active": false,
"name": "Sportroom VA3129743872",
"serialNumber": "VA3129743872"
},
{
"active": false,
"name": "Bedroom VA1637620224",
"serialNumber": "VA1637620224"
},
{
"active": false,
"name": "Bathroom VA0782375424",
"serialNumber": "VA0782375424"
}
]
},
"zones": [
{
"active": false,
"id": 1,
"name": "Living Room",
"delaySwitch": false,
"autoOffDelay": false,
"openWindowSensor": false,
"openWindowSwitch": false,
"airQuality": false,
"separateTemperature": false,
"separateHumidity": false,
"minStep": "0.1",
"minValue": 5,
"maxValue": 25,
"mode": "MANUAL",
"modeTimer": 30,
"easyMode": false,
"noBattery": false,
"type": "HEATING",
"boilerTempSupport": false,
"accTypeBoiler": "SWITCH"
},
{
"active": false,
"id": 4,
"name": "Sportroom",
"delaySwitch": false,
"autoOffDelay": false,
"openWindowSensor": false,
"openWindowSwitch": false,
"airQuality": false,
"separateTemperature": false,
"separateHumidity": false,
"minStep": "0.5",
"minValue": 5,
"maxValue": 25,
"mode": "MANUAL",
"modeTimer": 30,
"easyMode": false,
"noBattery": false,
"type": "HEATING",
"boilerTempSupport": false,
"accTypeBoiler": "SWITCH"
},
{
"active": false,
"id": 2,
"name": "Bedroom",
"delaySwitch": false,
"autoOffDelay": false,
"openWindowSensor": false,
"openWindowSwitch": false,
"airQuality": false,
"separateTemperature": false,
"separateHumidity": false,
"minStep": "0.5",
"minValue": 5,
"maxValue": 25,
"mode": "MANUAL",
"modeTimer": 30,
"easyMode": false,
"noBattery": false,
"type": "HEATING",
"boilerTempSupport": false,
"accTypeBoiler": "SWITCH"
},
{
"active": false,
"id": 3,
"name": "Bathroom",
"delaySwitch": false,
"autoOffDelay": false,
"openWindowSensor": false,
"openWindowSwitch": false,
"airQuality": false,
"separateTemperature": false,
"separateHumidity": false,
"minStep": "0.5",
"minValue": 5,
"maxValue": 25,
"mode": "MANUAL",
"modeTimer": 30,
"easyMode": false,
"noBattery": false,
"type": "HEATING",
"boilerTempSupport": false,
"accTypeBoiler": "SWITCH"
},
{
"active": false,
"id": 0,
"name": "Hot Water",
"delaySwitch": false,
"autoOffDelay": false,
"openWindowSensor": false,
"openWindowSwitch": false,
"airQuality": false,
"separateTemperature": false,
"separateHumidity": false,
"minStep": "1",
"minValue": 30,
"maxValue": 65,
"mode": "MANUAL",
"modeTimer": 30,
"easyMode": false,
"noBattery": false,
"type": "HOT_WATER",
"boilerTempSupport": false,
"accTypeBoiler": "SWITCH"
}
],
"telegram": {
"active": false
}
}
],
"_bridge": {
"username": "0E:B6:87:DD:85:6C",
"port": 30147
}
},
{
"name": "PJLink",
"devices": [
{
"name": "Projecteur Salon",
"id": "1",
"ip": "192.168.10.37",
"port": 4352,
"password": "9396",
"manufacturer": "Epson",
"model": "2255U",
"pollingInterval": 1,
"enableSwitch": false
}
],
"_bridge": {
"username": "0E:38:18:0A:6A:31",
"port": 38356
},
"platform": "PJLink"
},
{
"name": "iRobot",
"accessories": [
{
"name": "Roomba",
"blid": "",
"password": "",
"sw": "lewis+22.52.8+2023-06-05-bc633c35420+Firmware-Build+3870",
"sku": "i715840",
"ipResolution": "manual",
"hostname": "iRobot-133D17F812114F82AA80F61002CFF72C.local",
"ip": "192.168.10.33"
},
{
"name": "Bravaa",
"blid": "",
"password": "",
"sw": "sanmarino+22.29.6+2022-12-01-82f3372a65c+Firmware-Build+2321",
"sku": "m613440",
"ipResolution": "lookup",
"hostname": "iRobot-AB573F5339754033902D3F36170F252D.local"
}
],
"logLevel": 3,
"autoConnect": true,
"alwaysShowModes": true,
"_bridge": {
"username": "0E:44:66:A1:47:9F",
"port": 31989
},
"platform": "iRobotPlatform"
},
{
"platform": "Camera-ffmpeg",
"porthttp": "8080",
"localhttp": true,
"name": "Camera-ffmpeg",
"videoProcessor": "/usr/local/bin/ffmpegbuild/ffmpeg",
"cameras": [
{
"name": "Entrance Door",
"motion": true,
"motionTimeout": 14400,
"motionDoorbell": true,
"videoConfig": {
"source": "-re -thread_queue_size 4096 -i http://localhost:8081/1/stream -f alsa -ac 1 -ar 16000 -sample_fmt s16 -thread_queue_size 2048 -i plughw:CARD=MS2109,DEV=0",
"stillImageSource": "-i http://localhost:8081/1/current",
"encoderOptions": "-preset ultrafast -tune zerolatency",
"maxStreams": 2,
"maxWidth": 1280,
"maxHeight": 720,
"maxFPS": 20,
"packetSize": 1316,
"audio": true,
"debug": true,
"recording": true,
"prebuffer": true
}
}
],
"_bridge": {
"username": "0E:9B:07:40:F3:B1",
"port": 57195
}
}
],
"disabledPlugins": []
}
Logs: