-
Autor
Hallo zusammen,
ich hab z.B. zwei Actions (Beispiele) und möchte gezielt nach den Daten eines der Actions suchen bzw. filtern.
Letztendlich, ob der Action "Test_Input" ein- bzw. ausgeschalten ist.
Hab schon verschiedenes versucht, aber weiter als bis hooks komme ich nicht.
"name":"Test_Input"
"enable": ????
Vielen Dank.
Patrick
Log ist als Kommentar am Code-Ende
Code
Shelly.addStatusHandler(function (e) {
if (e.delta.webhook_rev !== 'undefined') {
print("JSON-Status: " + JSON.stringify(e));
Shelly.call(
"http.get",
{ url: "http://127.0.0.1/rpc/Webhook.List" },
function (response, error_code, error_message, ud) {
let jsonDataHooks = JSON.parse(response.body).hooks;
print("webhook-list: " + JSON.stringify(jsonDataHooks));
},
null
);
}
});
// Log:
// JSON-Status: {"component":"script:4","name":"script","id":4,"delta":{"id":4,"running":true}}
// webhook-list: [{"id":2,"cid":0,"enable":true,"event":"input.button_push","name":"Test_Input","ssl_ca":"ca.pem","urls":["http://127.0.0.1/rpc/switch.set?a2=1&on=true&id=0"],"active_between":["00:00","23:59"],"condition":null,"repeat_period":0},{"id":1,"cid":0,"enable":true,"event":"input.button_longpush","name":"Test_Input_long","ssl_ca":"ca.pem","urls":["http://127.0.0.1/rpc/switch.set?a2=1&on=true&id=0"],"condition":null,"repeat_period":0}]
Alles anzeigen