Hi,
first of all i want to say thank you for this awesome piece of software...
I noticed probably a bug in the association of the Device Handler for battery zwave sensor...
I have a FIbaro Motion Sensor , the first time that I try to configure it , the sensor is awake, so HomeGenie is able to detect the type and manufacturer and save his DeviceHandler ( also in files ) and everything seems to work well .
But if i reboot HG , program does not restore the module property "Device Handler" , so i have to manually wake all my sensors and get the product info by HG to fix it...
I've done a dirty solution by changing code by myself in order to restore the property from the module configuration and pass it to the ZWave Node at the start of HG...
I don't know if it can be useful for you, but i post my code here...
I create a new fake command REFRESH_DEVICE_HANDLER and i pass the property of the module.
In function modules_RefreshInterface of class HomeGenieService just before lines:
if (String.IsNullOrEmpty(module.Description))
{
module.Description = migModule.Description;
}
if (module.DeviceType == ModuleTypes.Generic)
{
module.DeviceType = migModule.ModuleType;
}
i added those lines...
if (iface.Domain.CompareTo("HomeAutomation.ZWave") == 0)
{
Console.WriteLine("CERCO IL PARAMETRO ");
var handle=module.Properties.Find(x => x.Name == "ZWaveNode.DeviceHandler");
if(handle!=null)
{
Console.WriteLine("TROVATO PARAMETRO ");
var nodo = interfaceModules.Find(m1 => m1.Address == module.Address && m1.Domain == module.Domain);
if (nodo != null)
{
Console.WriteLine("PRESO IL NODO ");
iface.InterfaceControl(new MIGInterfaceCommand(module.Domain + "/" + nodo.Address + "/" + ZWave.Command.REFRESH_DEVICE_HANDLER + "/" + handle.Value));
}
}
}
and in the ZWave's Interface Control i added
else if( command == Command.REFRESH_DEVICE_HANDLER)
{
var node = controller.GetDevice((byte)int.Parse(nodeId));
node.SetDeviceHandlerFromName(request.GetOption(0));
}
I know it's a kinda dirty, but it was the first solution that comes in my mind... maybe in the next release is possibile a better fix?
Hi,
Pinocchio