T-A
(Thomas Anhoeck)
April 4, 2019, 8:15am
1
Platform information:
Hardware: Intel NUC
OS: Windows 10
Java Runtime Environment: jdk1.8.0 191
openHAB version: 2.3.0
I tried to program a rule using the case command but failed plenty of errors. As I am not an experienced programmer I ask here for a hint.
Thnks
smhaller
(Stefan M. Haller)
April 4, 2019, 8:33am
2
Hi Thomas
switch - case logic is possible. But your used syntax looks wrong.
One example can be found here:
Hope that helps.
Regards
Stefan
ljsquare
(Laurens Jan Merkx)
April 4, 2019, 9:14am
3
Iāll give you a start, the rest is up to you
rule "TagabhƤnging"
when
Channel āastro:sun:local:set#eventā triggered START
then
switch (now.getDayOfWeek){
case 1: Waschen.sendCommand(ON)
case 2:
case 3:
}
end
More info about switch: switch expression
Good luck
T-A
(Thomas Anhoeck)
April 4, 2019, 9:24am
4
Great, thanks, thatās it!
T-A
(Thomas Anhoeck)
April 4, 2019, 9:41am
5
Hi Laurens
I have one additional question: Where can I find the possible values for the āget.ā function?
e.g. are the get.DayOfWeek values from 1 to 7 and is 1 Monday?
Thanks
T-A
(Thomas Anhoeck)
April 4, 2019, 4:09pm
7
Thanks Laurens. I am growing slowly into it. There are so many object, etc. to learn.
Best regards
Thomas
smhaller
(Stefan M. Haller)
April 4, 2019, 6:06pm
8
Dear Thomas
Donāt worry about that. Iām working now since more than 3 years with openHAB and Iām still a newbie so to say. It all depends what you would like to achieve and how. Some things are more easy than others.
So happy learning with openHAB
Cheers
Stefan