cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 38 forks source link

Second service added via Homebridge-MQTT not remembered on Homebridge restart #89

Closed bohtho closed 4 years ago

bohtho commented 4 years ago

Has anyone else encountered the same? When I add a second service to an accessory only the first is remembered on Homebridge restart. Both in Home.app and reading all of this plugin's config via MQTT. Is there a change in HomeKit in iOS 13.2 that messes this up ?

cflurin commented 4 years ago

How did you add the accessory and the second service? Could you post your topic and payload JSON definitions.

faxioman commented 4 years ago

Try to reset your mqtt broker. A retained “delete” message (if you previously made some add/remove tests) could be the cause of this problem.

bohtho commented 4 years ago

No such messages are retained on the MQTT broker.

Topic: homebridge/to/add/service

Payload:

{
    "name": "Sentralvarme",
    "service_name": "Bereder",
    "service": "HeaterCooler"
}

Added to an accessory that already have a thermostat service.

cflurin commented 4 years ago

If you want to retain it in the MQTT broker, you have to set retain true.

But you don't need it, because all the settings of your accessories are stored in the cachedAccessories file (path: .homebridge/accessories/cachedAccessories)

Search for Sentralvarme in cachedAccessories.

When adding the service, what do you get in homebridge/from/response ?

bohtho commented 4 years ago

The response is success when I add it.

But cachedAccessories is empty ... hm... are there other paths where a duplicate could be stored ? I use DietPi based on Raspbian. This is odd because all other accessories (created via MQTT) are restored perfectly.

EDIT: Found the cachedAccessories in use. Sentralvarme (the original service Varmekrets) is there but no new linked service Bereder.

cflurin commented 4 years ago

In order to be able to help you I need more infos and exactly what you did.

  1. Your versions? (homebridge, homebridge-mqtt)

  2. Are you using other plugins?

  3. Start homebridge in Debug mode

    homebridge -D

    see also https://github.com/nfarina/homebridge/wiki/Basic-Troubleshooting

and post your log here.

If you are using node-red, build a short test showing how you are adding the accessory and the service and upload the flow here and post the result in the debug tab.

cflurin commented 4 years ago

No answer! closing for now.

bohtho commented 4 years ago

My versions are all the latest as per today.

Other Homebridge plugins are Homebridge-Hue.

However I have not been able to reproduce on the latest restarts of Homebridge. Then it is suddenly cached after all. Dont know what happened. Closing issue is ok.