I have a number of Z-Wave devices which report battery status, but they only do so when it changes and tend to miss when a new battery is installed.
Here are two scripts which will add a "Reset" button to the battery device, which then calls a script to set the value to 100(%).
Put this script in yous scripts folder, named battery_reset.vb, to be called by the button:
For each battery device, use this command in Script Commands (HS4) or Control Panel (HS3), replacing REF with the device reference:
[CODE]
hs.DeviceScriptButton_AddButton(REF, "Reset", 1.0, "battery_reset.vb", Nothing, Nothing, 1, 1, 1)
[CODE]
Here are two scripts which will add a "Reset" button to the battery device, which then calls a script to set the value to 100(%).
Put this script in yous scripts folder, named battery_reset.vb, to be called by the button:
Code:
Sub Main(parms as object) Dim ref as Integer = CInt(parms(0)) hs.WriteLog("Script", "Battery reset button device " & ref) hs.SetDeviceValueByRef(ref, 100, true) End Sub
[CODE]
hs.DeviceScriptButton_AddButton(REF, "Reset", 1.0, "battery_reset.vb", Nothing, Nothing, 1, 1, 1)
[CODE]
Comment