roblans / ZWave4Net

ZWave4Net is a .NET library that interfaces with the Aeotec / Aeon Labs Z-Stick.
MIT License
41 stars 34 forks source link

Reading measurements from an Aeon MultiSensor 6 #12

Closed stmax82 closed 5 years ago

stmax82 commented 6 years ago

I have an Aeon MultiSensor 6 (running on batteries) and would like to read the temperature every 15 minutes.

Could you please provide an example of how to do that?

So far I tried to get a SensorMultiLevel object from the sensor and subscribe on the Changed event. But this event seems to occur only every 60 minutes.

I also tried to get a WakeUp object and use SetInterval to set the wakeup interval to 15 minutes. Now the WakeUp.Changed event occurs every 15 minutes, but the SensorMultiLevel.Changed event still occurs only every 60 minutes.

Do I have to manually read the temperature values when the WakeUp.Changed event is fired? If so, can I do this within the event handler without blocking anything? And how long does it stay awake?

Thanks!

yesyesuk commented 6 years ago

I believe you need to set the wake-up interval on the sensor (COMMAND_CLASS_WAKE_UP). You can't really query the sensor directly, the sensor needs to wake up periodically and report the current values.

molotch commented 6 years ago

If you run the sensor on battery you can only have the reporting interval set to 4, 60 or 120 minutes.

You can read more about the parameters here (firmware 1.07), the interval settings for report group 1 are in parameter 111. https://www.vesternet.com/mwdownloads/download/link/id/1883/

roblans commented 6 years ago

The MultiSensor 6 has a configuration parameter to change the ReportInterval to 15 minutes (see the manual)

You can change a configurationvalue by using the following code:

var configuration = node.GetCommandClass(); await configuration.Set(parameter, value, size);

Regards,

Rob Lans.

stmax82 schreef op 2018-05-16 10:34:

I have an Aeon MultiSensor 6 (running on batteries) and would like to read the temperature every 15 minutes.

Could you please provide an example of how to do that?

So far I tried to get a SensorMultiLevel object from the sensor and subscribe on the Changed event. But this event seems to occur only every 60 minutes.

I also tried to get a WakeUp object and use SetInterval to set the wakeup interval to 15 minutes. Now the WakeUp.Changed event occurs every 15 minutes, but the SensorMultiLevel.Changed event still occurs only every 60 minutes.

Do I have to manually read the temperature values when the WakeUp.Changed event is fired? If so, can I do this within the event handler without blocking anything? And how long does it stay awake?

Thanks!

-- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2].

Links:

[1] https://github.com/roblans/ZWave4Net/issues/12 [2] https://github.com/notifications/unsubscribe-auth/ANhzQb6C_cUMj-W3LR-n_ml-FNLhmlOvks5ty-ScgaJpZM4UA3rY

stmax82 commented 5 years ago

Thanks for the hints!

I followed the Aeotec Multisensor 6 Engineering Sheet linked by @Molotch.

Looks like one has to configure the wakup interval first and then the interval time for sending reports:

Node node = ...;

var wakeup = node.GetCommandClass<WakeUp>();
await wakeup.SetInterval(TimeSpan.FromMinutes(5), node.NodeID);

var cfg = node.GetCommandClass<Configuration>();

await cfg.Set(111, 300); // interval time for sending reports in report group 1 (in seconds)

// there are a few more params that should be set just to make sure... like:
await cfg.Set(48, 0); // disable sending reports when a measurements cross a certain limit
await cfg.Set(101, 241); // values to send in report group 1 (all)
// ...

Having the sensor configured like that, it starts sending its values in 5 minute intervals.