I have a problem with a dzVents script.
Version: 2024.7 Build 16355
Platform: Raspi 3B, Raspbian 11 (bullseye) run on a SSD
In about 3% of all script runs, wrong values will sent to my Ulanzi TC001 pixel display. Other values (temperatures, PV power, grid power,...) are correct, only the battery SOC makes a problem:
My PV batterie reports every 5 minutes the SOC to a domoticz sensor:
Code: Select all
url = 'http://10.0.0.142:8080/json.htm?type=command¶m=udevice&idx=35&nvalue=0&svalue={:d}'.format(SOC_result)
This dzVents script gives in about 3% of all runs a incorrect value:
Code: Select all
return {
on = {
devices = {'Batterie_SOC'},
timer = { 'every 1 minutes' }
},
execute = function(domoticz, device)
BAT = domoticz.devices('Batterie_SOC').percentage;
print ("Batt SOC " .. BAT .. '%')
domoticz.openURL({
url = 'http://10.0.0.157/api/custom?name=SOC',
method = 'POST',
callback = 'SOC',
postData = {
text = BAT .. '%',
color = '#EBEAFF',
icon = 6354,
lifetime = 300
}
})
end
}
Domoticz sensor "Batterie_SOC" is now 12%
But it reports 16%:
2025-01-26 07:46:06.297 dzVents: ------ Start internal script: AwtrixSOC:, trigger: "every 1 minutes"
2025-01-26 07:46:06.298 dzVents: Batt SOC 16%
the next run is correct:
2025-01-26 07:48:30.810 dzVents: ------ Start internal script: AwtrixSOC:, trigger: "every 1 minutes"
2025-01-26 07:48:30.811 dzVents: Batt SOC 12%
Maybe you have a idea to this issue?