Re: Easy Scripting App - Documentation/Example
Posted: 04 May 2020 21:43
After some testing, I have feedback.
Think this script needs a caviet.
Run a check on values before sending a response to z-way.
I did a test with my devices and with ridewithstyle's example.
ignore the names of devices, its just a test.
It works, If my house power consumption exceeds 600 Watts, then a light turns on.
it then turns off when below 600W.
oops. Then it also turns the light off every 20 seconds, even though the light is already off.
and it does this every 20 seconds - forever.
My test script.
var thermostat_sensor_device = vdev("ZWayVDev_zway_124-1-50-2")
var thermostat_target_temperature_device = vdev("ZWayVDev_zway_36-0-38")
var dad_target_dummydevice = vdev("DummyDevice_46")
//Get Sensor Value
var sensorValue = thermostat_sensor_device.value()
var targetValue = thermostat_target_temperature_device.value()
var targetDadValue = dad_target_dummydevice.value()
//Reduce Target Temperature according to Dad Mode
if (sensorValue > 600) {
thermostat_target_temperature_device.set(targetValue + 1)
}
else {
thermostat_target_temperature_device.set(targetValue = 0)
}
Think this script needs a caviet.
Run a check on values before sending a response to z-way.
I did a test with my devices and with ridewithstyle's example.
ignore the names of devices, its just a test.
It works, If my house power consumption exceeds 600 Watts, then a light turns on.
it then turns off when below 600W.
oops. Then it also turns the light off every 20 seconds, even though the light is already off.
and it does this every 20 seconds - forever.
My test script.
var thermostat_sensor_device = vdev("ZWayVDev_zway_124-1-50-2")
var thermostat_target_temperature_device = vdev("ZWayVDev_zway_36-0-38")
var dad_target_dummydevice = vdev("DummyDevice_46")
//Get Sensor Value
var sensorValue = thermostat_sensor_device.value()
var targetValue = thermostat_target_temperature_device.value()
var targetDadValue = dad_target_dummydevice.value()
//Reduce Target Temperature according to Dad Mode
if (sensorValue > 600) {
thermostat_target_temperature_device.set(targetValue + 1)
}
else {
thermostat_target_temperature_device.set(targetValue = 0)
}