nitaybz / homebridge-delay-switch

Delay switches for Homebridge: https://github.com/nfarina/homebridge
MIT License
146 stars 20 forks source link

Not working #61

Closed mbierman closed 2 years ago

mbierman commented 2 years ago

Can you give any sugggestions about why this isn't working?

Config

{
    "hosts": [
        {
            "name": "Pigpen Awway",
            "ipv4_address": "192.168.0.19",
            "interval": 60,
            "timeout": 25,
            "retries": 1,
            "startup_as_failed": true,
            "closed_on_success": false
        },
        {
            "interval": 60,
            "timeout": 25,
            "retries": 1,
            "startup_as_failed": true,
            "closed_on_success": true
        }
    ],
    "_bridge": {
        "username": "0E:56:B1:0B:8D:61",
        "port": 48176
    },
    "platform": "PingHosts"
}
/homebridge/node_modules/.pnpm/@vectronic+homebridge-ping-hosts@3.0.1/node_modules/@vectronic/homebridge-ping-hosts/index.js:49
        throw new Error("Missing name!");
              ^
Error: Missing name!
    at new PingHostContactAccessory (/homebridge/node_modules/.pnpm/@vectronic+homebridge-ping-hosts@3.0.1/node_modules/@vectronic/homebridge-ping-hosts/index.js:49:15)
    at PingHostsPlatform.accessories (/homebridge/node_modules/.pnpm/@vectronic+homebridge-ping-hosts@3.0.1/node_modules/@vectronic/homebridge-ping-hosts/index.js:36:26)
    at /homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/bridgeService.ts:534:24
    at new Promise (<anonymous>)
    at BridgeService.loadPlatformAccessories (/homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/bridgeService.ts:528:12)
    at ChildBridgeFork.startBridge (/homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/childBridgeFork.ts:155:36)
[6/23/2022, 2:45:44 PM] [@vectronic/homebridge-ping-hosts] Child bridge process ended
[6/23/2022, 2:45:44 PM] [@vectronic/homebridge-ping-hosts] Process Ended. Code: 1, Signal: null
[6/23/2022, 2:45:51 PM] [@vectronic/homebridge-ping-hosts] Restarting Process...
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] Launched child bridge with PID 11469
[6/23/2022, 2:45:53 PM] Registering platform '@vectronic/homebridge-ping-hosts.PingHosts'
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] Loaded @vectronic/homebridge-ping-hosts v3.0.1 child bridge successfully
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] [Pigpen Awway] closed_on_success: true
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] [Pigpen Awway] startup_as_failed: true
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] [Pigpen Awway] success_state: CONTACT_DETECTED
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] [Pigpen Awway] failure_state: CONTACT_NOT_DETECTED

/homebridge/node_modules/.pnpm/@vectronic+homebridge-ping-hosts@3.0.1/node_modules/@vectronic/homebridge-ping-hosts/index.js:49
        throw new Error("Missing name!");
              ^
Error: Missing name!
    at new PingHostContactAccessory (/homebridge/node_modules/.pnpm/@vectronic+homebridge-ping-hosts@3.0.1/node_modules/@vectronic/homebridge-ping-hosts/index.js:49:15)
    at PingHostsPlatform.accessories (/homebridge/node_modules/.pnpm/@vectronic+homebridge-ping-hosts@3.0.1/node_modules/@vectronic/homebridge-ping-hosts/index.js:36:26)
    at /homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/bridgeService.ts:534:24
    at new Promise (<anonymous>)
    at BridgeService.loadPlatformAccessories (/homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/bridgeService.ts:528:12)
    at ChildBridgeFork.startBridge (/homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/childBridgeFork.ts:155:36)
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] Child bridge process ended
[6/23/2022, 2:45:53 PM] [@vectronic/homebridge-ping-hosts] Process Ended. Code: 1, Signal: null
[6/23/2022, 2:46:00 PM] [@vectronic/homebridge-ping-hosts] Restarting Process...
nitaybz commented 2 years ago

The error is coming from a different plugin, not mine. but still, it seems like the second part of your config does not include name:

{
    "hosts": [
        {
            "name": "Pigpen Awway",
            "ipv4_address": "192.168.0.19",
            "interval": 60,
            "timeout": 25,
            "retries": 1,
            "startup_as_failed": true,
            "closed_on_success": false
        },
        {
            "name": "xxxxxx",   <----- this is missing
            "ipv4_address": "xx.xx.xx.xx,   <----- this is missing
            "interval": 60,
            "timeout": 25,
            "retries": 1,
            "startup_as_failed": true,
            "closed_on_success": true
        }
    ],
    "_bridge": {
        "username": "0E:56:B1:0B:8D:61",
        "port": 48176
    },
    "platform": "PingHosts"
}
mbierman commented 2 years ago

lol so sorry! I grabbed the wrong link to github.And thanks. Apparently the other plugin didn't get rid of an empty entry that it should have. Many, many thanks!