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:
NOTE: I’ve added an openHAB 2 Astro 2.0 binding version at the end.
NOTE: I’ve added an openHAB 2.2 version to the end which avoids the deprecation warnings on getCalendar()
Another transfer of a Design Pattern from the great big Design Pattern thread . I move them over to a new separate thread as I need to reference them in an answer to a question. NOTE: the rules have been extensively reworked to make them shorter and simpler.
Problem Statement
Often in home automation one has certain rules …
Example of how to generically track presence:
With the introduction of the Expire binding I’ve been revisiting my rules to see if there are opportunities for simplification. This represents one such instance which I’m posting because it represents perhaps the biggest reduction in complexity and lines of code of all the logic I’ve created in openHAB since the beginning.
First, the high level requirements are:
multiple sensors for each person, what those sensors are is irrelevant, so long as one indicates presence that person is assumed to…
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