Nic0205
(Nic0205)
March 27, 2022, 3:04pm
#1
Hey there,
i am quite new to OH3 and blockly and want to set a light to “ON” if the lux of a brightness sensor is smaller than 125lx AND it is a time between 4pm and 11pm.
Could you guys give me a hint how i could achieve the time thing?
Cheers, Nic
Rolli
(Roland Mayr)
March 27, 2022, 3:39pm
#2
For the time comparison you need to install the “Date and Time” block library from the add-ons automation menue.
JustinG
(JustinG)
March 27, 2022, 4:32pm
#3
See the in process Blockly tutorial that covers, step-by-step something very similar to your scenario:
I’m returning to the Getting Started Tutorial. This is a first draft before I submit it to the official docs to give people a chance to review and make changes. It’s a wiki so please edit as necessary and leave a comment.
Thanks.
What should one do if the simple “when-then-but only if” rules are not enough? This is where the Script Actions and Script Conditions come into play. Both of these are a way for you to write code that can be as long and complex as it needs to be to achieve your goals…
Matze0211
(Matthias)
March 27, 2022, 8:01pm
#4
Instead of managing these conditions within blockly you can also add it to your rule as rule condition (the “but only if” part)