So I have been running Domoticz for Z-Wave for 6 months or so.
Generally everything has been going smoothly, then in the last week or so strange things have started to happen...
My setup
* Domoticz running on Synology (v4.9700)
* Aeotec ZW090 Z-Stick Gen5 EU USB Z-Wave Controller
* Stella-Z and POPP TRVs
Configuration
I have a virtual switch to turn on/off heating for each room.
When a set point or room temperature update is received, my dzVents script checks temp vs set point and switches on/off the boiler.
When I switch the virtual room switch on, it calls a JSON URL to update the set point for that TRV (domoticz.devices('Set Point Device').UpdateSetpoint(xx.xx) doesn't seem to do anything at all?).
Domoticz reports the set point has updated an runs the associated set point / temp compare, switching the boiler on/off as required. When the next Z-Wave update comes in from the TRV, the Domoticz set point is reset to the previous value.
If I update the set point manually on the web interface or app, then all works correctly.
This behaviour happens on both the Stella-Z and POPP TRVs, although the POPP TRVs do then seem to immediately realise and send another update, changing to the new set point value.
It's almost as if Domoticz is not sending the set point update into the Z-Wave message queue??
return {
-- 'active' controls if this entire script is considered or not
active = true, -- set to false to disable this script
-- trigger
-- can be a combination:
on = {
devices = {
-- scripts is executed if the device that was updated matches with one of these triggers
'Heating Hall',
'Hall Temp',
'Hall Set Point',
},
},
execute = function(domoticz, item)
-- ### SCRIPT VARIABLES START ###
local RoomName = ''
-- ### SCRIPT VARIABLES END ###
-- ### HALL START [Function v2] ###
RoomName = 'Hall'
-- If we get a Switch for the room, run the RoomSwitch function
if (item.name == 'Heating '..RoomName or item.name == 'Heating '..RoomName..' Boost') then
-- RoomSwitch(domoticz,item,RoomName)
if (domoticz.devices('Heating '..RoomName).state == 'On') then
-- Set the set point to on target
-- this use to work, but now sets it in domoticz but does not update TRV, when TRV next reports temp it resets domotics
domoticz.openURL('http://127.0.0.1:9080/json.htm?type=command¶m=udevice&idx='..domoticz.devices(RoomName..' Set Point').idx..'&nvalue=0&svalue='..domoticz.variables('Heating_Target_On_'..RoomName).value)
else
-- Set the set point to off target
domoticz.openURL('http://127.0.0.1:9080/json.htm?type=command¶m=udevice&idx='..domoticz.devices(RoomName..' Set Point').idx..'&nvalue=0&svalue='..domoticz.variables('Heating_Target_Off_'..RoomName).value)
--domoticz.notify('Heating',RoomName..' heating OFF')
end
end
-- If we get a Temperature or Set Point update then run the RoomTemp function
if (item.name == RoomName..' Temp' or item.name == RoomName..' Set Point') then
if (domoticz.devices(RoomName..' Temp').state < domoticz.devices(RoomName..' Set Point').state) then
-- only call for heat if it was not already called for
if (domoticz.variables('Heating_Call_'..RoomName).value == 0) then
domoticz.variables('Heating_Call_'..RoomName).set(1)
domoticz.variables('Heating_Call_TOTAL').set(domoticz.variables('Heating_Call_TOTAL').value + 1)
domoticz.notify('Heating - Call ON - '..RoomName,'Temp is '..domoticz.devices(RoomName..' Temp').state..', Set Point is '..domoticz.devices(RoomName..' Set Point').state..' (last updated '..domoticz.devices(RoomName..' Temp').lastUpdate.minutesAgo..' mins ago)')
end
-- Otherwise room temp must be warmer than or same as set point
else
-- Only proceed to do anything if we were already calling for heating
if (domoticz.variables('Heating_Call_'..RoomName).value == 1) then
-- remove this heating call from the total, which will trigger the script to run again and check for boiler state
domoticz.variables('Heating_Call_TOTAL').set(domoticz.variables('Heating_Call_TOTAL').value - 1)
domoticz.variables('Heating_Call_'..RoomName).set(0)
domoticz.notify('Heating - Call OFF - '..RoomName,'Temp is '..domoticz.devices(RoomName..' Temp').state..', Set Point is '..domoticz.devices(RoomName..' Set Point').state..' (last updated '..domoticz.devices(RoomName..' Temp').lastUpdate.minutesAgo..' mins ago)')
end
end
end
-- ### HALL END ###
end
}
### ALSO COMING ALONG WITH THE TEMPERATURE UPDATE IS A SET POINT UPDATE - BACK TO THE OLD VALUE ###
2018-11-12 23:32:23.857 Status: dzVents: Info: Handling events for: "Hall Set Point", value: "20.00"
2018-11-12 23:32:23.857 Status: dzVents: Info: ------ Start internal script: HeatingTest: Device: "Hall Set Point (ZWave)", Index: 238
2018-11-12 23:32:23.865 Status: dzVents: Info: ------ Finished HeatingTest
Remember, if I set the setpoint manually, either on the web interface, Set Point timer, Domoticz App or via ImperiHome (via MyDomoAtHome) then it updates correctly and stays!
ChrisKerswell wrote: ↑Tuesday 13 November 2018 0:44
Remember, if I set the setpoint manually, either on the web interface, Set Point timer, Domoticz App or via ImperiHome (via MyDomoAtHome) then it updates correctly and stays!
You might see some additional information on what happens when dzVents execute your script.
Can you also show us what the value of domoticz.devices(TRV device IDX).state is for the TRV devices after the various methods of updating ? And please note that dzVents will only see the new values after the script finished, so you need another script to see the updated values.
If they are the same it might be something in the way the hardware code updates the Zwave TRV devices.