The downloaded information from PVOutput for power&energy becomes visible at 'Overige' as 'meters & graphs' for Generation and for Consumption, and in Blocky as sensors.
In the background of Domoticz you can also find the related data under Setup/Events as svalues.
To apply this information in scripts, you have to extract the svalues and to convert them to numbers.
Some effort required in each script and is not complete, because day-energy is missing in the svalues.
To reduce the extraction&conversion to a once-only effort, in the attached script the svalues are periodically translated to global user variables for Actual Power, Lifetime Energy and Day-Energy. These user variables are then generally available for all scripts, by just making a call in the script for the global variables: see the explanation in the introduction of the script.
If you want from a PVOutput-SID both the data for Generation and for Consumption, you have to duplicate the script and you have to tune accordingly.
Note1: If PVOutput reports no actual power data (e.g. for PV-info during the night), the power read-back in the script fails and the script stops.

Note2: For tuning in this script you have to replace all XX by appropriate label.
Prone to error: perhaps somebody with a solution for 'general/simpler' setting of this aspect?
Code: Select all
-- PVOutput-UserVariables script, version_0.1
-- (C)2015 Toulon7559 for making user variables from PVoutput-svalues
-- Domoticz from the PVOutput-downloads makes displayvalues for power, for lifetime energy and for dayvalue energy.
-- Although de dashboard shows the dayvalue for energy, in the svalues this value is missing: only svalues for actual power and for lifetime energy.
-- This script derives the dayvalue for energy from PVOutput's lifetime energy and stores it as a user variable.
-- It requires that you first make 2 uservariables, for the actual dayvalue PVO_DayEnergyXX respectively for a reference value PVO_RefEnergyXX, with XX as identifier for the selected PVOutput-download
-- In addtion by definition of uservariables PVO_PowerXX and PVO_LifeEnergyXX you get the PVOutput download completely as uservariables. Line 11 is the start for tuning your application of this script, by setting XX and the 'name' of the svalues.
-- These uservariables then are generally available for all Domoticz-oriented scripts: just include in your other script(s) the lines 27~30 or 29+30 from this script.
-- Line10= Set references
PVO_DownloadXX = '<svalue-name>'
Interval = 1
-- Line14= Get Current date & time from os as date.year, date.month, date.day, date.hour, date.min, date.sec
date = os.date("*t")
year = date.year
month = date.month
day = date.day
hour = date.hour
minutes = date.min
seconds = date.sec
-- Line23= Check Current time in minutes against Interval to start the script
if (minutes % Interval == 0) then
PVO_PowerXX = tonumber(uservariables['PVO_PowerXX'])
PVO_LifeEnergyXX = tonumber(uservariables['PVO_LifeEnergyXX'])
PVO_DayEnergyXX = tonumber(uservariables['PVO_DayEnergyXX'])
PVO_RefEnergyXX = tonumber(uservariables['PVO_RefEnergyXX'])
sPVOPowerXX, sPVOEnergyXX = otherdevices_svalues[PVO_DownloadXX]:match("([^;]+);([^;]+)")
sPVOPowerXX = tonumber(sPVOPowerXX);
sPVOEnergyXX = tonumber(sPVOEnergyXX);
end
if ((hour+minutes) == 0) or (PVO_RefEnergyXX == 0) then
PVO_LifeEnergyXX = sPVOEnergyXX
PVO_RefEnergyXX = sPVOEnergyXX
PVO_DayEnergyXX = 0
PVO_PowerXX = 0
end
if sPVOPowerXX ~= 0 then PVO_PowerXX = sPVOPowerXX else PVO_PowerXX = 0
end
PVO_LifeEnergyXX = sPVOEnergyXX
PVO_DayEnergyXX = PVO_LifeEnergyXX - PVO_RefEnergyXX
print ('PVO_PowerXX = '.. PVO_PowerXX)
print ('PVO_Energy_LifetimeXX = '.. PVO_LifeEnergyXX)
print ('PVO_Energy_DayStartXX = '.. PVO_RefEnergyXX)
print ('PVO_Energy_DayCumXX = '.. PVO_DayEnergyXX)
commandArray = {}
-- Line50= Save the global values
commandArray['Variable:PVO_PowerXX'] = tostring(PVO_PowerXX)
commandArray['Variable:PVO_LifeEnergyXX'] = tostring(PVO_LifeEnergyXX)
commandArray['Variable:PVO_RefEnergyXX'] = tostring(PVO_RefEnergyXX)
commandArray['Variable:PVO_DayEnergyXX'] = tostring(PVO_DayEnergyXX)
return commandArray