- Platform information:
- Hardware: CPUArchitecture/RAM/storage
- OS: what OS is used and which version
- Java Runtime Environment: which java platform is used and what version
- openHAB version:openHAB 2.5.9-1 (Release Build)
- Issue of the topic: please be detailed explaining your issue rules
- Please post configurations (if applicable):
- Items configuration related to the issue
- Sitemap configuration related to the issue
- Rules code related to the issue
- Services configuration related to the issue
- If logs where generated please post these here using code fences:
Hi welcome to OpenHAB. What is the problem as this has no information in it?
Hello:
Ia have some problems with my openhabian rules.
I have two conditions for moving my blinds but only one of them works.
One is luminescence (>350), ad it works well, but second (< 20.0) condition doesn’t work.
Can any one help me?
This is my rule
rule "control persianas"
when
Item ZWaveNode003ZW100Multisensor6_SensorLuminance changed or
Item ZWaveNode011ZW100Multisensor6_SensorTemperature changed
then
if (ZWaveNode003ZW100Multisensor6_SensorLuminance.state > 350)
{if (ZWaveNode011ZW100Multisensor6_SensorTemperature.state > 20.0)
{ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(0)
Thread::sleep(20000)
ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(0)}
else
{ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(100)
Thread::sleep(20000)
ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(100)}
}
else
{if (ZWaveNode011ZW100Multisensor6_SensorTemperature.state > 20.0)
{ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(100)
Thread::sleep(20000)
ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(100)}
else
{ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(0)
Thread::sleep(20000)
ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(0)}
}
end
See other thread
there is no point wasting your own time on duplicate postings.
sorry i just wanted to improve the visibility of my request
I scanned trough your rule, you describe the following in your question:
but second (< 20.0) condition doesn’t work.
I don’t see that statement in the code only two > 20.0 statements, could that be it ?
As a tip you could add some logging to the rule to see what your logic is doing:
You can read-back the logs in the openhab.log file
I’ll try
Thanks for your hel, I have reached it
when
Item ZWaveNode003ZW100Multisensor6_SensorLuminance changed
then
logInfo("test", "luz exterior " + ZWaveNode003ZW100Multisensor6_SensorLuminance.state.toString)
logInfo("test", "temp interior " + ZWaveNode011ZW100Multisensor6_SensorTemperature.state.toString)
var Number delta = (ZWaveNode011ZW100Multisensor6_SensorTemperature.state as Number).doubleValue
if (ZWaveNode003ZW100Multisensor6_SensorLuminance.state > 350)
{if (delta > 25)
{ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(0)
Thread::sleep(20000)
ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(0)}
else
{ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(100)
Thread::sleep(20000)
ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(100)}
}
else
{if (delta > 25)
{ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(100)
Thread::sleep(20000)
ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(100)}
else
{ZWaveNode009FGR223RollerShutter3_BlindsControl.sendCommand(0)
Thread::sleep(20000)
ZWaveNode008FGR223RollerShutter3_BlindsControl.sendCommand(0)}
}
end