i am currently trying to use a User Input (The user puts in 2 Dates). The goal is to put those Dates in to something like a variable and then use those variables in a rule to switch something on in when the current date is inbetween the 2 Dates.
Tutorials and Solutions is a place to post tutorials, not a place to ask for them. I’ve moved this to a more appropriate location.
I strongly recommend going through the Getting Started Tutorial because this is going to involve a lot of different pieces of OH to achieve and you need to know how they all work together.
You have two Dates so you’ll have DateTime Items.
You have something to turn ON which means you have a Switch Item and a Thing with a Switch Channel Linked to that Thing.
You want to do something so that means you need a rule.
Things have Channels. Channels get Linked to Items. Items can be manipulated using the UI (i.e. set the dates) or from rules.
Rules are event driven. “When this happens do that”.
So you need to create a rule that runs based on some event (midnight on the start date?) that commands some Item ON and one that turns it OFF when the second date happens (maybe two rules?). You may need to run the rule a bit more often because what’s it supposed to do if OH restarts between those two dates?
I can’t be more specific because you were not more specific. Also, we don’t tend to “do the homework” for you because then you are forever dependent for help on the forum and never learn how to build it yourself. So give it a try and when or if you run into trouble come back with specific questions with details and we will be happy to clear up any confusion or missing information for you or help you solve some problems.
My current Idea is that i set up a widget where the User can put in 2 Dates. Then the User clicks on the button which triggers a Switch Item and that triggers a Rule where those 2 Dates are saved in 2 DateTime Items. Besides that i have another Rule which checks every Day if the current Date is between those 2 saved Dates.
I already have the widget and the 1st rule is triggered when i click on the button. Problem is it wont save those 2 Dates.
Does my Plan make sense and how would i save those 2 Dates so i can compare them in the other rule with the current date?
i am here again but with a different question. The other one is solved.
I am now trying to set up an input card with a DateTime Item. But i only want to show the Time. The problem now ist that if i just use the type “time”, the time is not shown after i e.g. reload the page. It is saved in the Item though with the correct time.
I think you’re going to have to put in a feature request in the OH UI repository. It doesn’t look like the oh-input is currently configured for this. Right now the oh-input identifies any use of a date based input type and then performs specialized formatting of the item state to match that input type. However it bases that identification on whether the string "date" is found at the front of the type parameter. So, a type of time is not detected as a “date” input type and the pre-existing item state is not formatted.
The repository is here:
And if you’ve never filed an issue before then you may find this helpful: