-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample dashboards / grafana #39
Comments
hi @Bonn93, Can you explain me how do you run? (if you want) Thanks |
@iNaiks so I originally tested with a python/terminal and wrapped into a docker image that a built, so I could set a few things to work for me, I had an earlier version where it tried a new modbus library which didn't work well, and had to tweak the requirements. But, sharing is caring! Here's my docker run script ( it was in k8s, but had some issues with influx storage and had to move to plain old docker whilst rebuilt things ). I also use the latest 1.8.X release on InfluxDB, not 2.X as it had a bunch of weird issues. #!/bin/bash docker stop modbus
The dockerfile is more interesting and shows how I run it.
It's not perfect, but does the job. Ideally, I need to raise a PR and would like to use python to read the OS.envs to build the config, and it does need more logging that works differently when run direct via python in your own shell. |
Thanks!
My setup is similar, On a PV panel I plot voltage_dc, power_ac, and temperature to get a general picture of the state of things. I then have individual graphs of module voltages and current grouped by orientation (east facing modules, and west facing modules). In dashboard style I show the latest power_ac, ac voltage, ac frequency, dc voltage, production today, this month, and all time (from On a more general panel which also show temperature readings from around the house, along with central heating stats, I show a large graph of the inverter's power_ac, voltage dc, and the consumption as calculated from the actual import or export power measurement by my kWh meter. This graph shows whether the system is producing anything, when the production and consumption spikes were, and gives a general picture of production and consumption throughout the day. I find this graph alone enough for a quick glance at how things are going. Add a couple dashboard style gauges for current power_ac, voltages and temperature, and you should be fine. Edit: I should add that I calculate daily usage, import and export, by looking at values reported by my kWh meter only. It is possible to do basic difference calculations on values such as
|
@Bonn93 @nmakel Thanks for the info, But my first problem is build the python into a docker... (I know networks things, not programming, sorry) What docker image I need to install or build with python? Thanks |
You don't need to run the script in a docker container. What error are you getting when you run the script currently? |
So the dockerfile i linked above shows how you can build it, mines a little different because I use this repo as a submodule, that way I get all the version control and updates from this repo within my own repo. But, if you read the dockerfile carefully, you'll understand how it works.
These lines I create a directory in the container image, and set my working directory to this one.
These lines I add basically the entire repo to my workdir, but then I also add the requirements.txt file ( which is consumed by pip ) I then add the exact script into the container being example.influx.py to my workdir.
I then run pip ( which is like a package manger for python, included in the docker image you may need to install this locally to play/test ( apt install python3-pip ) for example. Pip then installs all the libraries/packages defined in requirements.txt
Finally, I run the script via bash, it executes python, in a normal shell, this would be something like this:
Ultimately, ignore all the docker stuff, get it working with python locally first. Install python 3.7.9, install pip, run the pip install, run the script at let us know how you go with the basics, in a shell, it'll spit out stuff, or get the example.py working first. |
I didn't even see your panel level stuff, I wonder if my SE10000H is supported, I did play with setapp stuff to get modbus going... Do you think you could share the grafana dashboards/template you have? It would be pretty cool if that could be a grafana template, I think many others would like it, I know a few folks with solaredge inverters all trying for the same type of monitoring. Any chance you could export your dashboard/json via grafana ( it removes and templates the queries ) mostly... |
Ok, but I prefer to run all the things on the nas with docker. And use the raspberry only for watch the graphics in Grafana. Very Thanks |
@iNaiks not trying to be rude here, but everything is in the above, you might need to go and understand the basics on containers and building images before you look at this. |
Yes, I have deleted everything and I have started again from the beginning and now everything works XD. |
The only think is sometimes the scrip stops and I need to open the terminal in docker container, and run again.
I've a docker container in a Synology. I access via web to the UI of docker and I have a terminal (bash) open in a specified directory (/home/solaredge_modbus-master), and then I run the command (python3 example_influxdb.py 10.1.0.254 1502 --influx_host XXXX --influx_port 8086 --influx_db XXXX --influx_user XXXX --influx_pass XXXX --timeout 2)
A few hours later, the command stops (I can't see the error because when I go in the terminal via web on Synology, there isn't any error and is like a terminal console waiting for an input command) There is anything that I can do for run again the scrips when stops or stop the scrip every hour and restart it again automatically? Thanks Nico |
In regards to Bonn93's original thread topic, I've been trying to put together a close approximation of what we see in the online SolarEdge monitoring portal. This is what I've ended up with : To achieve this, I've modified Niels' "example_influxdb.py" utility to populate an additional InfluxDB MEASUREMENT set I’ve called "graph". This allowed me to get around InfluxDB's annoying inability to perform simple maths across multiple measurements (e.g. inverter, meter, battery). I'm performing all the required maths in the Python script as part of writing the metrics that I actually need for Grafana into InfluxDB’s "graph" MEASUREMENT. There's been some cursing throughout the journey, but very happy now with the result. Hat's off to Niels and the solaredge_modbus team for making this possible! @iNaiks – In regards to the Python script dying on a regular basis, from what I can tell it’s the inverter itself that triggers this crash at random times when it fails to return properly formed data (possibly just busy collecting data to send to the online SolarEdge portal at that exact second). The approach I ended up taking was to write a tiny wrapper script to check whether my solaredge_modbus Python script was already running and restart it if it wasn’t. I then added a cron job to run this wrapper script every minute of the day. Bit of a hack, but it’s worked well for me so far. Hope this helps others. |
@TuxFan777 this looks awesome! Is the code added anywhere, how much of this is using the measurement methods in influx? Can you share the grafana json too? |
Thanks @Bonn93 - Appreciate the feedback! Here is my modified version of Niels' "example_influxdb.py" utility which includes the additional "graph" MEASUREMENT that I've used in Grafana. I wasn't sure whether it was appropriate to upload this directly to the project's Code repository without Niels' blessing, so leaving it here for anyone who wants it : example_influxdb_with_graph_measurement_TuxFan777.zip I'll also spend some time cleaning up a json export of the Grafana dashboard for you (minus db credentials, etc.). |
Hi @Bonn93 - Grafana json export attached below as promissed : solaredge_grafana_TuxFan777.zip Let me know how it works out for you. |
@TuxFan777 i try ur modified py and i got this error:
edit: i delete all references to battery1 and battery2 from script becouse i dont have batteries and its running right now without errors. production: SELECT difference(last("energy_total")) FROM "inverter" WHERE $timeFilter GROUP BY time(24h) tz('Europe/Rome') export: SELECT difference(last("export_energy_active")) FROM "meter" WHERE $timeFilter GROUP BY time(24h) tz('Europe/Rome') kwh selfconsuption cost math expression: ($Production - $export) * ( 0.20 / 1000) i dont want to use expression becouse i cant use cost $price variable with it. i need script do: energy total from meter - export energy active from meter and with this i can use a query like: kwh energy selfconsuption * $price |
Hi, thanks a tonne for this project, it's quite awesome!
I've used your sample influx script to dump the data to influxdb, and have Grafana plugged in over the top and been able to create a few graphs such as power usage, production, temp monitors, and wondering if you have anything built or what you use to visualize the data.
The few metrics I have are great, but its a bit funky trying to match some of the data to mirror the solaredge cloud, ie total kWh per day, or what sort of voltages I should be looking at.
The text was updated successfully, but these errors were encountered: