I think its a lot easier to create a HTTP-Server on the Plus2PM which would listen to HTTP Requests from SHelly 1 L (Action)
Code
HTTPServer.registerEndpoint('testserver', function (req, res) {
// check request and comapare the querystring
if (req.query === 'turn=on') {
// response with some text
res.body = 'Shelly Webserver: on';
res.code = 200;
res.send();
// Do something, e.g. Shelly.Call();
} else if (req.query === 'turn=off') {
// response with some text
res.body = 'Shelly Webserver: off';
res.code = 200;
res.send();
// Do something else, e.g. Shelly.Call();
}
else {
res.body = 'Shelly Webserver';
res.code = 200;
res.send();
}
})
Alles anzeigen
Action Call from the Shelly 1L
http://192.168.178.84/script/1/testserver?turn=on
http://192.168.178.84/script/1/testserver?turn=off
script/1 <- id from the HTTP-Server script