Hello,
a very beginner’s question:
I am trying to create simple scene:
Name: Evening/Morning First press: it should close all Blinds in group gBlinds and switch on the Light_Living. Second press: open all in gBlinds and if the Light_Living is on, switch it off
The idea is to have it in Overview Pannel for easy access later.
Could someone help me where to begin? Is it doable with Rules?
Yes it is possible to do this via rules, but I would also take it a step further and leverage Astro to obtain sunrise/sunset (offsetting the actual values to ensure it is light enough or dark enough to trigger items) to control the blinds/light so it becomes more automatic.
As for a switch on a dashboard view, you want a item that only defines ON or OFF and base your rule on that trigger to “close the gBlinds group and turn on the light” and doing the reverse if the state of the triggering item is changed to the other state. Might also be worth while to add a small delay when changing the light’s state just to provide light long enough for the blinds to let in enough light.
Another thought is to also leverage a weather binding and make exceptions if you have heavy cloud cover or rain/snow lowering the total amount of light.
rules can be defined as text file in the /etc/openhab2/rules or with OH3 also in the graphical way via UI.
here is the rule im using which gets executed every night at 5am and switch on the heating, air conditioning, etc
file: /etc/openhab2/rules/premorning.rules
rule "Prepare for morning "
when
Time cron "0 00 5 ? * *"
then
hvac_livingroom.sendCommand(1)
hvac_kitchen.sendCommand(1)
fan_mode.sendCommand(3)
....
end
if you dont want it automatic but you want trigger it via a button, it would look like this
rule "Prepare for morning "
when
Item LivingR_Day_Night received command ON
then
hvac_livingroom.sendCommand(1)
hvac_kitchen.sendCommand(1)
fan_mode.sendCommand(3)
....
end
OK, thanks eugen ,
after some trials, I got my experimental rule working.
Important part of it was to find which command can I use to the specific Item.
Now my Rule looks like this:
Thanks for reply!
I am able to roll down the roller and switch the light, with the item LivingR_Day_Night, but I cant toggle it yet. Is something wrong in my configuration (please see upper)?
I have succesfully created a switch on the overview page, but it is not making anything in Run mode. Switch on, or switch off…
EDIT:
log warnings: 2021-01-30 22:20:57.643 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body reader has been found for class java.lang.String, ContentType: application/octet-stream
2021-01-30 22:20:57.647 [WARN ] [s.impl.WebApplicationExceptionMapper] - javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type