Lua script for uploading energy values to PVoutput
Moderator: leecollings
- Domoberry
- Posts: 122
- Joined: Tuesday 30 May 2017 19:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.7
- Contact:
Re: Lua script for uploading energy values to PVoutput
If the problem still persists, could you add the offending line 58?
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
Hi,
I have a integrated P1 logger so i changed the script accordingly.
below the script the way i use it:
I have a integrated P1 logger so i changed the script accordingly.
below the script the way i use it:
- Spoiler: show
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
Activated it tonight, no changes made and i have no errors anymore??
Trying the upload now.
Wel upload goes wrong..
Seems like it uses Energy Import Low as value for the power. 
Trying the upload now.
Wel upload goes wrong..
Code: Select all
2017-07-19 22:15:01.271 LUA: Time to go before upload to PVoutput: 5 minutes
2017-07-19 22:15:01.271 LUA: ---- The total generated energy is 1824806 Wh
2017-07-19 22:15:01.271 LUA: ---- The current generated power is 3067693 W
2017-07-19 22:15:01.271 LUA: ---- The voltage of the inverter is 228.600 V
2017-07-19 22:15:01.271 LUA: ---- The outside temperature is 23.4 C.
2017-07-19 22:15:01.271 LUA: ---- The total consumed energy is 6143917 Wh
2017-07-19 22:15:01.271 LUA: ---- The current consumed power is 442 W
2017-07-19 22:15:02.423 LUA: -- Bad request 400: Power value [3067693] too high for system size [2280]
2017-07-19 22:15:02.424 LUA: -- Energy generation (v1) = 1824806 Wh
2017-07-19 22:15:02.424 LUA: -- Power generation (v2) = 3067693 W
2017-07-19 22:15:02.424 LUA: -- Energy consumption (v3) = 6143917 Wh
2017-07-19 22:15:02.424 LUA: -- Power consumption (v4) = 442 W
2017-07-19 22:15:02.424 LUA: -- Current temperature (v5) = 23.4 C
2017-07-19 22:15:02.424 LUA: -- Voltage (v6) = 228.600V
2017-07-19 22:15:02.424 LUA: -- Cumulative Flag (c1) = 1
2017-07-19 22:15:02.437 EventSystem: Fetching url...
2017-07-19 22:15:02.470 LUA: ----- PowerGeneration = 0.000 W
2017-07-19 22:15:02.470 LUA: ----- EnergyGeneration = 2838435.000 Wh
2017-07-19 22:15:02.470 LUA: ----- PowerImport = 442 W
2017-07-19 22:15:02.470 LUA: ----- EnergyImportLow = 3067693 Wh
2017-07-19 22:15:02.470 LUA: ----- EnergyImportHigh = 1824806 Wh
2017-07-19 22:15:02.470 LUA: ----- EnergyImport = 4892499 Wh
2017-07-19 22:15:02.470 LUA: ----- PowerExport = 0 W
2017-07-19 22:15:02.470 LUA: ----- EnergyExportLow = 483873 Wh
2017-07-19 22:15:02.470 LUA: ----- EnergyExportHigh = 1103144 Wh
2017-07-19 22:15:02.470 LUA: ----- EnergyExport = 1587017 Wh
2017-07-19 22:15:02.470 LUA: ----- PowerConsumption = 442 W
2017-07-19 22:15:02.470 LUA: ----- EnergyConsumption = 6143917 Wh

Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
The problem is
This van be 2280W at the max. So I think you put in the wrong value.The current generated power is 3067693 W
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
I put the wrong value??
EnergyImportLow = 3067693 Wh, is used as current generated power is 3067693 W
first one is correct, the last one is not. but where do i change that? i guess i have to change the s value, but that would mean everybody with a P1 meter should do that?
EnergyImportLow = 3067693 Wh, is used as current generated power is 3067693 W
first one is correct, the last one is not. but where do i change that? i guess i have to change the s value, but that would mean everybody with a P1 meter should do that?
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
I have taken a quick look so I might be wrong but it looks like you are using the same device for different things.
The generated power can't be coming from the P1 as the smart meter only knows the exported energy. Between the energy generated by your solar panels and the exported energy that your meter shows is your internal consumption.local GenerationDeviceName = "Elektra" -- Device name of the Generated energy
local EnergyDeviceName = "Elektra" -- Name of the energy device that shows imported and exported energy
Last edited by roblom on Thursday 27 July 2017 14:20, edited 1 time in total.
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
OK, So elektra has to become my solarpanels (SBFSpot)
I wil try that later. I thought i did that already causing another error. wil let you know, thanks for your reply.
I wil try that later. I thought i did that already causing another error. wil let you know, thanks for your reply.
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
GenerationDeviceName has to be your solar panels energy.
EnergyDeviceName has to be your smart meter.
EnergyDeviceName has to be your smart meter.
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
Hi,
the script is like i thougt, i do have the solarpanels for the generation.
Still i have the same error:
The power generation has to be 402. So i guess i have to alter some svalues. can you give me a hint? 
the script is like i thougt, i do have the solarpanels for the generation.
Still i have the same error:
Code: Select all
2017-07-27 17:14:57.290 LUA: ----- PowerGeneration = 402.000 W
2017-07-27 17:14:57.290 LUA: ----- EnergyGeneration = 2905220.000 Wh
2017-07-27 17:14:57.290 LUA: ----- PowerImport = 58 W
2017-07-27 17:14:57.290 LUA: ----- EnergyImportLow = 3098393 Wh
2017-07-27 17:14:57.290 LUA: ----- EnergyImportHigh = 1834983 Wh
2017-07-27 17:14:57.290 LUA: ----- EnergyImport = 4933376 Wh
2017-07-27 17:14:57.290 LUA: ----- PowerExport = 0 W
2017-07-27 17:14:57.290 LUA: ----- EnergyExportLow = 492638 Wh
2017-07-27 17:14:57.290 LUA: ----- EnergyExportHigh = 1136906 Wh
2017-07-27 17:14:57.290 LUA: ----- EnergyExport = 1629544 Wh
2017-07-27 17:14:57.290 LUA: ----- PowerConsumption = 460 W
2017-07-27 17:14:57.290 LUA: ----- EnergyConsumption = 6209052 Wh
2017-07-27 17:15:00.382 LUA: Time to go before upload to PVoutput: 5 minutes
2017-07-27 17:15:00.382 LUA: ---- The total generated energy is 1834983 Wh
2017-07-27 17:15:00.382 LUA: ---- The current generated power is 3098393 W
2017-07-27 17:15:00.382 LUA: ---- The voltage of the inverter is 227.200 V
2017-07-27 17:15:00.382 LUA: ---- The outside temperature is 22.2 C.
2017-07-27 17:15:00.382 LUA: ---- The total consumed energy is 6209052 Wh
2017-07-27 17:15:00.382 LUA: ---- The current consumed power is 460 W
2017-07-27 17:15:00.805 LUA: -- Bad request 400: Power value [3098393] too high for system size [2280]
2017-07-27 17:15:00.806 LUA: -- Energy generation (v1) = 1834983 Wh
2017-07-27 17:15:00.806 LUA: -- Power generation (v2) = 3098393 W
2017-07-27 17:15:00.806 LUA: -- Energy consumption (v3) = 6209052 Wh
2017-07-27 17:15:00.806 LUA: -- Power consumption (v4) = 460 W
2017-07-27 17:15:00.806 LUA: -- Current temperature (v5) = 22.2 C
2017-07-27 17:15:00.806 LUA: -- Voltage (v6) = 227.200V

Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
It sounds very unlogic that you need to edit the svalues. Are the devices in domoticz displaying the correct values?
Did you correct the GenerationDeviceName in both scripts?
Did you correct the GenerationDeviceName in both scripts?
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput



Excuses did not change the device in the upload script. Changed it correctly now it works accordingly. https://pvoutput.org/intraday.jsp?id=48861&sid=44499&dt
Sorry for being a n00b.



Last edited by R0yk3 on Friday 28 July 2017 13:35, edited 1 time in total.
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
One last thing..
The voltage is now fixed at 232,5 volt? although before the sbfspot upload the voltage varies.
Where do i fix that??

The voltage is now fixed at 232,5 volt? although before the sbfspot upload the voltage varies.
Where do i fix that??
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
In the upload script there is a VoltageDeviceName this needs to point at the name of the device in domoticz that shows the voltage.
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
Yes, obvious.
as you can see in the code parts i uploaded the voltage is given:
LUA: ---- The voltage of the inverter is 227.200 V
LUA: -- Voltage (v6) = 227.200V
And earlier:
LUA: ---- The voltage of the inverter is 228.600 V
LUA: -- Voltage (v6) = 228.600V
I did not change the device name so it should be right?
going to check it at home, i guess i messed something up in the SBF part.
as you can see in the code parts i uploaded the voltage is given:
LUA: ---- The voltage of the inverter is 227.200 V
LUA: -- Voltage (v6) = 227.200V
And earlier:
LUA: ---- The voltage of the inverter is 228.600 V
LUA: -- Voltage (v6) = 228.600V
I did not change the device name so it should be right?
going to check it at home, i guess i messed something up in the SBF part.
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput


I think i am going crazy..
I have got the device voltage up, and now night time the value is 0.
i get an error in the calculating script..
2017-07-28 22:40:00.076 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_upload_to_PVoutput.lua: .../domoticz/scripts/lua/script_time_upload_to_PVoutput.lua:89: attempt to index field '?' (a nil value)



I wil let this run until i have a value again, but i guess this is not the right thing.
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
Normally the voltage that the inverter was running before it turned off will be kept until the inverter is woken up again the next morning. So it will never be set to zero. So your problem will be fixed tomorrow 

-
- Posts: 37
- Joined: Sunday 24 July 2016 21:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
roblom wrote:Normally the voltage that the inverter was running before it turned off will be kept until the inverter is woken up again the next morning. So it will never be set to zero. So your problem will be fixed tomorrow




Verstuurd vanaf mijn SM-G955F met Tapatalk
Raspberry PI 3, raspbian, ZwaveMe, RFLink
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Lua script for uploading energy values to PVoutput
Dear All
Will try to upload my P1 gas meter to Pvo...
For the nice graphs..
Only the Pi show no now value I did try to upload the meter with this script, only that is not working.
Because there is no now in the P1 gas, and all other sensors do have one...
Is there perhaps some that have a option for this upload?
Or a working script to upload to the V7 in Pvo?
Will try to upload my P1 gas meter to Pvo...
For the nice graphs..
Only the Pi show no now value I did try to upload the meter with this script, only that is not working.
Because there is no now in the P1 gas, and all other sensors do have one...
Is there perhaps some that have a option for this upload?
Or a working script to upload to the V7 in Pvo?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Lua script for uploading energy values to PVoutput
Please ....
Fucked up with my settings for the upload of my usb P1 hardware... https://www.slimmemeterkabel.nl/
Is there some one that have a working example scriptfor me ...[ without api and other personal stuff ]
So i do not neet to replace peaces of the code.....
I try different times the wiki...
Replace parts of the code..[ more times ]
Only i do not understand it, and that is where i go wrong...
I am stuck with this P1 part...
And i do like to upload my P1 with domoticz...
Hope there is someone
And perhaps someone have the gas working, to upload it to Pvo?
Fucked up with my settings for the upload of my usb P1 hardware... https://www.slimmemeterkabel.nl/
Is there some one that have a working example scriptfor me ...[ without api and other personal stuff ]
So i do not neet to replace peaces of the code.....
I try different times the wiki...
Replace parts of the code..[ more times ]
Only i do not understand it, and that is where i go wrong...

I am stuck with this P1 part...
And i do like to upload my P1 with domoticz...
Hope there is someone
And perhaps someone have the gas working, to upload it to Pvo?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Lua script for uploading energy values to PVoutput
What part you don't understand because the info provided in the wiki contains all the you need.
Who is online
Users browsing this forum: No registered users and 0 guests