roblans / ZWave4Net

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

aeotec multisensor battery problem #30

Closed phanindra466 closed 4 years ago

phanindra466 commented 5 years ago

Hi, I had multisensor 6 running on battery,the command class for multisensor has implemented batterydevice. but when i try to get battery level from multisensor through GetBatteryLevel().it is throwing transmission exception.How can i get battery level of device.

roblans commented 5 years ago

The batterylevel can only be retrieved when the sensor is awake. Subscribe to the 'WakeUp' event and invoke the GetBatteryLevel method:

multiSensor6.WakeUp += async (s, e) => { var batteryLevel = await multiSensor6.GetBatteryLevel(); };