> Jeder Adapter hat "Browse"-Funktion im Bauch und man konnte die aufrufen. Die Funktion sucht die passende (für diesen Adapter) Geräte und bindet die ein.
Frage: Zum Zeitpunkt der Installation sind die Adapter ja größtenteils noch nicht installiert, lediglich die Informationen aus der io-packages.json liegen im Repository vor. Ansonsten müssten ja erst mal alle verfügbaren node Module installiert werden.
Idee: In der io-packages.json ein weiteres Objekt aufnehmen:
Z.B. für hm-rpc:
"autodetect": {
"protocol": tcp,
"port": 2001
},
oder für inidivudelle checks:
"autodetect": {
"protocol": sonos
},
Diese Informationen könnten dann im admin-Adapater ausgelesen werden und ein zentraler Netzwerk-Scan vorgenommen werden.
Hab mal einen eigenen Adapter-Prototypen gebaut der im Log die Geräte ausgibt. Momentan wird nur auf hm-rpc und sonos geprüft (hab nicht so viele Geräte :-))
2015-07-01 21:34:01.143 - info: autodetect.0 42 Adapter in Repository found:
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter admin: ioBroker Admin
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter artnet: Art-Net Adapter
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter b-control-em: B-control Energy Manager
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter cul: CUL/culfw
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter dwd: DWD
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter email: Email Adapter
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter example: Node.js Example Adapter
2015-07-01 21:34:01.143 - info: autodetect.0 - Adapter history: History
2015-07-01 21:34:01.144 - info: autodetect.0 - Adapter hm-rega: HomeMatic ReGaHSS
2015-07-01 21:34:01.144 - info: autodetect.0 - Adapter hm-rpc: HomeMatic RPC
2015-07-01 21:34:01.144 - info: autodetect.0 -- Checking for hm-rpc devices
2015-07-01 21:34:01.165 - info: autodetect.0 - Adapter hue: Philips Hue Bridge Adapter
2015-07-01 21:34:01.166 - info: autodetect.0 - Adapter hmm: Node.js Homematic Manager Adapter
2015-07-01 21:34:01.166 - info: autodetect.0 - Adapter ical: iCal Adapter
2015-07-01 21:34:01.166 - info: autodetect.0 - Adapter icons-addictive-flavour-png: Addictive flavour icon set as PNG
2015-07-01 21:34:01.170 - info: autodetect.0 - Adapter icons-material-png: Material google design icons as PNG
2015-07-01 21:34:01.170 - info: autodetect.0 - Adapter icons-material-svg: Material google design icons as SVG
2015-07-01 21:34:01.171 - info: autodetect.0 - Adapter icons-mfd-png: Mfd icons as PNG
2015-07-01 21:34:01.171 - info: autodetect.0 - Adapter icons-mfd-svg: Mfd icons as SVG
2015-07-01 21:34:01.171 - info: autodetect.0 - Adapter icons-open-icon-library-png: Open icon library set as PNG
2015-07-01 21:34:01.171 - info: autodetect.0 - Adapter icons-ultimate-png: Ultimate icon set for visualisation as PNG
2015-07-01 21:34:01.171 - info: autodetect.0 - Adapter javascript: Javascript/Coffescript Script Engine
2015-07-01 21:34:01.171 - info: autodetect.0 - Adapter js-controller: ioBroker.js-controller
2015-07-01 21:34:01.172 - info: autodetect.0 - Adapter knx: KNX
2015-07-01 21:34:01.172 - info: autodetect.0 - Adapter legacy: Legacy Web Adapter
2015-07-01 21:34:01.172 - info: autodetect.0 - Adapter megad: Mega-D Adapter
2015-07-01 21:34:01.172 - info: autodetect.0 - Adapter mqtt: MQTT Adapter
2015-07-01 21:34:01.172 - info: autodetect.0 - Adapter node-red: node-red Adapter
2015-07-01 21:34:01.172 - info: autodetect.0 - Adapter ping: PING Adapter
2015-07-01 21:34:01.203 - info: autodetect.0 - Adapter s7: undefined
2015-07-01 21:34:01.204 - info: autodetect.0 - Adapter sayit: Text to speech Adapter
2015-07-01 21:34:01.204 - info: autodetect.0 - Adapter simple-api: simpleAPI Adapter
2015-07-01 21:34:01.204 - info: autodetect.0 - Adapter socketio: socket.io Adapter
2015-07-01 21:34:01.204 - info: autodetect.0 - Adapter onkyo: Onkyo EISCP
2015-07-01 21:34:01.204 - info: autodetect.0 - Adapter owfs: OWFS Adapter
2015-07-01 21:34:01.205 - info: autodetect.0 - Adapter pushover: Pushover Adapter
2015-07-01 21:34:01.205 - info: autodetect.0 - Adapter rickshaw: Rickshaw Charts
2015-07-01 21:34:01.206 - info: autodetect.0 - Adapter sonos: SONOS Adapter
2015-07-01 21:34:01.206 - info: autodetect.0 -- Checking for sonos devices
2015-07-01 21:34:01.321 - info: autodetect.0 - Adapter vis: ioBroker Visualisation
2015-07-01 21:34:01.321 - info: autodetect.0 - Adapter vis-metro: ioBroker Visualisation - metro style Widgets
2015-07-01 21:34:01.322 - info: autodetect.0 - Adapter web: ioBroker simple web Adapter
2015-07-01 21:34:01.322 - info: autodetect.0 - Adapter yr: yr.no
2015-07-01 21:34:01.322 - info: autodetect.0 - Adapter zwave: ZWave
2015-07-01 21:34:01.657 - info: autodetect.0 + [sonos] Found Device 192.168.000.105 - Sonos PLAY:1 in Room Bad
2015-07-01 21:34:01.831 - info: autodetect.0 + [sonos] Found Device 192.168.000.103 - Sonos PLAY:1 in Room Schlafzimmer
2015-07-01 21:34:01.848 - info: autodetect.0 + [sonos] Found Device 192.168.000.116 - Sonos CONNECT in Room Wohnzimmer
2015-07-01 21:34:04.375 - info: autodetect.0 + [hm-rpc] Found IP: 192.168.000.80
2015-07-01 21:34:04.375 - info: autodetect.0 + [hm-rpc] Checking for BINRPC for 192.168.000.80
2015-07-01 21:34:04.402 - info: autodetect.0 + [hm-rpc] Not Found: Error: not connected for IP 192.168.000.80
2015-07-01 21:34:04.402 - info: autodetect.0 + [hm-rpc] Checking for XML-RPC for 192.168.000.80
2015-07-01 21:34:04.478 - info: autodetect.0 + [hm-rpc] Found: Homegear 0.6.0 for IP 192.168.000.80
Darauf hin könnten die Adapter, für die Geräte gefunden wurden, installiert werden. Leider ist dann der Code für das "autodetect" nicht im jeweiligen Adapter. Vielleicht hat jemand eine Idee, wie man das konzeptionell besser lösen könnte.
LG
Siedi