openhab-scripters / openhab-helper-libraries

Scripts and modules for use with openHAB
Eclipse Public License 1.0
88 stars 69 forks source link

[Mode (Time of Day)] modes triggered by items #314

Closed Tomibeck closed 4 years ago

Tomibeck commented 4 years ago

It would be great to not only Trigger a change in mode by channel or Time-based but through the update of an Item. This would be helpful if one would for example like to always have switches to override current behaviour.

5iver commented 4 years ago

I've never seen a need for using Items to set a mode, but you could try to convince me! Mode is a StringItem, so you can easily use it in a sitemap or Habpanel to set a value directly. This will then stop the mode from advancing. Switches are also binary... so, what would happen when it turned off? DateTimeItems would be possible, but changing it's state would require reloading the rule.

Tomibeck commented 4 years ago

Ah that makes sense so basically I could just use a list item and a rule to set the string ire accordingly. That shoul work thanks. The idea was to make it more flexible for example using the sun state channel which not just has a start event but also different dawn and dusk states. Interesting I didnt know that. So when i either manually switch the light or set the state the rule won’t override it ? For how long?

5iver commented 4 years ago

The Astro Channels can be used as triggers. I'm not sure what you are asking about in your other questions. Why don't you start a topic in the forum, describing what you'd like to happen with use cases and I can help you with the how's. ;)

Tomibeck commented 4 years ago

Makes sense I’ll close this