Pushnotification of Solarproduce at sunset

Moderator: leecollings

Post Reply
richardvd
Posts: 5
Joined: Saturday 18 February 2017 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Pushnotification of Solarproduce at sunset

Post 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,
mrf68

Re: Pushnotification of Solarproduce at sunset

Post 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
niki_lauda
Posts: 118
Joined: Saturday 31 August 2013 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Eindhoven (NL)
Contact:

Re: Pushnotification of Solarproduce at sunset

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest