Item for everspring sp 103 motion sensor-zwave

Whats the wakeup interval of your device?

I wrote rules
rule "Someone moving"
when
Item Motion_Sensor changed from CLOSED to OPEN
then
sendCommand(Motion_Sensor,OPEN)
end

rule "Someone doesn’t move"
when
Item Motion_Sensor changed from OPEN to CLOSED
then
sendCommand(Motion_Sensor,CLOSED)
end

In openhab I can see Motion_Sensor received command OPEN/CLOSED. Is this rule correct? And where can I see wakeup interval of my device? Sorry, Im totaly new in this, and everything is confusing for me.

Your syntax is basically correct, but your logic is wrong.

In the “when” part you define your trigger for your motion sensor, that is correct.
In the “then” part you define the action which should be performed when the trigger gets executed. For example if the motion sensor opens, switch a light on. In your rule you send a command to a motion sensor, that is not possible at all.
Do you have any actors configured, maybe a light switch?
Then the “then” part could be something like

then 
sendCommand(Light_Switch,ON)
end

and in the second rule

then 
sendCommand(Light_Switch,OFF)
end

To configure your zwave network you may use habmin, you are also able to see your wakeup time there.

For example if your wakeup time is set to 6 hours, it could take 6 hours before you see the battery level.

Edit: for habmin, don’t use the downloaded zwave binding, it’s outdated, keep yours.

Oh, thank you so much. I already have habmin. I saw wakeup period, for my sensor is 14400 (That is 4 hours?), but I don’t understand how can I configure this actors (Light_Switch). First time I put also like this, but answer was error. Can you help me with thishow to do ?? ( “Do you have any actors configured, maybe a light switch?” )

Correct!

For your light switch: just insert the item name for your light switch into your rule and it should work.
If not, post your items file, your rules file and your sitemap file here and I’m sure there will be a forum member who can help you.
Also take a look into your openhab.log if there are any errors. If you have configured zwave according to the wiki and therefore have a separate zwave.log, take a look there too.

Thanks a lot. Ok, my items are:
Switch Motion_Sensor “MotionSensor” (group) { zwave=“46:command=sensor_binary,respond_to_basic=true” }
Number Motion_Sensor_Battery “MotionSensor Battery [%d %%]” { zwave=“46:command=battery” }
Switch Motion_Sensor {mqtt="<[mosquitto:inTopic:state:default]"}

sitemap
sitemap default label=“Main Menu”
{
Frame label=“Motion Sensor” {
Switch item=Motion_Sensor
Text item=Motion_Sensor_Battery
Switch item=Motion_Sensor
}
}

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 …

https://github.com/openhab/openhab-distro/blob/master/features/openhab-demo-resources/src/main/resources/rules/demo.rules

Edit: you only have a separate zwave.log if you did configure that in your logback.xml, see last paragraph in the zwave wiki

Is first and second item correct and sitemap without item for mqtt?

Yes, because you already posted:

Thank you.Can without rules or I must write that 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.

Can you help me, please? This is new for me, and I don’t have much time

I can try, but you are not giving much information :sunglasses:
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 …

Maybe switch a light or activate an alarm? Which is easier for you? I only have aeon labs z-wave usb stick and sp103 everspring Motion Detector.

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…

Thanks a lot. I’ll wait.

What I’ve found is that you can have multiple bindings for one item:

So in your case it could look like

Switch Motion_Sensor "MotionSensor"	(group)	{ zwave="46:command=sensor_binary,respond_to_basic=true" ,  mqtt="<[mosquitto:inTopic:state:default]"  }

I don’t know how you have to configure the mqtt part in this case, you have to find out that yourself.

Thank you a lot.I write new post for this question.