Quelqu'un pour me confirmer si ce bout de code concernant l'instruction du bouton suffit à adapter le tuto à Domoticz svp ?
Code : Tout sélectionner
dash.on('detected', function (){
console.log(new Date() + ' : Une pression sur le Dash Button a été détectée.');
request.post(
'http://ip:port/json.htm?type=command¶m=switchlight&idx=14&switchcmd=Toggle',
{ json: { key: 'value' } },
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}
);
});Si c'est juste ça, je commande tout de suite !