toto
(toto lino)
November 21, 2017, 4:14pm
1
Hi guys.
I have set up my rollershutters and everything works fine. They go down when the sun goes down etc.
Now i would like to go them down earlier when i am Away.
item file
switch awayswitch
sitemap file
Switch item=awayswitch label="Away"
Now i would like to set up a rule
if rangeevent sunset is triggered &&
if awayswitch == ON
than sendCommand rollershutter DOWN
I cannot find my awayswitch in the rule engine. Only items which are connected to things.
lifedown710
(Christer Voreland)
November 21, 2017, 4:22pm
2
Hi Toto
You could try and write the rules directly in a .rules file
It would probably be something like this:
rule "Away WindowRoller"
when Item Sunset received update ON
then if (awayswitch.state==ON){
sendCommand(rollerShutter,DOWN)
}
end
Regards Chris
toto
(toto lino)
November 21, 2017, 4:35pm
3
Thank you
Next problem: How can i save the state of the item awayswitch
Spottyq
(Spottyq)
November 21, 2017, 4:38pm
4
What do you mean by “save the state” ? Are you talking about persistence ? (If so, check the restoreOnStartup strategy)
1 Like
toto
(toto lino)
November 21, 2017, 4:39pm
5
When i switch the awaystate to ON and reload the BasicUI its again OFF
rlkoshak
(Rich Koshak)
November 21, 2017, 5:41pm
6
Examples of how to trigger rules based on sunset and/or set times of day:
[Edit] Adde link to Time of Day State Machine
For years now I’ve let this Design Pattern post get out of hand so I’m going to rein it in a bit now. It’s really expanded away from what it’s originally intended to be (i.e. a way to illustrate how to code a time based state machine) into a thread that is mostly about the example, Time of Day. It’s partially my fault for naming the thread “Time of Day”. But there are better alternatives for Time of Day in specific and time based state machines in g…
Example of how to generically track presence:
Edit: A rewrite to take advantage of the Debounce rule template on the marketplace.
This is a tutorial to show a generic and sensor independent way to do presence detection with multiple sensors and implementing anti-flapping (i.e. all sensors must be OFF for a certain amount of time before the home goes to away).
Requirements
One or more Switches determines whether someone is present.
If one or more of these Switches is ON then someone is presumed to be present (more complex algorithms are …
You will have to decide what sorts of sensors to use to detect presence. The Network Binding tends to be a common first choice for most users.
1 Like
toto
(toto lino)
November 21, 2017, 7:39pm
7
Thank you for the information.
Could you maybe also help me with my complete noob problem above?
When i use the simple away switch in the sitemap its giving me this error:
2017-11-21 20:34:56.497 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'awayswitch' for widget org.eclipse.smarthome.model.sitemap.Switch
2017-11-21 20:34:57.806 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/awayswitch' for the unknown item 'awayswitch'.
toto
(toto lino)
November 21, 2017, 7:50pm
8
Do i have to add a things file to get my lonely switch work?
rlkoshak
(Rich Koshak)
November 21, 2017, 9:51pm
9
All I can recommend is to review the Beginner’s Tutorial.
The error indicates that there is no such thing as “awayswitch” in your configuration. And your second question indicates you do not yet understand some of the key concepts of OH, in particular what Things are.
There is not enough information provided to give a specific suggestion. But I do notice that switch awayswitch
should be Switch awayswitch
.
1 Like
toto
(toto lino)
November 21, 2017, 10:08pm
10
Thank you thank you and once again thank you. That solved it