steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Have to manually restart homebridge after every server rebooot to get back devices #63

Closed hartmood closed 4 years ago

hartmood commented 4 years ago

Describe the bug After rebooting the server all openhab-complete items I defined in my config.json are gone. I have to manually restart homebridge via console in order to get them back. They all appear in the standard room then and have to be manually re-assigned to the appropriate rooms.

Expected behavior Homebridge should start with all items after reboot.

Configurations Please paste the configuration of:

Environment (please complete the following information): Openhabian RPI - NPM installation - homebridge latest release

hartmood commented 4 years ago

Maybe it is also related to changes of config.json. Either devices get lost (homebridge restart to get them back) and / or connection to rooms are lost and have to be re-assigned or it is a combination of all of that.

I added a delay of 30s for the homebridge service to start which at least seems to have solved the "missing devices issue" - nevertheless assigning rooms for all devices after changes in config.json is pretty annoying.

steilerDev commented 4 years ago

What's your log saying upon the reboot of your server? This behavior never happened to me and my system is frequently restarted (for development reasons).

hartmood commented 4 years ago

I have moved the installation to another machine to get rid of the problem. Even with adding a delay to the boot sequence I was not successful. Thanks.

steilerDev commented 4 years ago

So is this issue fixed/did you find a workaround?

hartmood commented 4 years ago

The issue is fixed for me as I use two different machines which don't run into conflicts anymore. :-)

steilerDev commented 4 years ago

All right, thanks for the feedback!

sonntam commented 4 years ago

I have the same issue on a clean Raspbian install with just openhab2 and homebridge as well as this plugin installed.

I only have 2 outlets and 2 simple lights within my config:

{
            "platform": "openHAB2-Complete",
            "host": "http://raspberrypi4.fritz.box",
            "port": "8080",
            "accessories": [
                {
                    "name": "Beleuchtung Bücherregal",
                    "type": "light",
                    "item": "mqtt_sonoff_BeleuchtungBCherregal"
                },
                {
                    "name": "Beleuchtung Fernseher",
                    "type": "light",
                    "item": "mqtt_sonoff_BeleuchtungTV"
                },
                {
                    "name": "3D-Drucker",
                    "type": "outlet",
                    "item": "ghoma_3dprinter"
                },
                {
                    "name": "Vitrine",
                    "type": "outlet",
                    "item": "ghoma_vitrine"
                }
            ]
        }

Do you have an idea what I could try to analyze the problem?

In the log I found the following lines not knowing if it has to do anything with my issue:

Feb 04 20:30:20 raspberrypi homebridge[1201]: [04/02/2020, 20:30:20] [openHAB2-Complete] 'OpenHAB2 - Complete Edition' plugin loaded - Version 1.1.0
Feb 04 20:30:20 raspberrypi homebridge[1201]: [04/02/2020, 20:30:20] [openHAB2-Complete] ---
Feb 04 20:30:20 raspberrypi homebridge[1201]: [04/02/2020, 20:30:20] [openHAB2-Complete] Loading accessories from configuration, this might take a while...
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] Unable to add accessory Beleuchtung Bücherregal: Error: Not configuring binary actor characteristic for Beleuchtung Bücherregal: Item type was not synced initially and is therefore not available, skipping
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] Unable to add accessory Beleuchtung Fernseher: Error: Not configuring binary actor characteristic for Beleuchtung Fernseher: Item type was not synced initially and is therefore not available, skipping
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] Unable to add accessory 3D-Drucker: Error: Not configuring binary actor characteristic for 3D-Drucker: Item type was not synced initially and is therefore not available, skipping
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] Unable to add accessory Vitrine: Error: Not configuring binary actor characteristic for Vitrine: Item type was not synced initially and is therefore not available, skipping
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] Syncing all item values from openHAB
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] Finished loading 0 accessories from configuration
Feb 04 20:30:21 raspberrypi homebridge[1201]: [04/02/2020, 20:30:21] [openHAB2-Complete] ---