homebridge / docker-homebridge

Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
https://hub.docker.com/r/homebridge/homebridge/
GNU General Public License v3.0
2.57k stars 240 forks source link

HomeBridge-Homematic not connecting to CCU/debmatic #404

Closed degudejung closed 2 years ago

degudejung commented 2 years ago

Hi, first of all thank you for this nice piece of software!

I can't get the following issue resolved. I have no problem with exactly the same setup of HomeBridge Homematic when the CCU/debmatic is running on bare metal on another PC with, say IP 192.168.10.36.

However, the idea is to have HomeBridge (with HomeMatic plugin) run in a Docker container on the same hardware server as the CCU/debmatic while the latter runs inside Qemu/KVM virtual machine with Debian 11 (and only debmatic runs on that VM). debmatic UI on the VM runs super smooth, interacts with all sensors and actors just fine and is very nicely responsive via the browser (typically call UI with IP 192.168.10.33 port 80).

I have already switched the local_port(s) back and forth and I am certain ports 6060 (6061..) are open and exclusively used by HomeBridge. Also, I have checked ports 80 and 8181 of the debmatic VM with nmap and they are certainly open and responsive.

I ran out of ideas. Can anyone help?

Describe Your Problem: HomeBridge-homematic is not connecting to debmatic even though I believe to have all settings right.

Logs: Log from inside HomeBridge:

[12/18/2021, 12:53:25 PM] [Homebridge UI] Restarting the docker container, make sure you have --restart=always turned on or the container will not come back online

    Thank you for using the oznu/homebridge docker image!
  If you find this project useful please STAR it on GitHub:
         https://github.com/oznu/docker-homebridge
                Or donate to the project:
            https://github.com/sponsors/oznu
                  https://paypal.me/oznu

[12/18/2021, 12:54:05 PM] [HB Supervisor] OS: Linux 5.4.157-1-pve x64
[12/18/2021, 12:54:05 PM] [HB Supervisor] Node.js v16.13.1 /usr/local/bin/node
[12/18/2021, 12:54:05 PM] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge
[12/18/2021, 12:54:05 PM] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[12/18/2021, 12:54:08 PM] [Homebridge UI] Homebridge Config UI X v4.41.5 is listening on :: port 8581
[12/18/2021, 12:54:08 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules
[12/18/2021, 12:54:08 PM] [HB Supervisor] Started Homebridge v1.3.8 with PID: 416
[12/18/2021, 12:54:09 PM] Loaded config.json with 0 accessories and 2 platforms.
[12/18/2021, 12:54:09 PM] Loaded 0 cached accessories from cachedAccessories.
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loaded plugin: homebridge-dummy@0.5.0
[12/18/2021, 12:54:09 PM] Registering accessory 'homebridge-dummy.DummySwitch'
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loaded plugin: homebridge-homematic@0.2.226
[12/18/2021, 12:54:09 PM] Registering platform 'homebridge-homematic.HomeMatic'
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loaded plugin: homebridge-config-ui-x@4.41.5
[12/18/2021, 12:54:09 PM] Registering platform 'homebridge-config-ui-x.config'
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loading 2 platforms...
[12/18/2021, 12:54:09 PM] [Config] Initializing config platform...
[12/18/2021, 12:54:09 PM] [Config] Running in Service Mode
[12/18/2021, 12:54:09 PM] [HomeMatic] Initializing HomeMatic platform...
[12/18/2021, 12:54:09 PM] [HomeMatic] [Core] merging configurations
[12/18/2021, 12:54:09 PM] [HomeMatic] Homematic Plugin Version 0.2.226
[12/18/2021, 12:54:09 PM] [HomeMatic] Plugin by thkl  https://github.com/thkl
[12/18/2021, 12:54:09 PM] [HomeMatic] Homematic is a registered trademark of the EQ-3 AG
[12/18/2021, 12:54:09 PM] [HomeMatic] Please report any issues to https://github.com/thkl/homebridge-homematic/issues
[12/18/2021, 12:54:09 PM] [HomeMatic] running in production mode
[12/18/2021, 12:54:09 PM] [HomeMatic] will connect to your ccu at 192.168.10.33
[12/18/2021, 12:54:09 PM] [HomeMatic] IMPORTANT !! Starting this version, your homematic custom configuration is located in /homebridge/homematic_config.json
[12/18/2021, 12:54:09 PM] [HomeMatic] using subsection Homebridge
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] using xmprpc for communication with BidCos-RF
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for BidCos-RF.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for VirtualDevices.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] using xmprpc for communication with BidCos-Wired
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for BidCos-Wired.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for HmIP-RF.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface BidCos-RF. is listening on port 6060.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface VirtualDevices. is listening on port 6063.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface BidCos-Wired. is listening on port 6061.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface HmIP-RF. is listening on port 6062.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:13 PM] [HomeMatic] Error Error: connect EHOSTUNREACH 192.168.10.33:8181while executing rega script Write('PONG')
[12/18/2021, 12:54:13 PM] [HomeMatic] Error Error: connect EHOSTUNREACH 192.168.10.33:8181while executing rega script string sDeviceId;string sChannelId;boolean df = true;Write('{"devices":[');foreach(sDeviceId, root.Devices().EnumIDs()){object oDevice = dom.GetObject(sDeviceId);if(oDevice){var oInterface = dom.GetObject(oDevice.Interface());if(df) {df = false;} else { Write(',');}Write('{');Write('"id": "' # sDeviceId # '",');Write('"name": "' # oDevice.Name() # '",');Write('"address": "' # oDevice.Address() # '",');Write('"type": "' # oDevice.HssType() # '",');Write('"channels": [');boolean bcf = true;foreach(sChannelId, oDevice.Channels().EnumIDs()){object oChannel = dom.GetObject(sChannelId);if(bcf) {bcf = false;} else {Write(',');}Write('{');Write('"cId": ' # sChannelId # ',');Write('"name": "' # oChannel.Name() # '",');if(oInterface){Write('"intf": "' # oInterface.Name() # '",');Write('"address": "' # oInterface.Name() #'.' # oChannel.Address() # '",');}Write('"type": "' # oChannel.HssType() # '",');Write('"access": "' # oChannel.UserAccessRights(iulOtherThanAdmin)# '"');Write('}');}Write(']}');}}Write(']');var s = dom.GetObject("Homebridge");string cid;boolean sdf = true;if (s) {Write(',"subsection":[');foreach(cid, s.EnumUsedIDs()){  if(sdf) {sdf = false;} else { Write(',');}Write(cid);}Write(']');}Write('}');
[12/18/2021, 12:54:13 PM] [HomeMatic] [Core] Unable to load cached ccu data. giving up
[12/18/2021, 12:54:13 PM] [HomeMatic] if undefined is PONG CCU is alive
[12/18/2021, 12:54:13 PM] [HomeMatic] [Core] ok local cache is set to /homebridge/ccu.json
Setup Payload:
X-HM://0023ISYWYITR4
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     

[12/18/2021, 12:54:13 PM] Homebridge v1.3.8 (HAP v0.9.7) (Homebridge A7E0) is running on port 52121.
[12/18/2021, 12:54:13 PM] [HomeMatic] Unable to fetch new versions
[12/18/2021, 12:54:13 PM] [HomeMatic] [Core] NPM 0.2.226 vs Local 0.2.226

Show the Docker container logs here:


            https://github.com/sponsors/oznu
                  https://paypal.me/oznu

Homebridge: Installing plugins...

up to date in 603ms

up to date in 546ms
[cont-init.d] 50-plugins: exited 0.
[cont-init.d] 55-config-ui: executing... 
Enabling homebridge-config-ui-x...
Updating Homebridge Config UI X to latest version; this might take a few minutes...
npm WARN deprecated class-transformer@0.3.2: This release contains a breaking change from 0.3.1 but otherwise functions properly. Please read the changelog on Github to learn more.

changed 351 packages in 27s
[cont-init.d] 55-config-ui: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting cron

  If you find this project useful please STAR it on GitHub:

         https://github.com/oznu/docker-homebridge

                Or donate to the project:

            https://github.com/sponsors/oznu
                  https://paypal.me/oznu

[services.d] done.
[12/18/2021, 12:54:05 PM] [HB Supervisor] Homebridge Storage Path: /homebridge
[12/18/2021, 12:54:05 PM] [HB Supervisor] Homebridge Config Path: /homebridge/config.json
[12/18/2021, 12:54:05 PM] [HB Supervisor] Logging to /homebridge/homebridge.log
[12/18/2021, 12:54:05 PM] [HB Supervisor] OS: Linux 5.4.157-1-pve x64
[12/18/2021, 12:54:05 PM] [HB Supervisor] Node.js v16.13.1 /usr/local/bin/node
[12/18/2021, 12:54:05 PM] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge
[12/18/2021, 12:54:05 PM] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[12/18/2021, 12:54:08 PM] [Homebridge UI] Homebridge Config UI X v4.41.5 is listening on :: port 8581
[12/18/2021, 12:54:08 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules
[12/18/2021, 12:54:08 PM] [HB Supervisor] Started Homebridge v1.3.8 with PID: 416
[12/18/2021, 12:54:09 PM] Loaded config.json with 0 accessories and 2 platforms.
[12/18/2021, 12:54:09 PM] Loaded 0 cached accessories from cachedAccessories.
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loaded plugin: homebridge-dummy@0.5.0
[12/18/2021, 12:54:09 PM] Registering accessory 'homebridge-dummy.DummySwitch'
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loaded plugin: homebridge-homematic@0.2.226
[12/18/2021, 12:54:09 PM] Registering platform 'homebridge-homematic.HomeMatic'
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loaded plugin: homebridge-config-ui-x@4.41.5
[12/18/2021, 12:54:09 PM] Registering platform 'homebridge-config-ui-x.config'
[12/18/2021, 12:54:09 PM] ---
[12/18/2021, 12:54:09 PM] Loading 2 platforms...
[12/18/2021, 12:54:09 PM] [Config] Initializing config platform...
[12/18/2021, 12:54:09 PM] [Config] Running in Service Mode
[12/18/2021, 12:54:09 PM] [HomeMatic] Initializing HomeMatic platform...
[12/18/2021, 12:54:09 PM] [HomeMatic] [Core] merging configurations
[12/18/2021, 12:54:09 PM] [HomeMatic] Homematic Plugin Version 0.2.226
[12/18/2021, 12:54:09 PM] [HomeMatic] Plugin by thkl  https://github.com/thkl
[12/18/2021, 12:54:09 PM] [HomeMatic] Homematic is a registered trademark of the EQ-3 AG
[12/18/2021, 12:54:09 PM] [HomeMatic] Please report any issues to https://github.com/thkl/homebridge-homematic/issues
[12/18/2021, 12:54:09 PM] [HomeMatic] running in production mode
[12/18/2021, 12:54:09 PM] [HomeMatic] will connect to your ccu at 192.168.10.33
[12/18/2021, 12:54:09 PM] [HomeMatic] IMPORTANT !! Starting this version, your homematic custom configuration is located in /homebridge/homematic_config.json
[12/18/2021, 12:54:09 PM] [HomeMatic] using subsection Homebridge
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] using xmprpc for communication with BidCos-RF
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for BidCos-RF.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for VirtualDevices.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] using xmprpc for communication with BidCos-Wired
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for BidCos-Wired.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] init RPC for HmIP-RF.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] local ip used : 192.168.10.30. you may change that with local_ip parameter in config
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface BidCos-RF. is listening on port 6060.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface VirtualDevices. is listening on port 6063.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface BidCos-Wired. is listening on port 6061.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] server for interface HmIP-RF. is listening on port 6062.
[12/18/2021, 12:54:09 PM] [HomeMatic] [RPC] Creating Local HTTP Client for CCU RPC Events
[12/18/2021, 12:54:13 PM] [HomeMatic] Error Error: connect EHOSTUNREACH 192.168.10.33:8181while executing rega script Write('PONG')
[12/18/2021, 12:54:13 PM] [HomeMatic] Error Error: connect EHOSTUNREACH 192.168.10.33:8181while executing rega script string sDeviceId;string sChannelId;boolean df = true;Write('{"devices":[');foreach(sDeviceId, root.Devices().EnumIDs()){object oDevice = dom.GetObject(sDeviceId);if(oDevice){var oInterface = dom.GetObject(oDevice.Interface());if(df) {df = false;} else { Write(',');}Write('{');Write('"id": "' # sDeviceId # '",');Write('"name": "' # oDevice.Name() # '",');Write('"address": "' # oDevice.Address() # '",');Write('"type": "' # oDevice.HssType() # '",');Write('"channels": [');boolean bcf = true;foreach(sChannelId, oDevice.Channels().EnumIDs()){object oChannel = dom.GetObject(sChannelId);if(bcf) {bcf = false;} else {Write(',');}Write('{');Write('"cId": ' # sChannelId # ',');Write('"name": "' # oChannel.Name() # '",');if(oInterface){Write('"intf": "' # oInterface.Name() # '",');Write('"address": "' # oInterface.Name() #'.' # oChannel.Address() # '",');}Write('"type": "' # oChannel.HssType() # '",');Write('"access": "' # oChannel.UserAccessRights(iulOtherThanAdmin)# '"');Write('}');}Write(']}');}}Write(']');var s = dom.GetObject("Homebridge");string cid;boolean sdf = true;if (s) {Write(',"subsection":[');foreach(cid, s.EnumUsedIDs()){  if(sdf) {sdf = false;} else { Write(',');}Write(cid);}Write(']');}Write('}');
[12/18/2021, 12:54:13 PM] [HomeMatic] [Core] Unable to load cached ccu data. giving up
[12/18/2021, 12:54:13 PM] [HomeMatic] if undefined is PONG CCU is alive
[12/18/2021, 12:54:13 PM] [HomeMatic] [Core] ok local cache is set to /homebridge/ccu.json
Setup Payload:
X-HM://0023ISYWYITR4
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     

[12/18/2021, 12:54:13 PM] Homebridge v1.3.8 (HAP v0.9.7) (Homebridge A7E0) is running on port 52121.
[12/18/2021, 12:54:13 PM] [HomeMatic] Unable to fetch new versions
[12/18/2021, 12:54:13 PM] [HomeMatic] [Core] NPM 0.2.226 vs Local 0.2.226

docker compose stack:

version: '2'
services:
  homebridge:
    image: oznu/homebridge:latest
    container_name: homebridge2
    restart: unless-stopped
    network_mode: host
    ports:
      - 8581:8581
      - 6060:6060
      - 6061:6061
      - 6062:6062
      - 6063:6063
    environment:
      - TZ=Europe/Berlin
      - PGID=100
      - PUID=1003
      - HOMEBRIDGE_CONFIG_UI=1
      - HOMEBRIDGE_CONFIG_UI_PORT=8581
    volumes:
      - homebridge2:/homebridge
volumes:
  homebridge2:
    external: true

Homebridge Config: Show your homebridge config.json here:

{
    "bridge": {
        "name": "Homebridge A7E0",
        "username": "0E:37:5C:13:A7:E0",
        "port": 52121,
        "pin": "031-45-154"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "HomeMatic",
            "ccu_ip": "192.168.10.33",
            "subsection": "Homebridge",
            "enable_hmip": true,
            "enable_wired": false,
            "ios10": true,
            "platform": "HomeMatic"
        }
    ]
}

and the homematic_config.json here:

{
  "enable_hmip": true,
  "enable_wired": false,
  "ios10": true,
  "local_port": 6060
}

Screenshots: none

Environment:

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dkrizic commented 2 years ago

Migrate to this: https://github.com/thkl/hap-homematic, same author, running directly in CCU3, much better

degudejung commented 2 years ago

Thanks, @dkrizic that is indeed what I ended up doing: VM1: KVM/Qemu, Debian 11 running exclusively debmatic, USB radio module passed through VM2: KVM/Qemu, Debian 11 running exclusively hap-homematic Both with minimal CPU/memory config. However, would not work smoothly when installed on same VM. Now working OK with the virtual devices linked directly from HAP to HomeKit instead of going via Homebridge. I still have to cron-reboot the VM with HAP-Homematic once a day but who cares. HAP seems to accumulate more and more memory over time so probably that's what makes me reset/reboot it 1/24hrs. Doesn't really bother me, though.