Du brauchst "ble-shelly-blu.js" sowie "ble-events-handler.js".
Im Event handler definierst du dann die Szenen.
Beispielsweise Doppelklick auf Taste 4
Code
/** SCENE 4.2 Start **/
{
conditions: {
event: "shelly-blu",
button: function (value) {
return (
JSON.stringify(value) === JSON.stringify([0, 0, 0, 2])
);
},
},
action: function (data) {
// Ab hier Aktion
print("S4.2")
Shelly.call("HTTP.GET",
{ url: 'http://127.0.0.1/light/0?turn=on&brightness=40' },
function (res, error_code, error_msg, ud) {
if (res.code === 200) {
print("Successfully transmitted a message");
};
},
null);
},
},
/** SCENE end **/
Alles anzeigen