In our extensive experience, writing the code for you ends up resulting in a huge time sink. We write this Rule for you, you copy it, don’t under stand it, then need us to write the next one and the next one and so on forever. Or even worse, we need to debug it for you when it doesn’t work.
So here.
rule "Request a refresh"
when
Time "cron 0 0/5 * 1/1 * ? *"
then
g_Refresh_TRV.sendCommand(ON)
end
It doesn’t get much simpler than that. You should have been able to come up with that from the links I provided. This is like half a step away from “hello world” the canonical first program one writes in any language. This is literally as simple as it gets for Rules.
And this is pretty close to at least one of the Examples in the Rules Documentation I linked to:
rule "Increase counter"
when
Time cron "0 0 0 * * ?"
then
counter = counter + 1
end
So now one must ask, do you really know any more now than when you started? Do you understand what the Rule above does? Why it works? How to debug it when it doesn’t work? No, you don’t. And now you will copy and paste that code, run it, and have no idea what to do when/if it doesn’t work. You have no idea how to expand it. You have no idea how to write another rule that does something different. And we here on the forum are now suck for ever writing your code for you.
And when you ask for examples, it shows that you neither read the docs which are riddled with examples (e.g. https://www.openhab.org/docs/configuration/rules-dsl.html#rule-examples) nor did you browse or search the forum (https://community.openhab.org/c/tutorials-examples).
Anyway, you get this one for free. But as you can see, in the future, we won’t usually be writing your code for you, especially when you demonstrate either a lack of understanding which is made clear from reading the docs, or a lack of effort to search for something in the forum that already addresses what you need.
Then state clearly and explicitly where you are stuck. And the real key is show us what you’ve done (i.e. show us your attempts at .rules code). I’m stuck isn’t something we can help with. “I’ve written this rule (paste in code) and put it in a file at path blah/blah/blah and nothing happened.” THAT we can provide help for.
So far what you’ve asked for is for us to do it for you. And we don’t do that because it ends up becoming a huge time sink for all of us. For a one liner Rule like this “show me an example” literally is “do it for me.” And you’ve shown no attempt to do it yourself.
Don’t know where to save the Rule file?
Don’t know what format a Rule should have?
Don’t know how to cause a rule to trigger periodically?
Don’t know how to send a command to a Group Item?
Don’t know how to put it all together?
So either you didn’t bother to read the docs or use the resources available to you or you did in which case you need to tells us exactly and specifically where you went wrong. Don’t like reading docs? Prefer Videos? If you had bothered to click on the link I provided in post 15 above you would have encountered a bunch of great video guides that will help.
We have all provided just about everything you need on this thread to do what you are after. But you have not bothered to even click on the links. You just want what you want exactly the way you want it.
We all have wives and kids and families too. We don’t sit up through the night coding up other peoples home automation system for them. We don’t even do so for our own home automation systems. But if you think you can get away with building a home automation system without learning to write Rules you are in for disappointment. If you can’t or wont use the resources provided to you, and there are thousands of man hours of effort provided to you in documentary and explanatory effort in the links that exist in this thread that you have ignored, you will not be successful with openHAB.
If there is something specifically not clear in these docs, tell us and we will try to make them better. But so far all you’ve done is ask us to do it for you. It doesn’t work like that. You have to be able to read the docs and apply them to be successful with openHAB or any home automation system really.
And yes, we are spending way more time here on these posts telling you what to do but not coding it for you for a reason. If we give you a fish, we’ll be stuck being your fisherman forever. If we teach you to fish than ultimately we have more time to help more people.
As I like to say, our time has value too. None of us are getting paid for this.