The goal is to trigger a switch which is active in the cheap hours and show a table white cheap hours and expensive hours.
It looks like this:

The script is running every 1 min because it also need to set a switch is the cheap hours.
The script only refresh correct after a Domoticz restart without a restart it looks like DZvent is using cached values.
So without a restart of Domoticz my table stay the same for days.
I did make a test script to check which values are in memory.
I use copy Enever_Electricity_33 and Enever_Electricity_tomorrow_33 use user variable to stroom_prijs_morgen and stroom_prijs_vandaag.
Script:
Code: Select all
return {
on = {
timer = {
'at 00:02',
'at 17:50'
}
},
execute = function(domoticz)
local vandaag = domoticz.variables('Enever_Electricity_33').value
local morgen = domoticz.variables('Enever_Electricity_tomorrow_33').value
-- domoticz.variables('Stroom_prijs_vandaag').set(0)
-- domoticz.variables('Stroom_prijs_morgen').set(0)
domoticz.variables('Stroom_prijs_vandaag').set(vandaag).afterSec(30)
domoticz.variables('Stroom_prijs_morgen').set(morgen).afterSec(30)
end
}

It didn't copy the value from Enever_Electricity_33 to stroom_prijs_vandaag the string are different
So DZvent is using stored in memory string instead of the new string
How can I solve this DZvent need to read the new value every time so my tables stay correct
