Page 1 of 1

Pushnotification of Solarproduce at sunset

Posted: Friday 19 May 2017 20:59
by richardvd
Hello,

I want to make a script that sends me a push notification at the end of the day when the sun is down.
The script must send me information about the solar produce of my solar system.
In my dashboard i can see the produce of the day, unfortunately i don's see that information by "show current states". Can anybody help me to get the day produce from the Domoticz database so i can use it in LUA?

Greets Richard,

Re: Pushnotification of Solarproduce at sunset

Posted: Saturday 27 May 2017 8:26
by mrf68
Hi Richard,

Your question got me interested in wanting the same functionality. Otherdevices_svalues show the current production and the overall production but, as you mentioned, not the daily production. Maybe you could store the value of the overall production as a variable. Then the next day you do the same in a different variable and then calculate: var2 - var1. Then copy var2 to var1 and so on. I havent looked into the way how to scrap the right value off the otherdevices_svalues.

I am using node-red and found it easier to create a flow there which gets some info from the SolarEdge website, isolates the total day production and sends this information to my phone.

Regards,
Martin

Re: Pushnotification of Solarproduce at sunset

Posted: Thursday 01 June 2017 22:20
by niki_lauda
I use this. and works for me

Code: Select all

commandArray = {}
 CurrentWattSolar,sTotalKWhSolar = otherdevices_svalues['Kostal']:match("([^;]+);([^;]+)")
 CurrentWattSolar=tonumber(CurrentWattSolar)
if (os.date("%H:%M") == '22:10' )then
    CurrentWattSolar,sTotalKWhSolar = otherdevices_svalues['Kostal']:match("([^;]+);([^;]+)")
    commandArray['Variable:TodayKWhSolar'] = tostring(sTotalKWhSolar/1000)
    commandArray['Variable:YesterdayKWhSolar'] = tostring((sTotalKWhSolar/1000) + (uservariables["YesterdayKWhSolar"]))
    commandArray['SendNotification']=(string.format("1Opbrengst zonnepanelen#De opbrengst van vandaag is %s KWh", tostring(sTotalKWhSolar/1000)))
end