Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass options to Discover #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stblassitude
Copy link

This enables passing options to harmonyhubjs-discover's Discover
constructor.

This closes #105.

For systems with multiple interfaces, using the default broadcast
address of 255.255.255.255 will not give consistent results. Instead,
you need to pass the appropriate broadcast address for the network
you're addressing, like 192.168.1.255 for the network 192.168.1.0/24.

This PR requires swissmanu/harmonyhubjs-discover#8 to be merged and
released.

(Atom fixed the whitespace problems automatically. If you prefer, I can roll those back.)

This enables passing options to harmonyhubjs-discover's Discover
constructor.

This closes KraigM#105.

For systems with multiple interfaces, using the default broadcast
address of 255.255.255.255 will not give consistent results. Instead,
you need to pass the appropriate broadcast address for the network
you're addressing, like 192.168.1.255 for the network 192.168.1.0/24.

This PR requires swissmanu/harmonyhubjs-discover#8 to be merged and
released.
@stblassitude
Copy link
Author

With the release of harmonyhubjs-discover 1.1.1, this pull request should now be complete.

@andyblac
Copy link

can this get committed ? i have separate network for IoT.

@andyblac
Copy link

andyblac commented Mar 10, 2018

tried manually adding code above, but it still won't see my hubs sitting in the separate VLAN. any ideas?

        {
            "platform": "HarmonyHub",
            "name": "Harmony Hub",
            "discoverOptions": {
                "address": "192.168.3.255"
            }
         }

@stblassitude
Copy link
Author

That config snippet looks just fine. This looks identical to my running config.

@andyblac
Copy link

andyblac commented Mar 10, 2018

Loading logs from file
CMD: tail -n 100 -f /homebridge/logs/homebridge.log


[2018-3-10 10:46:44] Homebridge is running on port 51826.

┌───────────────────────────────────────────────────┐
│              npm update check failed              │
│        Try running with sudo or get access        │
│       to the local update config store via        │
│ sudo chown -R $USER:$(id -gn $USER) /root/.config │
└───────────────────────────────────────────────────┘
[2018-3-10 10:46:45] [Config] Using Form Authentication
[2018-3-10 10:46:45] [Config] Console is listening on port 8581.
[2018-3-10 10:56:53] [Config] Changes to config.json saved.
[2018-3-10 10:57:04] [Config] Changes to config.json saved.
[2018-3-10 10:57:07] [Config] Homebridge restart request received
[2018-3-10 10:57:07] [Config] No restart command defined, killing process...
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>

┌───────────────────────────────────────────────────┐
│              npm update check failed              │
│        Try running with sudo or get access        │
│       to the local update config store via        │
│ sudo chown -R $USER:$(id -gn $USER) /root/.config │
└───────────────────────────────────────────────────┘
[2018-3-10 10:57:14] Loaded plugin: homebridge-config-ui-x
[2018-3-10 10:57:14] Registering platform 'homebridge-config-ui-x.config'
[2018-3-10 10:57:14] ---
[2018-3-10 10:57:14] Loaded plugin: homebridge-dummy
[2018-3-10 10:57:14] Registering accessory 'homebridge-dummy.DummySwitch'
[2018-3-10 10:57:14] ---
[2018-3-10 10:57:14] Loaded plugin: homebridge-harmonyhub
[2018-3-10 10:57:14] Registering platform 'homebridge-harmonyhub.HarmonyHub'
[2018-3-10 10:57:14] ---
[2018-3-10 10:57:14] Loaded plugin: homebridge-tplink-smarthome
[2018-3-10 10:57:14] Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome'
[2018-3-10 10:57:14] ---
[2018-3-10 10:57:14] Loaded config.json with 0 accessories and 3 platforms.
[2018-3-10 10:57:14] ---
[2018-3-10 10:57:14] Loading 3 platforms...
[2018-3-10 10:57:14] [Config] Initializing config platform...
[2018-3-10 10:57:14] [Harmony Hub] Initializing HarmonyHub platform...
[2018-3-10 10:57:14] [TplinkSmarthome] Initializing TplinkSmarthome platform...
[2018-3-10 10:57:14] [TplinkSmarthome] homebridge-tplink-smarthome v3.11.0, node v8.9.4, homebridge v0.4.38
[2018-3-10 10:57:14] Loading 0 accessories...
[2018-3-10 10:57:14] Homebridge is running on port 51826.

┌───────────────────────────────────────────────────┐
│              npm update check failed              │
│        Try running with sudo or get access        │
│       to the local update config store via        │
│ sudo chown -R $USER:$(id -gn $USER) /root/.config │
└───────────────────────────────────────────────────┘
[2018-3-10 10:57:14] [Config] Using Form Authentication
[2018-3-10 10:57:14] [Config] Console is listening on port 8581.
[2018-3-10 10:57:14] [TplinkSmarthome] New Device Online: [Christmas Tree] plug [xxxxxxxxx] 192.168.3.19 9999
[2018-3-10 10:57:14] [TplinkSmarthome] Adding: [Christmas Tree] plug [xxxxxxxxx]
[2018-3-10 10:57:14] [TplinkSmarthome] New Device Online: [Lounge Lamp3] plug [xxxxxxxxx] 192.168.3.12 9999
[2018-3-10 10:57:14] [TplinkSmarthome] Adding: [Lounge Lamp3] plug [xxxxxxxxx]
[2018-3-10 10:57:14] [TplinkSmarthome] New Device Online: [Sideboard Lights] plug [xxxxxxxxx] 192.168.3.20 9999
[2018-3-10 10:57:14] [TplinkSmarthome] Adding: [Sideboard Lights] plug [xxxxxxxxx]

@andyblac
Copy link

andyblac commented Mar 10, 2018

i can ping them too

/homebridge # ping 192.168.3.5                                                                                                                                        
PING 192.168.3.5 (192.168.3.5): 56 data bytes                                                                                                                         
64 bytes from 192.168.3.5: seq=0 ttl=63 time=3.678 ms                                                                                                                 
64 bytes from 192.168.3.5: seq=1 ttl=63 time=1.456 ms                                                                                                                 
64 bytes from 192.168.3.5: seq=2 ttl=63 time=1.460 ms                                                                                                                 
^C                                                                                                                                                                    
--- 192.168.3.5 ping statistics ---                                                                                                                                   
3 packets transmitted, 3 packets received, 0% packet loss                                                                                                             
round-trip min/avg/max = 1.456/2.198/3.678 ms                                                                                                                         
/homebridge #                                                                                                                                  

@andyblac
Copy link

andyblac commented Mar 10, 2018

@stblassitude it seems to parsing the object ok

[2018-3-10 12:01:33] [Harmony Hub] Initializing HarmonyHub platform...
[2018-3-10 12:01:33] [Harmony Hub] OPTIONS: {"address":"192.168.3.255"}

@eddieroger
Copy link

Seconding this merge request - I also operate a separate IoT VLAN and being able to pass discovery address would be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discovery does not work on FreeBSD 11.1
3 participants