Hi,
i'm trying to switch from IOBroker to Homeassistant so i'm realy new to Homeassistant.
For a few years i am using IOBroker to control my smart devices. Mainly Ikea Zigbee devices. So i installes Zigbee2mqtt on a Kubernetes host besides Homeassistant and NodeRED.
But i can't find a way to have a system similar to the Javascript functions in IOBroker. In IOBroker one can completly write automations in Javascript.
So a small part of a script i'm trying to create in either NodeRED, pyscript or plain Homeassistant and i'm failing hard:
on({ id: idBrightStop, change: "ne" }, async function (obj) {
if (obj.state.val) {
if (DEBUG == true) console.log("Stoppe Timer");
setState(idLevelMove, 0);
}
});
on({ id: idBrightUp, change: "ne" }, async function (obj) {
if (obj.state.val) {
if (DEBUG == true) console.log("Starte Timer");
setState(idLevelMove, 100);
}
});
on({ id: idBrightDown, change: "ne" }, async function (obj) {
if (obj.state.val) {
if (DEBUG == true) console.log("Starte Timer");
setState(idLevelMove, -100);
}
});
This part of the script watches the Button on / off on the remote beeing held triggering the brightness_up / brightness_down actions and moving the brightness up untill brightness_stop is published.
is there some way i can do something like this in homeassistant? I realy dislike dragging blocks or IFTTT like logics...
pyscript has the problem that i can't figure out how i could trigger on actions from the remote.