genielabs / zwave-lib-dotnet

Z-Wave Home Automation library for .NET / Mono
Apache License 2.0
63 stars 37 forks source link

Motion Sensor notifications #36

Closed Jerem-35 closed 5 years ago

Jerem-35 commented 5 years ago

Hello,

I am currently facing issues with motions sensors notifications with a Fibaro FGMS-001 (I did try with another motion sensor with the same result).

How am I supposed to be notified when a motion is detected? I thought it would work with the "NodeUpdated" callback from ZWaveController but it never raises such event.

I dit try to use SensorBinary.Get(node) but as a result I am notifiied that the device is in sleeping mode.

Thank you.

Jérémy

Bounz commented 5 years ago

Have you added your controller to the Association Group 3 in sensor settings?

Jerem-35 commented 5 years ago

Thank you for your quick answer!

I did not! Is it something that has to be configured in zwavenodes.xml ? I did not find anything about association groups.

Bounz commented 5 years ago

No, you configure it in node settings.

image image

You have to add your controller (usually node 1) to this group.

Jerem-35 commented 5 years ago

If I refer to the code, it is something that can be done with the following function of Association.cs?

public static ZWaveMessage Set(ZWaveNode node, byte groupid, byte targetNodeId) (In this case with, groupeid=3, targetnodid=1)

From which application your screenshots are taken?

Bounz commented 5 years ago

Yes, this code should work. Screenshots were taken from HomeGenie home automation system https://github.com/genielabs/HomeGenie

Jerem-35 commented 5 years ago

Thank you a lot for your answers. I did not know anything about these groups, sorry for that. Here is the code I used for the ones who face the same issue :

ZWaveNode node0 = controller.GetNode(14); // My motion sensor Association.Set(node0 , 3, 1);

Now motion notifications are correctly raised.