diff --git a/hobu_alert_system_motion/app.js b/hobu_alert_system_motion/app.js index 38850d8..299be45 100644 --- a/hobu_alert_system_motion/app.js +++ b/hobu_alert_system_motion/app.js @@ -65,7 +65,7 @@ function connect(item) { function () { Log.log('Motion detected'); var callOptions = item.on.motion.call; - doMotionCall(callOptions); + doMotionCall(HOST, callOptions); } ); @@ -77,7 +77,10 @@ function connect(item) { } /* private */ -function doMotionCall(options) { +function doMotionCall(host, options) { + const HOST = host; + + callback = function(response) { var str = ''; diff --git a/hobu_alert_system_motion/config.json b/hobu_alert_system_motion/config.json index ad08295..d12c775 100644 --- a/hobu_alert_system_motion/config.json +++ b/hobu_alert_system_motion/config.json @@ -8,7 +8,7 @@ "motion": { "call": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/home/motion/detected/in/1/" } diff --git a/hobu_distance_ir_io/app.js b/hobu_distance_ir_io/app.js index 93c1124..c628590 100644 --- a/hobu_distance_ir_io/app.js +++ b/hobu_distance_ir_io/app.js @@ -69,9 +69,9 @@ function connect(item) { Log.log('Distance Value: ' + distance); if(distance < item.value) { - doDoorStateChangedCall(item.on.action.open); + doDoorStateChangedCall(HOST, item.on.action.open); } else { - doDoorStateChangedCall(item.on.action.closed); + doDoorStateChangedCall(HOST, item.on.action.closed); } } ); @@ -84,9 +84,11 @@ function connect(item) { } /* private */ -function doDoorStateChangedCall(options) { +function doDoorStateChangedCall(host, options) { + const HOST = host; + Log.inspect('Call options', options); - + callback = function(response) { var str = ''; diff --git a/hobu_distance_ir_io/config.json b/hobu_distance_ir_io/config.json index f7a9ea9..721054c 100644 --- a/hobu_distance_ir_io/config.json +++ b/hobu_distance_ir_io/config.json @@ -9,12 +9,12 @@ "action": { "timeout": 2000, "open": { - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/door/100/to/open/" }, "closed": { - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/door/100/to/closed/" } diff --git a/hobu_distance_switch/app.js b/hobu_distance_switch/app.js index d7ecf5f..41b9bbe 100644 --- a/hobu_distance_switch/app.js +++ b/hobu_distance_switch/app.js @@ -76,7 +76,7 @@ function connect(item) { var url2callObj = (counter % 2 == 0 ? item.on.action.on : item.on.action.off); Log.log('Distance Value: ' + distance + ', URL to call: ' + url2callObj.host + ':' + url2callObj.port + url2callObj.path); - doHoBuDoorBellCall(url2callObj); + doHoBuDoorBellCall(HOST, url2callObj); setTimeout(function() { readyForNextNotification = true; }, item.on.action.timeout); } @@ -92,7 +92,9 @@ function connect(item) { } /* private */ -function doHoBuDoorBellCall(options) { +function doHoBuDoorBellCall(host, options) { + const HOST = host; + callback = function(response) { var str = ''; diff --git a/hobu_distance_switch/config.json b/hobu_distance_switch/config.json index 5f4f4ee..4125a86 100644 --- a/hobu_distance_switch/config.json +++ b/hobu_distance_switch/config.json @@ -10,12 +10,12 @@ "action": { "timeout": 2200, "on": { - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/powercontrol/23/to/1/" }, "off": { - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/powercontrol/23/to/0/" } @@ -32,12 +32,12 @@ "action": { "timeout": 2200, "on": { - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/powercontrol/27/to/1/" }, "off": { - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/powercontrol/27/to/0/" } diff --git a/hobu_io4/app.js b/hobu_io4/app.js index 9c080b2..5279958 100644 --- a/hobu_io4/app.js +++ b/hobu_io4/app.js @@ -93,17 +93,19 @@ function connect(item) { function handleDependingOnValue(item, value2check) { switch(value2check) { case item.on.action.open.value: - doDoorStateChangedCall(item.on.action.open); + doDoorStateChangedCall(HOST, item.on.action.open); break; case item.on.action.closed.value: - doDoorStateChangedCall(item.on.action.closed); + doDoorStateChangedCall(HOST, item.on.action.closed); break; } } /* private */ -function doDoorStateChangedCall(options) { +function doDoorStateChangedCall(host, options) { + const HOST = host; + Log.inspect('Call options', options); callback = function(response) { diff --git a/hobu_io4/config.json b/hobu_io4/config.json index 8f45b9d..57157dd 100644 --- a/hobu_io4/config.json +++ b/hobu_io4/config.json @@ -9,13 +9,13 @@ "timeout": 2000, "open": { "value": "1110", - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/door/100/to/open/" }, "closed": { "value": "1111", - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/set/state/of/door/100/to/closed/" } diff --git a/hobu_sound_intensity/app.js b/hobu_sound_intensity/app.js index ed1214a..b7e7263 100644 --- a/hobu_sound_intensity/app.js +++ b/hobu_sound_intensity/app.js @@ -68,7 +68,7 @@ function connect(item) { // Callback function for intensity callback function (intensity) { Log.log('Intensity: ' + intensity); - doHoBuDoorBellCall(item); + doHoBuDoorBellCall(HOST, item); } ); @@ -81,7 +81,9 @@ function connect(item) { /* private */ -function doHoBuDoorBellCall(item) { +function doHoBuDoorBellCall(host, item) { + const HOST = host; + var options = { host: item.on.action.ring.host, port: item.on.action.ring.port, diff --git a/hobu_sound_intensity/config.json b/hobu_sound_intensity/config.json index 7a58b68..1eb7dbd 100644 --- a/hobu_sound_intensity/config.json +++ b/hobu_sound_intensity/config.json @@ -9,7 +9,7 @@ "period": 1000, "ring": { "marker": 2300, - "host": "hobu", + "host": "hobu.local", "port": "2999", "path": "/doorbell/ring/Wohnungstür/" } diff --git a/hobu_value_picker/app.js b/hobu_value_picker/app.js index 3751145..b4f1f5b 100644 --- a/hobu_value_picker/app.js +++ b/hobu_value_picker/app.js @@ -117,6 +117,7 @@ function connectCategoryHR(item, ipcon) { /* private */ function saveValue(value, item) { + const HOST = item.host; var room = item.on.new.value.room; var category = item.on.new.value.category; diff --git a/hobu_value_picker/config.json b/hobu_value_picker/config.json index 0492d19..6596368 100644 --- a/hobu_value_picker/config.json +++ b/hobu_value_picker/config.json @@ -11,7 +11,7 @@ "new": { "value": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "category": "TEMPERATURE", "room": 1 @@ -30,7 +30,7 @@ "new": { "value": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "category": "RH", "room": 1 @@ -49,7 +49,7 @@ "new": { "value": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "category": "TEMPERATURE", "room": 3 @@ -68,7 +68,7 @@ "new": { "value": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "category": "RH", "room": 3 @@ -87,7 +87,7 @@ "new": { "value": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "category": "TEMPERATURE", "room": 2 @@ -106,7 +106,7 @@ "new": { "value": { "type": "web", - "host": "hobu", + "host": "hobu.local", "port": "2999", "category": "RH", "room": 2