need help dzevets script solar Toon
Moderator: leecollings
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
need help dzevets script solar Toon
Hi,
I am running the latest Domoticz on a Pi.
Connected to my P1 meter via usb and working great.
Also got the readings from my Rooted Toon thermostat.
I have solar panels from APSystems.
The problem is:
P1 energy production are from the phase where my solar panels are connected, but that phase also uses power so I don't get a clean "solar production" readout.
In my toon I have a clean readout of my Apsystems.
I found out that if I use this: http://toonIp/solar.html in my browser I get:
{"result":"ok","solar": {"current":3589, "total":11401431, "today":24715, "production":4010, "usage_net":246, "usage_own":-175}}
I also made a virtual device : "solar power"
My question to you smart guy's is, can you help me whit a script that runs every minute that gets a readout of these figures from my toon that i can use for my solarpower device?
Thanks
Eric
I am running the latest Domoticz on a Pi.
Connected to my P1 meter via usb and working great.
Also got the readings from my Rooted Toon thermostat.
I have solar panels from APSystems.
The problem is:
P1 energy production are from the phase where my solar panels are connected, but that phase also uses power so I don't get a clean "solar production" readout.
In my toon I have a clean readout of my Apsystems.
I found out that if I use this: http://toonIp/solar.html in my browser I get:
{"result":"ok","solar": {"current":3589, "total":11401431, "today":24715, "production":4010, "usage_net":246, "usage_own":-175}}
I also made a virtual device : "solar power"
My question to you smart guy's is, can you help me whit a script that runs every minute that gets a readout of these figures from my toon that i can use for my solarpower device?
Thanks
Eric
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
According this topic the rooted Toon python plugin should show the P1 meter data including solar: viewtopic.php?p=311034
use this plugin: https://github.com/MadPatrick/domoticz_toon
use this plugin: https://github.com/MadPatrick/domoticz_toon
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
Hi Walterv,
I have the thermostat data from Toon in Domoticz working.
I have the P1 data in Domoticz working.
But I need the data from my solarpower which Toon gets via an app from oepi loepi toe Domoticz.
At the moment I am trying to get a dzevents HTTP request working but getting stuck on to manny errors.
I have the thermostat data from Toon in Domoticz working.
I have the P1 data in Domoticz working.
But I need the data from my solarpower which Toon gets via an app from oepi loepi toe Domoticz.
At the moment I am trying to get a dzevents HTTP request working but getting stuck on to manny errors.
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
Can you give an explanation what from this json you want to use for your virtual solar panel device in Domoticz?
current is current production in W?
total is total production Wh?
production, usage_net, usage_own is what? Do these values need to be used?
Code: Select all
{"result":"ok","solar": {"current":3589, "total":11401431, "today":24715, "production":4010, "usage_net":246, "usage_own":-175}}
total is total production Wh?
production, usage_net, usage_own is what? Do these values need to be used?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
The most important is "current"
and today would be nice.
and today would be nice.
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
this is what i am working whit but no result:
Edit waltervl: added code brackets for better readability
Code: Select all
return {
on = {
timer = { 'every 1 minutes' },
httpResponses = { 'solar' }
},
execute = function(domoticz, item)
if (item.isTimer) then
domoticz.openURL({
url = 'http://192.168.1.56/solar.html',
method = 'GET',
callback = 'solar'
})
elseif (item.isHTTPResponse) then
if (item.ok) then -- statusCode == 2xx
local current = item.json.consumption
domoticz.devices('production').energy(current)
end
end
end
}
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
and it is all in W
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
But what is it? You have to map it to values in the Domoticz device.
And all in W is strange....
Can you post a screenshot of your Toon user interface where it shows the Solar data?
And all in W is strange....
Can you post a screenshot of your Toon user interface where it shows the Solar data?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
So what are the json values from? Seems to be the one with 811W
Those values cannot be put as is in a Domoticz device. That is a function of the Energy dashboard.
Also the second screenshot seems strange for me.
Solar now 2315 W
Total 15.0 Kwh (so not all values are W
)
But what is:
Delivered 4514 W
Usage 323 W
I cannot map these values to solar panels. What do they mean?
Those values cannot be put as is in a Domoticz device. That is a function of the Energy dashboard.
Also the second screenshot seems strange for me.
Solar now 2315 W
Total 15.0 Kwh (so not all values are W

But what is:
Delivered 4514 W
Usage 323 W
I cannot map these values to solar panels. What do they mean?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
"Stroom nu" is the same as "zon nu" and is the "current" value in the json.
They are different because there are clouds passing by.
this is the actual solar production of my panels in W.
the other values are not important.
I just want this number refreshed in a virtual counter if possible.
They are different because there are clouds passing by.
this is the actual solar production of my panels in W.
the other values are not important.
I just want this number refreshed in a virtual counter if possible.
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
Then change line
Into
Also name the device correctly. You write you created a device called "solar power" but in your script you send data to device called 'production'......
Report back the errors and the complete script if it does not work.
It could be that line
Should be
Code: Select all
local current = item.json.consumption
Into
Code: Select all
local current = item.json.solar.current
domoticz.log(' current = ' .. current, domoticz.LOG_INFO )
Report back the errors and the complete script if it does not work.
It could be that line
Code: Select all
local current = item.json.solar.current
Code: Select all
local current = item.json.solar[0].current
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
thanks for the info,
I will try this tomorrow.
I tried different devices and names to get a reaction but i will change them to one name.
I will try this tomorrow.
I tried different devices and names to get a reaction but i will change them to one name.
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
One step further and without error but unfortunately without data.
I now have this script called "SolarPanels"
return {
on = {
timer = { 'every 1 minutes' },
httpResponses = { 'solar' }
},
execute = function(domoticz, item)
if (item.isTimer) then
domoticz.openURL({
url = 'http://192.168.1.56/solar.html',
method = 'GET',
callback = 'solar'
})
elseif (item.isHTTPResponse) then
if (item.ok) then -- statusCode == 2xx
local current = item.json.solar.current
domoticz.log(' current = ' .. current, domoticz.LOG_INFO )
end
end
end
}
It runs without errors but I also think without data.
And what kind of device do I have to make to receive the data?
I now have this.
I now have this script called "SolarPanels"
return {
on = {
timer = { 'every 1 minutes' },
httpResponses = { 'solar' }
},
execute = function(domoticz, item)
if (item.isTimer) then
domoticz.openURL({
url = 'http://192.168.1.56/solar.html',
method = 'GET',
callback = 'solar'
})
elseif (item.isHTTPResponse) then
if (item.ok) then -- statusCode == 2xx
local current = item.json.solar.current
domoticz.log(' current = ' .. current, domoticz.LOG_INFO )
end
end
end
}
It runs without errors but I also think without data.
And what kind of device do I have to make to receive the data?
I now have this.
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
Progress, I got a value "current = 676" which was the output of my panels at that moment.
Now I have to get that in a device/counter.
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
What do you expect to see? Because you now selected a counter that needs the total kWh data field and not the usage data in Watt.
You can also create an Electric (instant and Counter) device. That needs 2 values. The current in W and the total counter in Wh. (But what is the correct values from the JSON, value total?)
You can also create a Electric Usage device that only needs the Watt values. No historical report on this device.
Be aware every type of device needs a specific update command. See the dzvents wiki.
You can also create an Electric (instant and Counter) device. That needs 2 values. The current in W and the total counter in Wh. (But what is the correct values from the JSON, value total?)
You can also create a Electric Usage device that only needs the Watt values. No historical report on this device.
Be aware every type of device needs a specific update command. See the dzvents wiki.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
If I have only a Electric usage device which shows me the actual Watt that would be fine.
But I do not know how toe send the value of "current" to that device.
But I do not know how toe send the value of "current" to that device.
- waltervl
- Posts: 5768
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: need help dzevets script solar Toon
It is time you start better reading the dzvents wiki, it is all there: https://wiki.domoticz.com/DzVents:_next ... _scripting
Use
Use
Code: Select all
domoticz.devices('your_device_name').updateEnergy(current)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 16
- Joined: Tuesday 29 October 2024 12:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: need help dzevets script solar Toon
I am reading in the wiki but as a non programmer it is a lot "Chinese" for me.
It is easy to make a mistake by typing one digit wrong.
You are steering me in the right direction and together with the wiki and internet I think I will figure it out.
It is easy to make a mistake by typing one digit wrong.
You are steering me in the right direction and together with the wiki and internet I think I will figure it out.
Who is online
Users browsing this forum: No registered users and 1 guest