Your rule is better, but still:
Try to reduce the number your rule runs to a Minimum. That’s why I suggested “rangeEvent
”, which basically does, what you do in the IF-clauses above.
Still: Your “Sunrise_Event”, if taken from Rich’s model is only Sunrise, it won’t happen at 16pm or even 22pm! You need two Events: Sunrise or Sunset. Or, you could use the channel “DAYLIGHT”, which tells you, whether there’s daylight. You should run through the docs here:
So, do you define your astro2-binding in PaperUI or via Texts? I assume in PaperUI, then open your Configuration > Things, there should be a Thing called “Astro Sun Data”, in which there are channels like Sunrise, Sunset, … You can insert some configuration there for “rangeEvent” (click on the edit-icon for let’s say “daylight start time
” you can insert there earliest (here 06:00) and latest (here 10:00). So, OH2 should set the Event for daylight (if civil dawn is END) to 6:00am earliest and 10am latest (ok, this won’t happen in Western Europe - and: i won’t do any harm here, but it could be, that civil dawn is END already before 6am)
So, just check the docu and if there are any questions left, come back!
regarding your Sonoff. In mqtt.cfg you define the connection to the broker. If OH2 won’t get an state update (you have checked the events.log?), then there’s some work to do here also.
What I meant is, in the WebGUI you can define the name of the topic, your Sonoff CH4 uses. If you didn’t Change anything, it’s unlikely the topic is cmnd/huehnerstall
. For the correct topic either change the config in configuration - MQTT or open the console (link on the WebGUI startpage) and have a look what happens, if you click the Hardware button on the Sonoff or click it in the WebGUI:
14:37:35 MQT: stat/SonoffDryer/POWER = ON
that is my Sonoff POW’s message, but I named the Topic “SonoffDryer”, so you’re definition of the Switch should read:
Switch Sonoff_CH1 "Innenlicht" { mqtt="<[mosquitto:stat/huehnerstall/POWER1:state:default], >[mosquitto:cmnd/huehnerstall/POWER1:command:*:default]" }
please note (sorry, I didn’t see it earlier): incoming message should read stat/huehnerstall/POWER1
instead of cmnd/huenerstall/POWER1