Using Z-Cloud only to configure device

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
Locked
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Using Z-Cloud only to configure device

Post by PoltoS »

Sometimes people use Z-Cloud only to configure devices. After turning off Z-Cloud and disconnecting Z-Wave USB dongle they expect all the devices to work as configured. But there is one important detail: Z-Way (core of Z-Cloud) by default configures all devices to be associated with himself. This will lead to delays and transmission problems once Z-Wave dongle is not powered.To solve the proble one need to remove all associations with Z-Cloud from all devices. This can be done manually, but it is much easier to do with a simple script attached below. This script removes all Associations and MultiChannel Associations to Z-Cloud, set Wakeup period to one year for all sleeping devices no minimize battery drain (anyway there is no one to listen for these wakeups).How to apply it?Go to Automation -> Scenes, create new Scene. Turn Expert mode on (the button on the bottom of the screen), right click on white area of the scene (or click on the "menu" icon on the right in white area), choose Add after -> Python script and paste the script below. Then press Save, rightclick on the scene (or press on the "menu" icon in blu area of the scene) and choose Activate Scene. Once done, wake up all battery devices to apply changes (mains powered devices will apply new settings immediatelly). controllerId = 1
for d in ZWaveAPI.devices:
try:
for g in range(1, ZWaveAPI.devices[d].instances[0].Association.data.groups.value + 1):
ZWaveAPI.devices[d].instances[0].Association.Remove(g, controllerId)
except:
pass
try:
for g in range(1, ZWaveAPI.devices[d].instances[0].MultiChannelAssociation.data.groups.value + 1):
ZWaveAPI.devices[d].instances[0].MultiChannelAssociation.Remove(g, controllerId, g)
except:
pass
try:
ZWaveAPI.devices[d].instances[0].Wakeup.Set(60*60*24*365, controllerId)
except:
pass
Locked