ZeverSolar input

Moderator: leecollings

Post Reply
dennisb1
Posts: 2
Joined: Tuesday 15 August 2017 15:10
Target OS: -
Domoticz version:
Contact:

ZeverSolar input

Post by dennisb1 »

I'm looking for a easy way to import my ZeverSolar S3000 into domoticz.
I now have this working with pvoutput but i want to remove the man in the middle since its far from perfect.

I have found a perl script that will load all information in a sqlite database but i haven't found a way to import this into domoticz.
https://github.com/smeyn/ZeverSolar

There is also a local web interface that this perl script use to load the information from. Is there a way to import this into domoticz or retrive the information directly into domoticz? There is a cgi page that gives the following;
omvormer.png
omvormer.png (16.93 KiB) Viewed 3114 times
I'm sure there must be a easy way to import this?

The main status page gives the following and is used by the script that smeyn has on github;
omvormer1.png
omvormer1.png (23.27 KiB) Viewed 3114 times
JanAtHome
Posts: 38
Joined: Wednesday 10 January 2018 16:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 38153
Location: Raalte Holland
Contact:

Re: ZeverSolar input

Post by JanAtHome »

Let me no , i have the same inverter a 6000 type , but no connection to domotic.
pfwolbers
Posts: 11
Joined: Monday 05 January 2015 19:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the netherlands
Contact:

Re: ZeverSolar input

Post by pfwolbers »

Hello,

I've made some code to read the inverter.
You need to have:
- Script on device trigger
- Smart P1 meter called "Electra" (you can rename)
- IP adres of inverter (mine: 192.168.0.3)
- Uservariable: E_Today, E_Total, E_Total_Yesterday (Type: Integer)
- DummyDevice: Electra (Actueel + Teller) Type -> Levering (ID is needed for 'UpdateDevice')

Code: Select all

commandArray = {}

if (devicechanged["Electra"]) then --Smart meter every 10s update when daytime (shuts down automatically when no sun)
    --Only try to read data from inverter when daytime
    if timeofday['Daytime'] then
        --print("start !")  
        local f = assert(io.popen("curl -s http://192.168.0.3/home.cgi" , 'r')) --Read data from webpage zeversolar
        --print("f " .. f)  
        if (f ~= nil and f ~= '') then
           --print("start read !")  
           local s = assert(f:read('*a'))
           --print("Solar".. s)
           
           if (s ~= nil and s ~= '') then --Check for valid value of response of read command
               --print("s " .. s) 
               
               lines = {}
               for t in s:gmatch("[^\n]+") do
                  table.insert(lines, t) 
               end
               --local ID = lines[3]
               --local Key = lines[4]
               --local HW = lines[5]
               --local SW = lines[6]
               --local TimeDate = lines[7]
               --local Key = lines[10]
               local PacW = lines[11]
               local E_Today = lines[12]
               local Status = lines[13]
               --print("PacW " .. PacW)  
               --print("E_Today " .. E_Today)  
               --print("Status " .. Status) 
            
               if Status == "OK" then
                  --print("Status == OK ") 
                    commandArray['Variable:E_Today'] = tostring(E_Today*1000);
                    commandArray['Variable:E_Total'] = tostring(E_Today*1000 + uservariables['E_Total_Yesterday']);
                    commandArray[1] = {['UpdateDevice'] = 302 .. "|0|" .. PacW .. ";" .. uservariables['E_Total']}
               end   
            end
        end

        f:close()

    else
        --Write current total to total yesterday for correct calculation tomorrow
        commandArray['Variable:E_Total_Yesterday'] = tostring(uservariables['E_Total']);
    
        local PacW_Zero = 0
        commandArray[1] = {['UpdateDevice'] = 302 .. "|0|" .. PacW_Zero .. ";" .. uservariables['E_Total']}  
    end
    
end
return commandArray

Good Luck!
User avatar
phoenixblue
Posts: 76
Joined: Friday 25 November 2016 11:20
Target OS: Windows
Domoticz version:
Contact:

Re: ZeverSolar input

Post by phoenixblue »

Hi,
I see that the status is used the write the value to Domoticz when it's ok.
Is it also possible to write the value to an device when it's not ok?
pfwolbers
Posts: 11
Joined: Monday 05 January 2015 19:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the netherlands
Contact:

Re: ZeverSolar input

Post by pfwolbers »

Sure, add an "else". But why?
User avatar
phoenixblue
Posts: 76
Joined: Friday 25 November 2016 11:20
Target OS: Windows
Domoticz version:
Contact:

Re: ZeverSolar input

Post by phoenixblue »

Have some problems with the inverter. And I have the idea that it's not always send the error code to the cloud.
So I want to monitor the error code direct to Domoticz.

Update:
I have insert an extra uservariable "E_Status" that fills the current status of the inverter.

Code: Select all

commandArray['Variable:E_Status'] = tostring(Status);
And write those info into an text dummy sensor:

Code: Select all

commandArray = {}
local localvar1 = 172
    commandArray['UpdateDevice'] = localvar1 .. '|0|' .. tostring(uservariables["E_Status"])
bjoan
Posts: 1
Joined: Saturday 22 February 2020 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ZeverSolar input

Post by bjoan »

Hello,
I am new to Domoticz - I've installed it to grab data from my Zeversolar unit - that's why I'm in this post.
I'm trying to accomplish this "
You need to have:
- Script on device trigger
- Smart P1 meter called "Electra" (you can rename)
- IP adres of inverter (mine: 192.168.0.3)
- Uservariable: E_Today, E_Total, E_Total_Yesterday (Type: Integer)
- DummyDevice: Electra (Actueel + Teller) Type -> Levering (ID is needed for 'UpdateDevice')"
and I'm a bit confused.

1. I know my Zversolar IP. - changed it in script - checked the "curl .." script on Pi console - data from Zeversolar is correct
2. Added script on device trigger to Events in Domoticz
3. Added dummy device Electra type Electric Instant+Counter (Idx=8) (changed the Idx from 302 to 8 at two places in script)
4. Added uservariables (starting value is 0)
But I don't know what to do with the " Smart P1 meter called "Electra" (you can rename)" ? Add a hardware Smart P1 meter ( USB or LAN) or add second dummy device ?

Could you please explain what I am doing wrong ?
Thank you in advance
pfwolbers
Posts: 11
Joined: Monday 05 January 2015 19:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the netherlands
Contact:

Re: ZeverSolar input

Post by pfwolbers »

The script reads the data every time the smart meter data is received. That's why it is needed. You can of course change the trigger of the script to something else
JanAtHome
Posts: 38
Joined: Wednesday 10 January 2018 16:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 38153
Location: Raalte Holland
Contact:

Re: ZeverSolar input

Post by JanAtHome »

Hello everyone
The script above works perfectly, I'm very happy with it.
Thanks to, pfwolbers.
The following adjustments were necessary for me.
The created user variables were type integer. I don't think that's right and the format should be String. (set to string)
When creating the script, you need to take Lua>Device.
First I had Lua>All but then you get an error message every minus in the log.

So much for my update.
Greetings Jan
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest