Code: Select all
--Manually create and/or define below (newly created virtual) devices and 'User Variables' by user given names
local electricity_meter = 'Immissioni' -- Existing P1 Electricity device name in 'Utility'
--To be created virtual devices in the hardware section of Domoticz:
local solar_battery = 'Virtual Solar Battery' -- (1) Custom Sensor name for the 'Virtual Solar Battery'
local solar_battery_idx = 73
local battery_use = 'Solar Battery Usage' -- (2) RFXMeter counter name for the 'Solar Battery Usage'
local battery_use_idx = 74
local lost_energy = 'Lost Solar Energy' -- (3) RFXMeter counter name for the 'Lost Solar Energy'
local lost_energy_idx = 75
--User Variables:
local battery_capacitylevel = 'SolarBatteryCapacity' -- User Variable name for the 'Solar Battery Capacity'. Type 'String'. Value in Wh (4kWh battery = '4000')
local total_electricity = 'TotalElectricity'
but i receive this error:
2018-11-29 15:01:30.038 Error: EventSystem: in virtual battery: [string "--Script_time_solar_battery.lua..."]:65: attempt to perform arithmetic on global 'sPlusT1' (a nil value)