and rules:
rule "Someone moving"
when
Item Motion_Sensor changed from OFF to ON
then
if(Motion_Sensor.state==1)
sendCommand(Light_Switch,ON)
end
rule "Someone doesn’t move"
when
Item Motion_Sensor changed from ON to OFF
then
if(Motion_Sensor.state==0)
sendCommand(Light_Switch,OFF)
end
Can anyone help me with rules, are there correct??
I looked openhab.lob and only one error is <17:43:00.055 [ERROR] [.o.m.r.i.engine.ExecuteRuleJob:57 ] - Error during the execution of rule Persistence Demo/>
And where can I found zwave.log?
I don’t think you can have two items with the same name (Motion_Sensor), why would you need that?
I suggest going step by step, so comment out the mqtt part for now.
You don’t have Light_Switch configured in your items file, no hardware can be switched this way.
You need to bind any sensor or actor to your hardware.
Please don’t get me wrong: you need to start with the basics, read the wikis for items setup, sitemap setup and take a look at the demo rules …
Yes, you need a rule to switch on a light when your motion sensor detects motion.
A second way to do that are associations: you may bypass your controller if you have zwave devices which support associations, those can also be set via habmin.
But the “normal” way is to use a rule.
I can try, but you are not giving much information
What do you want to achieve?
What do you want to do when your sensor detects motion? Switch a light? Activate an alarm? Open the the door to get the dog or cat out?
When you can answer this question also tell us which hardware in addition to the motion sensor you are using and how you bind it to openhab …
Then you can’t do anything: you only have a sensor, you don’t have any actors …
You could buy a zwave relay switch or a dimmer, connect it to one of your lights, configure it with the item name “Light_Switch” in your items file and use the above rule which should work. In this case the light would be on as long as the motion sensor is in the open state.
At the moment you can only show the state of the motion sensor in your sitemap which is something you are already doing …
I should display data from openhab, using mqtt server, but can do without that part-that part for rules? Can I take the data from this sensor, using mqtt server and displayed in Wireshark?
I’m pretty sure that is possible but I have never used that.
My mqtt sensors go directly through the mqtt binding to openhab, so you need to wait for someone who knows how to do that with with rerouting through zwave…