Im trying to get data from my wMbus to do some calculations.
In order to do this i'm pushing data using MQTT to a Costum device which i then want to use in a dzvents script.
Unfortunately i cant use any data not even with a simple print script.
I tried different sollutions including the stuff provided in the wiki but i cant get it to work.
Can somebody help me on my wayy?
Script to run:
Code: Select all
return {
on = {
timer = {
'every minute', -- causes the script to be called every minute
},
},
execute = function(domoticz, timer)
local TempInSensor = 'Stadsverwarming Aanvoer'
local TempOutSensor = domoticz.devices(248)
local Temp_IN = tonumber(TempInSensor.state)
local Temp_Retour = tonumber(TempOutSensor.state)
print('Temp In' .. TEMP_IN .. '°C' )
--local Delta_T = Temp_In - Temp_Retour
--print('Delta T van Stadsverwarming =' .. Delta_T ..'°C' )
--local Water_M = 1000 * ((domoticz.devices(246).nValue) / 3600)
--print('Watermassa van Stadsverwarming =' .. Water_M .. 'kg')
--local Actueel_Vermogen = Water_M * 4180 * Delta_T
-- print('Actueel vermogen van Stadsverwarming =' .. Actueel_Vermogen .. 'kW')
end
}
Code: Select all
2021-01-20 10:23:00.141 Error: dzVents: Error: (3.0.2) /config/scripts/dzVents/generated_scripts/Script #3.lua:13: attempt to concatenate a nil value (global 'TEMP_IN')