Hi,
I’m a bit stuck and can’t figure out how to fix it at this moment, I use the new Gardena API binding and everything is working fine from the control page.
So this is the setup:
Item:
- SensorPlantenbak_Sensor_Humidity (measures the percentage of humidity in the ground)
- WaterkraanAchter_Valve_commands_DurationWatering (this is a command item, before you start watering, it first want to know for how long, so you’ve to set it)
- WaterkraanAchter_Valve_commands_OpenValveWithDuration (you can command this item with ON or OFF to set the valve to open or close)
This is the rule I created so far.
rule "Bewatering plantenbakken achter" when
Item Rule_Trigger changed
then var Number w = SensorPlantenbak_Sensor_Humidity.state as Number if (w < 15) { WaterkraanAchter_Valve_commands_DurationWatering.sendCommand(60) WaterkraanAchter_Valve_commands_OpenValveWithDuration.sendCommand(ON) } else WaterkraanAchter_Valve_commands_OpenValveWithDuration.sendCommand(OFF) if (w < 30) { WaterkraanAchter_Valve_commands_DurationWatering.sendCommand(30) WaterkraanAchter_Valve_commands_OpenValveWithDuration.sendCommand(ON) } else WaterkraanAchter_Valve_commands_OpenValveWithDuration.sendCommand(OFF) if (w < 50) { WaterkraanAchter_Valve_commands_DurationWatering.sendCommand(15) WaterkraanAchter_Valve_commands_OpenValveWithDuration.sendCommand(ON) } else WaterkraanAchter_Valve_commands_OpenValveWithDuration.sendCommand(OFF) end
Now the problem is that multiple if statement can be true resulting in multiple command to set different times, I would like to see that if the first if statement is true, the other part of the rule get cancelled, is that possible?
Who can help me in the right direction