Closed jlaur closed 10 months ago
To be precise: I'm not sure if actually supported, but it's not documented. I just noticed that there is a RuleBuilder example with timeOfDay("SUNSET")
, but actually this is not documented besides the example.
The TimeOfDayTrigger
is documented just before the DateTimeTrigger
in the JSRule section.
I just noticed that there is a RuleBuilder example with timeOfDay("SUNSET"), but actually this is not documented besides the example.
There is no actual support for that, the source code does not contain that. I will add the timeOfDay trigger, however it does not support something like SUNSET
(looking at openHAB Core).
I will add the timeOfDay trigger, however it does not support something like
SUNSET
(looking at openHAB Core).
In that case the example should probably be updated:
// Turn on the kitchen light at SUNSET
rules.when().timeOfDay("SUNSET").then().sendOn().toItem("KitchenLight").build("Sunset Rule","turn on the kitchen light at SUNSET");
@jlaur I have created a PR to add the trigger, see #291 and I also updated the documentation. The sunset rule is now triggered by using the Astro binding.
You can test the PR by installing my fork, execute in $OPENHAB_CONF/automation/js
:
npm install git+https://github.com/florian-h05/openhab-js.git#rule-builder
Currently there is no Rule Builder trigger for
DateTimeTrigger
(see https://www.openhab.org/addons/automation/jsscripting/#jsrule)As an example, this cannot be built with the rule builder:
This would be a nice addition.
Your Environment