:oops: :oops:
Ich bin manchmal einfach blind.
Mit dem richtigen Pfad
/opt/iobroker/node_modules/iobroker.phantomjs/picture.png
klappt das auch.
Zur Vollständigkeit das komplette Klingelscript:
! ````
var sperre = false;
! on({id: 'sonoff.0.Eingang.POWER2', change: "any"}, function (obj) {
if(!sperre) {
sperre = true;
sendTo('phantomjs.0', 'send', {
url: 'http://192.168.XXX.XXX:8765/picture/2/current/?_username=admin&_signature=5xxxxxxxxxx65eeb8e3d5935741934ad',
output: 'picture.png', // default value
width: 800, // default value
height: 600, // default value
timeout: 2000, // default value
zoom: 1, // default value
! 'clip-top': 0, // default value
'clip-left': 0, // default value
'clip-width': 800, // default value is equal to width
'clip-height': 600, // default value is equal to height
'scroll-top': 0, // default value
'scroll-left': 0, // default value
! online: true // default value
}, function (result) {
if (result.error) {
console.error(JSON.stringify(result.error));
}
if (result.stderr) {
console.error(result.stderr);
}
if (result.stdout) {
console.log(result.stdout);
}
console.log(result.output);
});
timeout = setTimeout(function () {
sendTo("email", "send", {
text: '',
to: 'XXXXXX@gmail.com',
subject: 'Klingel',
attachments:[
{path: '/opt/iobroker/node_modules/iobroker.phantomjs/picture.png', cid: "file1"},
]
});
}, 5000);
setState("vis.0.control.command", '{"instance": "FFFFFFFF", "command": "changeView", "data": "Neu/Tuer"}');
// oder
//setState("vis.0.control.instance", 'FFFFFFFF');
//setState("vis.0.control.data", 'DemoView');
//setState("vis.0.control.command", 'changeView'); // muss immer letzte sein
// Nach 10 Sekunden, zeige wieder Start View
setTimeout(function () {
setState("vis.0.control.command", '{"instance": "FFFFFFFF", "command": "changeView", "data": "Neu/Info"}');
}, 60000);
setState("tr-064.0.states.ring"/*ring*/, '**611, 15');
sendTo("pushover", "send", {
message: 'Klingel',
file: "/opt/iobroker/node_modules/iobroker.phantomjs/picture.png",
sound: ""
});
timeout = setTimeout(function () {
setState("alexa2.0.Echo-Devices.G2A0P30774060LLE.Player.volume"/*volume*/, 90, true);
}, 500);
timeout = setTimeout(function () {
setState("alexa2.0.Echo-Devices.G2A0P30774060LLE.Commands.speak"/*speak*/, 'Es ist jemand an der Tür');
}, 1000);
timeout = setTimeout(function () {
setState("alexa2.0.Echo-Devices.G2A0P30774060LLE.Player.volume"/*volume*/, 50, true);
}, 1500);
setTimeout(function() {
sperre = false;
}, 5000);
}
});