-
-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow offset for "at the time specified in an item's state" trigger #4195
Comments
I like the idea. The only tricky part is what should happen if the Item changes within the offset time? For example, if the Item changes and the offset puts the time into the past, should the rule trigger or should the rule be skipped this time around? In the mean time, for astro events at least, you can apply an offset on the Channel config. In all other cases you can use a proxy Item and a rule to update the proxy to the changed time with the desired offset and use the proxy to trigger the rule. |
Yes, but I can only apply one offset. However I want to turn on lights when it starts getting darker and lower blinds when it's dark. For now I'll use the three different types of dusk as triggers: nautic, civil and astro. |
i've not tried this myself, but I'm wondering... If you create your Astro thing using a @rkoshak WDYT? Would this be possible? |
The binding would have to be made to support it and I doubt it has. It's worth an experiment though. I doubt it would work though. It could be a cool addition to the binding though.
Yes, I know and that's why that approach is just a work around, not a solution. I really like the idea of adding an offset to the Time is Item trigger. It would work with other bindings too like iCal Another approach is you could create a rule that triggers when an Item linked to Dusk changes and update other DateTime Items with the Dusk time plus/minus the desired offsets. Or you could set timers to call your rules you want to run at the various times and avoid the extra Items. Yet another approach is you could use a script transform to add/subtract an offset of the time coming from the Astro Channel before it gets to various Items. This approach doesn't need rules but does need more Items.
You can pass the |
Looks like a non-starter. The DSL syntax for a Thing doesn't allow a group (e.g.
So no real point in even looking at what would be required in the binding. |
Maybe all is not hopeless. The binding could be made to support defining wholly new Channels similar to the way MQTT and HTTP do and in the configuration part of the channel definition we could supply the name of the already existing Channel upon which to base the times. Then maybe that one Channel config could generate the three Channels (start, stop, and event).
One could even get crazy and create wholly new solar events based on sun angle, create a different offset for start and stop, or stuff like that if one wanted to. I'm not sure there's a lot of demand for something like this though and I imagine it would be a lot of work. It would be easier to change the Time is Item trigger to support offsets I think to get to the same end result. |
I'd like to use the trigger "at the time specified in an item's state" for a rule, but be able to configure an offset. Then I can define "trigger one hour before sunset".
Your Environment
The text was updated successfully, but these errors were encountered: