Closed r9r-dev closed 5 years ago
Hi,
Try to get the power value by using the SensorMultiLevel class
var sensorMultiLevel = node.GetCommandClass<SensorMultiLevel>();
var powerValue = sensorMultiLevel.Get(SensorType.Power);
Thanks for your help @roblans ! It fails unfortunately.
It look like this device does not support SensorMultiLevel class. It is supporting the command classes listed on this page : https://products.z-wavealliance.org/products/1873/classes
At first, I guessed it should be Powerlevel command class. I forked your repository and started to handle it but Powerlevel is about the powerlevel of the zwave signal, not the power consumption of the connected device.
It look like this information is hidden somewhere else but I don't get it.
I tried the method GetSupported()
from the Meter
Command Class. It returns Electric as Type
and an array with kWh
and W
as supported Units. It look like it should be possible to add a parameter to the Get of the meter value of the command class ?
var meter = node.GetCommandClass<Meter>();
var supported = await meter.GetSupported();
Console.WriteLine($"{supported.Type} - {string.Join(", ", supported.Units)}"); // Electric - kWh, W
var consumption = await meter.Get();
Console.WriteLine($"{consumption.Value} {consumption.Unit}"); // 3,02 kWh
Yes, you are right, I checked the Z-wave specification and there is an extra optional parameter which can be passed to the Get command. This parameter determines the type of metervalue to return.
I will fix this tomorrow.
Rob.
That's really awesome. Thanks for sharing this library, it helps a lot :)
Done:
var meter = node.GetCommandClass<Meter>();
var value = await meter.Get(ElectricMeterScale.W);
New NuGet package (1.0.0.178) published.
Working perfectly, thank you :)
Hi,
I am using a Single Switch from Fibaro (FGS-213). Datasheet available here : https://manuals.fibaro.com/content/manuals/en/FGS-2x3/FGS-2x3-EN-T-v1.0.pdf
According to page 12, you can get two types of values for power consumption.
When using Metter CommandClass, I can get Electric energy (in kWh) but I don't find how to get Electric active power value.
Are there other ways to get meter values from the Metter Command class ? Maybe a way to get other Meters from the same device ?
Thanks for your help.