
Just thinking ...
Could it be that the problem is not in the
call 'otherdevices', but in the
definition of the devices?
In the 'problematic' lua-script, the original definition of the devices is (based on working examples)
Code: Select all
-- Line 05, Assignment of Domoticz' sensors & devices
Outside_Temp_Hum0 = 'TFA1_Temp_RV_Hoog' -- Main sensorset T&H, read by RFXCom
Outside_Temp_Hum1 = 'TFA4_Temp_RV_West' -- Reference & Backup sensorset T&H, read by RFXCom
Barometer = 'BMP180_Temp_Baro' -- local BMP180, through I2C at Raspberry
RainMeter = 'TFA_Nexus_Neerslag' -- Main sensorset, read by RFXCom
WindMeter = 'TFA_Nexus_Wind' -- Main sensorset, read by RFXCom
UVMeter0 = 'UVN800' -- UVI-sensor, Virtual Device copied from Domoticz2
UVMeter1 = 'SolarRadiation_UV' -- Custom Sensor/ Virtual Device, for derived result of calculation for Lux-value
UVMeter2 = 'UVI_ML8511' -- UVI-sensor, Virtual Device copied from Domoticz2
LuxMeter = 'Lux_Calc' -- Custom Sensor / Virtual Device, calculated Lux-value (placeholder/fallback by the script from jmleglise)
-- Sunshine = ' ' -- To be defined
Soiltemp = 'TFA2_Temp_RV_Laag' -- Secondary sensorset T&H, Grass-height, read by RFXCom
Comparison helps.
Changed that section of the script to
Code: Select all
-- Line 05, Assignment of Domoticz' sensors & devices
local Outside_Temp_Hum0 = 'TFA1_Temp_RV_Hoog' -- Main sensorset T&H, read by RFXCom
local Outside_Temp_Hum1 = 'TFA4_Temp_RV_West' -- Reference & Backup sensorset T&H, read by RFXCom
local Barometer = 'BMP180_Temp_Baro' -- local BMP180, through I2C at Raspberry
local RainMeter = 'TFA_Nexus_Neerslag' -- Main sensorset, read by RFXCom
local WindMeter = 'TFA_Nexus_Wind' -- Main sensorset, read by RFXCom
local UVMeter0 = 'UVN800' -- UVI-sensor, Virtual Device copied from Domoticz2
local UVMeter1 = 'SolarRadiation_UV' -- Custom Sensor/ Virtual Device, for derived result of calculation for Lux-value
local UVMeter2 = 'UVI_ML8511' -- UVI-sensor, Virtual Device copied from Domoticz2
local LuxMeter = 'Lux_Calc' -- Custom Sensor / Virtual Device, calculated Lux-value (placeholder/fallback by the script from jmleglise)
-- local Sunshine = ' ' -- To be defined
local Soiltemp = 'TFA2_Temp_RV_Laag' -- Secondary sensorset T&H, Grass-height, read by RFXCom
Result: no more complaints related to 'otherdevices' and it's variations!
However, the debugger at Putty's CLI now complains about the next section of the script
Code: Select all
-- Line 94, Output of Temp&RelHum
if ((Outside_Temp_Hum0 ~= '') or (Outside_Temp_Hum1 ~= '')) then
AWEKAS_URL = AWEKAS_URL .. ";" .. string.format("%3.1f", (sTemp_out))
AWEKAS_URL = AWEKAS_URL .. ";" .. string.format("%.0f", (sRV_out))
else
AWEKAS_URL = AWEKAS_URL .. ";;"
end
with error-report
Code: Select all
lua: ...ua/script_time_AWEKAS_DirectLink_upload01j2_RPIB.lua:96: bad argument #2 to 'format' (number expected, got nil)
stack traceback:
[C]: in function 'format'
...ua/script_time_AWEKAS_DirectLink_upload01j2_RPIB.lua:96: in main chunk
[C]: ?
Same strange thing:
the construction of the scriptlines is 100% according to working examples, but apparently not working in this script when checked from Putty's CLI.
When looking in Domoticz' Log, I see different error reports for different scriptlines.
More and more getting the feeling of missing some aspect of lua-scripting/-debugging, but cannot put my finger on it ......