Solis Cloud data naar PVOutput, Domoticz

Pagina: 1 2 3 Laatste
Acties:

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

As I already had win32diskimager on my pc I used that to start with and added the instructions manually to the sd card for wifi and ssd etc. But that didn't work, no wifi for some reason.

So I now downloaded the Pi imager V1.8.5 and have followed the video instructions to image an sd card. I chose bullseye legacy 32 bit with desktop in case ssd doesn't work for any reason, I assume my spare hdmi monitor will show whats happening.

The video said to power it up first time with nothing connected? then suggests you look for a wifi IP address.
So I did power it with nothing connected for 30mins to make sure it had done whatever it needed to do. I then added a keyboard, mouse LAN cable and HDMI to my monitor and restarted.
My Pi only has 2 USB ports so key/mouse takes them so no room for WIFI dongle.

Some minutes later I have a desktop on the monitor and I am connected to the internet with an IP address for the Pi. It seems extremely slow, but for what I need it for that probably wont matter.

opened file manager on my PC, found ssh folder and deleted the file in there. Now to open a terminal on my PC.

In terminal I put ssh and then mypassword@myPi-IP
It then asked for my password: I typed it very carefully as its invisible and each time I get permission denied please try again.

So unless there is a trick to show what my real password is, though I am 100% sure I typed it correctly I will have to return to the beginning and re-image the card to get a new password.
I do have my desktop still working though if that helps?

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk It could be that the keyboard setting is in the wrong layout (on the Pi or SSH terminal), so some special characters are on a different place :?

Probably you can ask this question better in this topic, because you will get more (and probably better) help:

Raspberry Pi: Ervaringen en Discussie - deel 2

When that works, you can come back to this topic, if there are problems with SolisCloud2PVOutput.

[ Voor 3% gewijzigd door ZuinigeRijder op 07-12-2024 14:10 ]


Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op zaterdag 7 december 2024 @ 13:46:
@ZuinigeRijder

My Pi only has 2 USB ports so key/mouse takes them so no room for WIFI dongle.
You can use an USB hub for keyboard and mouse, so you can use the other USB port for Wifi

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
ZuinigeRijder schreef op zaterdag 7 december 2024 @ 14:05:
@oldman2uk It could be that the keyboard setting is in the wrong layout (on the Pi or SSH terminal), so some special characters are on a different place :?

Probably you can ask this question better in this topic, because you will get more (and probably better) help:

Raspberry Pi: Ervaringen en Discussie - deel 2

When that works, you can come back to this topic, if there are problems with SolisCloud2PVOutput.
I'm back for some assistance please.

I now have a folder in /home/pi/solis. In that folder are 4 files solis.sh, soliscloud_to_pvoutput.py, soliscloud_to_pvoutput.cfg and logging_config.ini.
I have added my solis cloud api detail and my pvoutput api too.
I used sudo chmod +x solis.sh at the command line pi@raspberrypi:~ $ and got no error message so assume that was ok.

The crontab -e: has me somewhat confused.
I want the script to run 24/7 to pvoutput, so will the command
2 5 * * * ~/solis/solis.sh > /dev/null
@reboot sleep 123 && ~/solis/solis.sh > /dev/null
do that or should I use some other?

Without just pulling the plug, how do I stop the script? No matter if I cannot, just curious.

I am using pi OS from May 2020 as any of the later ones were so very slugish on my old Pi.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op vrijdag 13 december 2024 @ 13:12:
[...]


I'm back for some assistance please.

I now have a folder in /home/pi/solis. In that folder are 4 files solis.sh, soliscloud_to_pvoutput.py, soliscloud_to_pvoutput.cfg and logging_config.ini.
I have added my solis cloud api detail and my pvoutput api too.
I used sudo chmod +x solis.sh at the command line pi@raspberrypi:~ $ and got no error message so assume that was ok.
Great. looks Ok.
The crontab -e: has me somewhat confused.
I want the script to run 24/7 to pvoutput, so will the command
2 5 * * * ~/solis/solis.sh > /dev/null
@reboot sleep 123 && ~/solis/solis.sh > /dev/null
do that or should I use some other?
This means that the script will every day start at 5:02 each morning. Plus after reboot of the Raspberry Pi (123 seconds after reboot).

soliscloud_to_pvoutput.py will run in a loop, but will exit if it is before 5:00 or after 22:00. Crontab will start the script again the next day at 5:02.

So you can start the solis.sh script by rebooting your Pi O-)
code:
1
sudo reboot


You can look at the log files created: solis.crontab.log and solis.log, e.g.
code:
1
2
cat solis.log
cat crontab.solis.log
Without just pulling the plug, how do I stop the script? No matter if I cannot, just curious.

I am using pi OS from May 2020 as any of the later ones were so very slugish on my old Pi.
You need to kill the script solis.sh. You can find the PID (process id) with the command ps -ef, example:

code:
1
2
3
4
5
6
rick@raspberrypi:~/solis $ ps -ef | grep solis.sh
rick      7138  7137  0 05:02 ?        00:00:00 /bin/sh -c ~/solis/solis.sh > /dev/null
rick      7139  7138  0 05:02 ?        00:00:00 /bin/bash /home/rick/solis/solis.sh
rick     11323 11175  0 13:26 pts/0    00:00:00 grep --color=auto solis.sh

rick@raspberrypi:~/solis $ kill -9 7138

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
Thanks for the quick reply.

If I wish to have the pvoutput updated every 5 minutes 24/7 do I need to put this in the command line after typing crontab -e

*/5 * * * * ~/solis/solis.sh > /dev/null and hit return

followed by @reboot sleep 123 && ~/solis/solis.sh > /dev/null ? or something else on this 2nd line?

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk No, this will not work, script will exit before 5:00 and after 23:00. This does also not make sense, because there is no solar generation at those hours. And otherwise it will run in a loop and send data to PVOutput whenever new SolisCloud data is available. So it is 18/7 :z

[ Voor 15% gewijzigd door ZuinigeRijder op 13-12-2024 13:56 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
But I also have batteries as well as solar. I get this from solis.
Afbeeldingslocatie: https://tweakers.net/i/k102cyAjrG5v5L2GghHvWa05nzw=/800x/filters:strip_exif()/f/image/k11fmFropayFZOdkmwmEFzg4.png?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
And this from Pvoutput updated every 5 minutes 24/7.
Afbeeldingslocatie: https://tweakers.net/i/E3MU5R9GyCuqtZCH1t8cZ6Sldh4=/800x/filters:strip_exif()/f/image/nZYZNRZFaWxp3MLRUjSvnzQN.png?f=fotoalbum_large

Acties:
  • +1 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Than you need to adapt soliscloud_to_pvoutput.py.

For example comment line 385 till 387:
code:
1
2
3
4
        # only check between 5 and 23 hours
        #if datetime_now.hour < 5 or datetime_now.hour > 22:
        #    logging.info("Outside solar generation hours (5..23)")
        #   sys.exit("Exiting program to start fresh tomorrow")


And change crontab in something like:
code:
1
2
0 0 * * * ~/solis/solis.sh > /dev/null
@reboot sleep 123 && ~/solis/solis.sh > /dev/null

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
I did as suggested for comment lines 385 to 387 and changed crontab.

Rebooted Pi and no logs created: solis.crontab.log and solis.log

I have to guess the scripts not running?

No pvoutput change either.

Any easy way I can check if its running?

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk in the crontab error messages are discarded. You can change the crontab such that also those messages (if any) are written to a separate log file. For example:

code:
1
2
0 0 * * * ~/solis/solis.sh >> ~/solis/crontab.log 2>&1
@reboot sleep 123 && ~/solis/solis.sh >> ~/solis/crontab.log 2>&1


I also have found a problem in my advice to comment the lines. The script computes compute hiRes energy_generation per day, so you need to reset the begin values.
So instead of commenting, probably something like:

Change in soliscloud_to_pvoutput.py line line 385 till 387:
code:
1
2
3
4
        # only check between 5 and 23 hours
        if datetime_now.hour < 5 or datetime_now.hour > 22:
            logging.info("Outside solar generation hours (5..23)")
            sys.exit("Exiting program to start fresh tomorrow")


Into:
code:
1
2
3
4
        # reset once a day
        if datetime_now.hour == 0 and datetime_now.minute < 4:
            timestamp_previous = "0"
            energy_generation = 0


I did not test if there are (other) side effects.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
I think this may be too difficult for me to understand.

Crontab doesn't show me anything that's been entered previously, in fact it doesn't show me anything at all full stop.
So I have no idea what I previously wrote there now.

The "# only check between 5 and 23 hours" lines to be changed for "# reset once a day" lines
I cannot find these to change in any of the 4 files in solis directory.

If they were entered in the crontab then that's just a black hole for me.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk My bad I was not clear, it is not crontab to be changed, but changes in soliscloud_to_pvoutput.py line line 385 till 387.

The only change you need to do in the crontab is these lines:
code:
1
2
0 0 * * * ~/solis/solis.sh >> ~/solis/crontab.log 2>&1
@reboot sleep 123 && ~/solis/solis.sh >> ~/solis/crontab.log 2>&1


I added ">> ~/solis/crontab.log 2>&1" instead of "> /dev/null". The latter will ignore any output.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
OK thanks again, I will return to this tomorrow, brain fog has descended for tonight :)

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
Ive not got back to the Pi yet but I am dyslexic so some stuff is more difficult than it should be.

From your github code. solis.sh

Is the line 15 start an error fi instead of if ?

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk No, fi is correct, it is the end of the if statement in a bash script. See here a tutorial.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
LOL they don't make it easy for a boy named Sue do they. 8)7

Back to my double checking everything and adding stuff.

Oh and I found my perfectly good in windows 11 Amazon basic wired keyboard does strange stuff on the Pi, like the @ sign is AWL and the ~ sign too which is not a great help. So today will feature another keyboard test run first.
Thanks once more.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder OK I found all went well with 4 files into solis directory at /home/pi/solis.

Now to write the crontab lines.

The changed wireless keyboard I used will not function in command mode, so I have to change keyboards again.

I type crontab -e
That gets me #green comments, I scroll down and using copy and paste I copy the 2 lines

0 0 * * * ~/solis/solis.sh >> ~/solis/crontab.log 2>&1 then enter key
then
@reboot sleep 123 && ~/solis/solis.sh >> ~/solis/crontab.log 2>&1 then enter key

Afbeeldingslocatie: https://tweakers.net/i/o28UlMg9vW6nBJfNZMS7c11dp_Q=/800x/filters:strip_icc():strip_exif()/f/image/h5ZKccV6G2n4fMPssUW80fIh.jpg?f=fotoalbum_large

I googled and found ctrl+c exits without changes
Also ctrl+k+x saves changes and exits


now I have many options and it tells me what it will save the lines as but I have no idea what to do other than save and exit.


I didn't get any of this happening yesterday after entering the crontab stuff so maybe it just didn't work at all yesterday.


Now it says, no crontab for pi - using an empty one.
Installing new crontab.

Afbeeldingslocatie: https://tweakers.net/i/dT8ntM2omSRVzVj4eAwLRgaG48I=/800x/filters:strip_icc():strip_exif()/f/image/MQKhFm9K9bxFvz0ZAuOlA69y.jpg?f=fotoalbum_large

So after that I rebooted and I now have a crontab.log which says
/bin/sh: 1: /home/pi/solis/solis.sh: permission denied


The crontab command seems to be in place though as I used crontab -l to list the following.


Afbeeldingslocatie: https://tweakers.net/i/lMJSmiOcuYxJlKqwkPw6yLF3alY=/800x/filters:strip_icc():strip_exif()/f/image/Y8XoobkuJD7t1kpsiYWUBMcv.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk You can list the crontab with command:
code:
1
crontab -l
/bin/sh: 1: /home/pi/solis/solis.sh: permission denied
Looks like you did not make solis.sh executable. Did you do the command:

What are the permissions of solis/sh?
code:
1
ls -l /home/pi/solis/solis.sh


These are mine permissions:
code:
1
-rwxr-xr-x 1 rick rick   840 Aug 19  2022 solis.sh


code:
1
chmod +x /home/pi/solis/solis.sh


But you also need read permission, so maybe that is the problem. This command will set this:

code:
1
chmod u+r+x /home/pi/solis/solis.sh

[ Voor 17% gewijzigd door ZuinigeRijder op 14-12-2024 14:56 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

Here are my permissions before and after.

I have rebooted.

I now have a crontab.log which says /bin/sh: 1: /home/pi/solis/solis.sh: not found

Here also is my solis.sh file

Afbeeldingslocatie: https://tweakers.net/i/luH-RSFFXwRwfdSf6EkVHUxlcBs=/800x/filters:strip_icc():strip_exif()/f/image/taqv2dDuCKjqKbUfakUvIhZJ.jpg?f=fotoalbum_large

Afbeeldingslocatie: https://tweakers.net/i/kxNqPt2ZDDGP3NRK2SuJ1PVGw8I=/800x/filters:strip_icc():strip_exif()/f/image/n4hka7AykHI2Iz0blIoDUA3m.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I think you need to set execute permission to all users, so:
code:
1
chmod +r+x /home/pi/solis/solis.sh

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
I did this chmod +r+x /home/pi/solis/solis.sh

result in picture. I rebooted and crontab.log is still saying /home/pi/solis/solis.sh: not found (2nd entry)

Thanks once more.

Afbeeldingslocatie: https://tweakers.net/i/Iwt13HBoxbwO5jqRTlPWkb6td-s=/800x/filters:strip_icc():strip_exif()/f/image/m7VNsTAMjz9mPeuFcUkXV3u3.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I think the problem is the permissions of the solis directory above.

code:
1
2
3
ls -l /home/pi
chmod +r+x /home/pi/solis
ls -l /home/pi

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

result in picture. I rebooted after and crontab.log is still saying /home/pi/solis/solis.sh: not found (3rd entry)

Afbeeldingslocatie: https://tweakers.net/i/te1SdYe7M-x_d4Wu1tyVD6hAV00=/x800/filters:strip_icc():strip_exif()/f/image/oGRZHUF3t15IBfhlDBba4q17.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk something unexpected. On your OS bash is located elsewhere. What is the result of this command?

code:
1
which bash


That returned full path needs to be in the first line in solis.sh

[ Voor 3% gewijzigd door ZuinigeRijder op 14-12-2024 17:50 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
which bash gave this photo.
Afbeeldingslocatie: https://tweakers.net/i/t1kXRRlDbXcOoLZr3w8bOMSYREs=/800x/filters:strip_icc():strip_exif()/f/image/q0t3JrC2tDxYeTqqm3TI9jY2.jpg?f=fotoalbum_large

The 2nd photo is how my solis.sh looked.
Afbeeldingslocatie: https://tweakers.net/i/ZAWl15mcACv3Eb1_Yn1xKYAdNMw=/800x/filters:strip_icc():strip_exif()/f/image/1s2v5hg0XBXQ92fZaBGnCbPS.jpg?f=fotoalbum_large

I have edited the file to remove the #! from the first line.

Now on reboot I get this in crontab.log.

Afbeeldingslocatie: https://tweakers.net/i/0IjGn1-ei3vBmWgoqHMML8-FVTA=/800x/filters:strip_icc():strip_exif()/f/image/kHkOiwt4hPDkA0474s2WbUo5.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk No, the #! needs to be in front. I do not have a clue now, so still it is a Raspberry Pi problem, so probably ask for help in rhe other forum I mentioned once.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
OK well many thanks for all the prompting and guidance you have given me. I will put the #! back and try to get further in the pi forum.
I might be back if I may, should I get a problem with the python you have written.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Of course d:)b

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I have another thing to try, specifying full path in the crontab, e.g.

code:
1
2
0 0 * * * /home/pi/solis/solis.sh >> /home/pi/solis/crontab.log 2>&1
@reboot sleep 123 && /home/pi/solis/solis.sh >> /home/pi/solis/crontab.log 2>&1


Maybe this does not work, but worth a try.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk And another possible problem, your script solis.sh has Windows line endings, not Unix endings.

You can fix this with the command:

code:
1
dos2unix /home/pi/solis/solis.sh


My guess is that this is the real problem. Did you edit solis.sh on Windows?

[ Voor 16% gewijzigd door ZuinigeRijder op 14-12-2024 20:51 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

As I didn't have a keyboard that would produce the right characters I got round this by copy and paste the 4 needed files from github into a folder on a memory stick called solis.
I then used the memory stick on a hub in the Pi to move the files and folder to home/Pi

I don't see any visible difference between the raw guthub file and one now in the Pi, but I take your word that they are not the same and I may have edited it in windows yes but I really don't remember now.

Should I use that dos2unix line on all four files I got from github (with the end part changed of course) ? in case I have contaminated them too with windows line ends, whatever they look like! Edit I have researched and now understand more about LF & CR's

I will delay the crontab adjustment until I have decontaminated ;) my file and rebooted to test.

I will be tomorrow now, but again I thank you for the extra mile.

[ Voor 3% gewijzigd door oldman2uk op 15-12-2024 02:26 ]


Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Yes, better to also use dos2unix on the other files too.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk You can configure the keyboard layout in Raspberry Pi raspi-config. See this post.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
ZuinigeRijder schreef op zondag 15 december 2024 @ 08:14:
@oldman2uk You can configure the keyboard layout in Raspberry Pi raspi-config. See this post.
Thanks, I did already find and set my 3rd keyboard so that's no longer an issue to add to the mix ;)

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
That started badly, bash: dos2unix: command not found.

I used add & remove software to find and install dos2unix. At least the command line didn't complain when I typed dos2unix.
I then used it on all the files in solis & rebooted 3 times in all.
The result is consistent, crontab.log says....not found.

Afbeeldingslocatie: https://tweakers.net/i/AvP0s6PELAnTfnXoMuI5YU5zaoA=/800x/filters:strip_icc():strip_exif()/f/image/WHRrlH2U6N7pyvm2xtL52e9X.jpg?f=fotoalbum_large


Afbeeldingslocatie: https://tweakers.net/i/AY3Y4U8TWIWoarxlDlvSh_fKWkM=/800x/filters:strip_icc():strip_exif()/f/image/jyxYVxTP8d7cLKEOxSKqh7WN.jpg?f=fotoalbum_large

I've yet to try typing in the 2 lines into crontab. I'm not sure I remember how right now. Do I type one line then hit enter, then type the second line?
What happens to the other command we entered previously? does it need removing somehow?

In command line if I enter crontab -e that gives me the same 2 lines as your full path above ^ but without the ~ before the /
So do I attempt to edit the 2 lines there already to remove ~ or delete the lines (if thats possible) I didnt yet try.
Or will 2 new lines auto remove the existing? I have a row of edit choices at screen base.

[ Voor 28% gewijzigd door oldman2uk op 15-12-2024 10:47 ]


Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk With crontab -e existing entries keep there, unless you delete them in the editor. So you can change them or delete the lines. And yes, each command needs on a separate line, so enter after a command.

Note that you can also already try if soliscloud_to_pvoutput.py is working, without using crontab.

code:
1
2
cd /home/pi/solis
python soliscloud_to_pvoutput.py


At least you can see if sending to PVOutput is working. You can end the running with CTRL-C.

Thereafter you can try to solve the problem with the crontab and running solis.sh.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder I will go back to crontab and edit as needed, I think I have the way to do that now thanks.

I did try to run python soliscloud_to_pvoutput.pv and got this.

Afbeeldingslocatie: https://tweakers.net/i/iNIOGrOEWfCQiEpjMt9qEmjjmNI=/800x/filters:strip_icc():strip_exif()/f/image/QXtnX7hpGqIdCOy0zj2OgTE6.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Maybe you have an old version of python, you need at least python 3.9 or higher. Which version gives:

code:
1
python --version


It is also possible that python3 is installed and python is the default 2.x version:

code:
1
python3 --version

[ Voor 29% gewijzigd door ZuinigeRijder op 15-12-2024 11:21 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder I have version 2.7.16
This is Pi os from may 2020 so thats why python is too old.

Am I able to upgrade this OS python or is that not possible?

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I edited my previous comment, which version gives python3 --version?

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder Python version 3.7.3 is inside already.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Ok, it is too old, it needs at least 3.9 I think.

However, first check if 3.7.3 is also running, without the need of installing a newer version of python.

code:
1
2
cd /home/pi/solis
python3 soliscloud_to_pvoutput.py


If it is working, than you do not need to upgrade, but prepend the calls to soliscloud_to_pvoutput.py with python3. Otherwise you can upgrade to python 3.9.2 or later. Instructions here. Version 3.10.2 as specified in the example is also fine.

[ Voor 5% gewijzigd door ZuinigeRijder op 15-12-2024 11:35 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder error line 385

Afbeeldingslocatie: https://tweakers.net/i/ombdY_ycFG2EwttlWt9FGyHkLrc=/800x/filters:strip_icc():strip_exif()/f/image/96cttA4eb5NZyYoRohwe7dfg.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk There is an error in the line: "and and" should be one "and". I corrected my post where I did copy/paste it wrongly.

Good news is that it looks like your python3 version seems to work.

[ Voor 46% gewijzigd door ZuinigeRijder op 15-12-2024 11:55 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Yeah, you need to install paho_mqtt. Probably something like:

code:
1
python3 -m pip install paho_mqtt

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Ah, the newer version of paho_mqtt is not compatible with python3. So you need to have an older version of paho_mqtt.

code:
1
2
python3 -m pip uninstall paho_mqtt
python3 -m pip install paho_mqt==1.6.1

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I made a typo, missing a t, should be:

code:
1
python3 -m pip install paho_mqtt==1.6.1

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder that fixed it so its sending data but maybe an error on pvoutput? Ive blanked out my pv id and serial in this picture.
Afbeeldingslocatie: https://tweakers.net/i/nmSmNuhLrh7uV0c6CeSRBsYnTaM=/800x/filters:strip_icc():strip_exif()/f/image/PlWIzcRCvHp7leTJAUQpGRTU.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Looks like your pvoutput_api_key and/or pvoutput_system_id is not correct in soliscloud_to_pvoutput.cfg. Did you configure/enable pvoutput.org (Settings -> API Access enabled)?

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder Sorry for the delay, I was checking pvoutput. I made an error in the ID. Corrected now and running but not long enough yet to see if its collecting data ;)
https://pvoutput.org/list.jsp?userid=124179

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Great. Now the crontab getting to work. Note that you need to edit solis.sh to change python intro python3.

I assume you also want to see battery information in the last column. Did you configure that?
pvoutput_fill_power_consumption_with_familyloadpower = False
pvoutput_fill_power_consumption_with_homeconsumption = False

[ Voor 47% gewijzigd door ZuinigeRijder op 15-12-2024 13:14 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder I have altered solis.sh to python3

So ctrl c to stop the script now and reboot to hopefully auto start it? Is that right?

Thank you for sticking at it with me ;)

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Yes, still probably some problem in crontab though. But lets see.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder crontab.log reports
/bin/sh: 1: /home/pi/solis/solis.sh: not found

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
here is solis.sh
Afbeeldingslocatie: https://tweakers.net/i/IZXIJ1m7f7qIyHQVm2yl55b7qfI=/800x/filters:strip_icc():strip_exif()/f/image/8nfoJ2fSteNMdFKuOzhcCPSL.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Yeah, maybe you are looking at the error message the first time it was written. Because the command:

code:
1
2
0 0 * * * /home/pi/solis/solis.sh >> /home/pi/solis/crontab.log 2>&1
@reboot sleep 123 && /home/pi/solis/solis.sh >> /home/pi/solis/crontab.log 2>&1


">>" in these 2 commands mean that messages are appended to /home/pi/solis/crontab.log.

If you change it into one > it will rewrite the log file:

code:
1
2
0 0 * * * /home/pi/solis/solis.sh > /home/pi/solis/crontab.log 2>&1
@reboot sleep 123 && /home/pi/solis/solis.sh > /home/pi/solis/crontab.log 2>&1


So maybe it is now just running Ok. You can look into solis.log and (and remove prior the solis.log with command "rm solis.log").

[ Voor 9% gewijzigd door ZuinigeRijder op 15-12-2024 13:35 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder I edited the crontab but when I try to save it says I have errors?

Afbeeldingslocatie: https://tweakers.net/i/gF3gINqF8NGwyjfzQm2x56vTPfA=/800x/filters:strip_icc():strip_exif()/f/image/Dn8XrgC4qyAmNEJliYP41VJp.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
Hey, you just removed 2 lines ;)

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

Just 1 entry in the new crontab log /bin/sh: 1: /home/pi/solis/solis.sh: not found

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

Perhaps name the crontab directly in solis.sh?

Its reporting /tmp/crontab.TDBblF/crontab when I use crontab -e

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk No, the tmp is normal. The only I can think of now is to add bash to the crontab (although that would not be needed).

code:
1
2
0 0 * * * /bin/bash /home/pi/solis/solis.sh > /home/pi/solis/crontab.log 2>&1
@reboot sleep 123 && /bin/bash /home/pi/solis/solis.sh > /home/pi/solis/crontab.log 2>&1


And I assume you did the dos2unix solis.sh.

Otherwise I have no clue anymore, probably ask in the other forum for some help.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder You must be tired after nursing me all day, many thanks for the assistance.

I too will rest a while. How may I ask do I make a back up copy of my SD card in case it fails I wouldn't want to start again from scratch!
I would like to re asign voltage and perhaps temperature to battery soc and battery charge at some future date, I will look at the readme for your github scripts.

I did btw do dos2unix on all the files in the solis directory.

I did the bin/bash as you suggested and the result was.

Afbeeldingslocatie: https://tweakers.net/i/3vDHmMwBOy-Hfxk8HKvOeVE6TJk=/800x/filters:strip_icc():strip_exif()/f/image/0c8vkSvzFmNAObiwVlPU4cDP.jpg?f=fotoalbum_large

Have a nice afternoon. :)

[ Voor 30% gewijzigd door oldman2uk op 15-12-2024 15:58 ]


Acties:
  • +1 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I think definitely something is wrong with the solis.sh file in mixing CRLF. Especially because of the '\r' in the error messages. Also the first line will be wrong (with mixing CRLF), therefor /bin/bash was not found. So you might copy the original solis.sh once again to the Raspberry Pi, do dos2unix and change python into python3.

You can also try to copy/paste the following lines directly in an editor of solis.sh on the Raspberry Pi and after saving do an additional dos2unix and make sure the execute bit is set (chmod +r+x solis.sh)

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# ---------------------------------------------------------------
# A script to keep the soliscloud_to_pvoutput.py script running.
# Add to your crontab to run once a day, e.g. at 05:02 and at reboot
# 2 5 * * * ~/solis/solis.sh > /dev/null
# @reboot sleep 123 && ~/solis/solis.sh > /dev/null
# ---------------------------------------------------------------
script_name=$(basename -- "$0")
cd ~/solis

now=$(date)
if pidof -x "$script_name" -o $$ >/dev/null;then
   echo "$now: $script_name already running" >> solis.crontab.log 2>&1
   exit 1
fi
echo "WARNING: $now: $script_name NOT running" >> solis.crontab.log 2>&1
/usr/bin/python3 -u ~/solis/soliscloud_to_pvoutput.py >> solis.log 2>&1


Make sure the last line is an empty line.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder I did all the above, deleted the old solis.sh

Rebooted and crontab has just 1 error line now.
/home/pi/solis.sh: line 18: syntax error: unexpected end of file.

So I again opened solis.sh in a pi editor, set the cursor on a new line after the last text, saved the file then in command window used dos2unix again.
rebooted.
Same crontab error showing /home/pi/solis.sh: line 18: syntax error: unexpected end of file.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I wonder if the python script is running in the background, despite the error message. You can check with

code:
1
ps -ef | grep python

[ Voor 3% gewijzigd door ZuinigeRijder op 15-12-2024 18:35 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
ZuinigeRijder schreef op zondag 15 december 2024 @ 18:34:
@oldman2uk I wonder if the python script is running in the background, despite the error message. You can check with

code:
1
ps -ef | grep python
I've not tried to check but the script can be started in the command line and returns an output to pvoutput.org every 5 minutes.
If I reboot and wait longer than 5mins and have no output to pvoutput.org my thinking is that the script is not running.
I have it running right now from the command line.

They tell me in another forum that cron was never designed to be used in this way. There are better ways I am told. https://forums.raspberrypi.com/viewtopic.php?t=314455

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Yes, but the script needs to be run in the background, when you are logged out. solis.sh should also run from the command line, running the python script in the background.

There is still something wrong with solis.sh.

Can you post the output of the command

cat solis.sh

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
OK thanks for your help.

Afbeeldingslocatie: https://tweakers.net/i/kiUntoumSbJadY44C08KLfUD8eI=/800x/filters:strip_icc():strip_exif()/f/image/JB9xvsM6sV31bnPmYWUko6cY.jpg?f=fotoalbum_large

[ Voor 4% gewijzigd door oldman2uk op 15-12-2024 20:34 ]


Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I think I spotted the error. On line 15 I miss the i from the fi (which is the endif).

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
ZuinigeRijder schreef op zondag 15 december 2024 @ 21:27:
@oldman2uk I think I spotted the error. On line 15 I miss the i from the fi (which is the endif).
Well done that man! I now have a solis.crontab.log and a solis.log that were not there before and it rebooted and started its task without action from the command line by me.

I feel I must apologise to all who have helped me in this as I am dyslexic so things tend to look right when they are not. I found the if and fi statements and thought the fi was an error then I compounded that error when I corrected my earlier mistake.

So I just need to check it plays nice if the lan cable is disconnected and that it will run with no keyboard/mouse & monitor connected.
Then I need to hopefully add some data and move some as not all is showing in pvoutput right now.

Time for all to have a beer or two _/-\o_

Acties:
  • +1 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk If I summarize what were the real problems:
- you must make sure that there are no Windows style CRLF, which was the case in solis.sh and probably in the other files too
- the read+execute permission should be set on solis.sh
- you have a older python version where python 3.x is not the default, so you have to adapt solis.sh to change python into python3
- you had to install the package paho_mqtt==1.6.1

The other steps was learning and trying to find the problem. Some of the steps taken were not necessary, but were helpful in tracking down the problems.

I still hope you enjoyed the journey :9B :9B

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

My journey continues ;)

I removed the keyboard/mouse & hdmi connects and it worked fine still. Until midnight or 12:00AM then no more outputs.
By 12:30AM it was obvious (headless) that it wasn't going to start the new day so a reboot by power removal got it moving again, Its now 12:45AM and its sending output fine since the reboot to pvoutput.

The only data showing is the temperature of the inverter and the mains voltage (in the wrong slot). Power generated when the sun shines is correct and in the right slot.

Power being used is near 4kWh now but nothing showing on the graph, its slot is taken by mains voltage.

Battery SOC is an extra slot that I am happy to exchange inverter temperature for.

So once you are refreshed I will be back to pick your brain if I may?

https://pvoutput.org/intraday.jsp?id=124179&sid=107241

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk You really must not power off the raspberry pi the hard way by power removal, this might corrupt your SD card.

You should try to start a ssh from your computer to your raspberry pi to open a terminal window. That way you can give commands and copy paste output. I use Putty for that. And also reboot the Raspberry Pi (sudo reboot) via a terminal. And at the end you can log out the terminal session (logout).

Tutorial how to setup Putty and SSH here.
If SSH is not enabled, see here how to do that.

can you post the content of solis.log?

[ Voor 56% gewijzigd door ZuinigeRijder op 16-12-2024 08:02 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

Its a very big log at a line every 5mins. Here is the part dealing with midnight. looks like the data didnt stop, just failed to make a new day start on pvoutput. I will look at putty later, thank you.

Afbeeldingslocatie: https://tweakers.net/i/S4SXhJUNYYM6DISLCmtmBhuaG50=/800x/filters:strip_icc():strip_exif()/f/image/mV3fE0quVajPYa5Lb8PRUKJt.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

I have renamed the 3 old ssh files in my pc and set ssh up on my Pi. I have logged in on my pc to the pi via cmd. I have also changed the password from the default.
I still dont feel comfortable working in cmd line. I didnt download putty yet as I saw it asked I put ssh in the boot or root of my Pi sd card.

I am more concerned that my data to pvoutput will fail each night at midnight, I could put a digital timer to cut the Pi power at midnight and restart it at 12:02am but I would rather not as like you say, it may corrupt my sd card.
Also looking forward there is so far no usable data showing in pvoutput apart from the inverter temperature and system voltage, neither of which I really need. So unless I can get better usable data to work with then this exercise has been a little disappointing.
I value your help so far in this, but wonder if it will become usable without lots of time and effort?

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op maandag 16 december 2024 @ 20:40:
@ZuinigeRijder

I have renamed the 3 old ssh files in my pc and set ssh up on my Pi. I have logged in on my pc to the pi via cmd. I have also changed the password from the default. I still dont feel comfortable working in cmd line.
Ok, so you have another tool for remote logging in to the Raspberry Pi.
I didnt download putty yet as I saw it asked I put ssh in the boot or root of my Pi sd card.
I do not understand this, you do not need to install Putty on the Raspberry Pi, you can install this in your Windows PC. But apparently you do not need that, because you have another way to login on the Raspberry Pi. What did you use?
I am more concerned that my data to pvoutput will fail each night at midnight, I could put a digital timer to cut the Pi power at midnight and restart it at 12:02am but I would rather not as like you say, it may corrupt my sd card.
As far as I could see from the logging, there was no failure at midnight.
Also looking forward there is so far no usable data showing in pvoutput apart from the inverter temperature and system voltage, neither of which I really need. So unless I can get better usable data to work with then this exercise has been a little disappointing.
I value your help so far in this, but wonder if it will become usable without lots of time and effort?
I already mentioned the choice between 2 settings (one of them you can set to True):
pvoutput_fill_power_consumption_with_familyloadpower = False
pvoutput_fill_power_consumption_with_homeconsumption = False

Discussion here for the first one and here for the second one.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
I was following a youtube video for installing an OS on the Pi, and after 3 installs I had a ssh file for each install as instructed in the video. I had to keep renaming them to save deleting.
Today I followed another tutorial for how to install ssh as I had forgotten how to do it in the Pi.
Then I changed the default password and wrote myself a note on how to get to the Pi from a windows pc cmd line.

As to putty it wasn't to install putty on the pi, it said to put a ssh file in the boot folder of the pi. Its here in red at the end of step 1 https://robu.in/putty-configuration-raspberry-pi/

My Pi did not update my pvoutput at or after midnight. I don't know why as it was running. My other pvoutput instance ran through midnight same as always here https://pvoutput.org/intr...6619&dt=20241216&gs=0&m=0
Click next day to see the rollover at midnight.

Thanks for the links to the 2 discussions, I will take a look later while I watch the midnight rollover ;)

Are you able to tell me what data types are available from soliscloud api? I do need a minimum of Power used and power generated plus soc battery. I see power generated so far on pvoutput but it doesn't increase the total per day past 0.099kWh which is clearly incorrect, Its measuring the generated for the graph but I'm guessing solis doesnt total the day past 0.099kWh.

My brain is hurting again ;)

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
Once more the end of day came and went, after 11:55pm no more data appears to flow to Pvoutput.
At 1:00am I rebooted after checking the solis log did have data after midnight. At 1:05am pvoutput again got data. Very strange.

Acties:
  • +1 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk As I did not test my changes to run it for always, I see that my instructions for the local changes were NOT complete. As you see in your post at 00:04:53 and subsequent data still the old date is send.

There are more changes needed to fix this, so I decided to make a configuration item to run it unendless and implemented this in soliscloud_to_pvoutput.py. Also added some more information to the README for the problems encountered. See this release.

- Add "run_unendless = True" to the [api_secrets] section in soliscloud_to_pvoutput.cfg
- copy the updated soliscloud_to_pvoutput.py to your Raspbery Pi (and run dos2unix on this one)

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
Again I thank you for your perseverance on this task of ours.

Pretty sure I didn't stop the program when doing the file changes. I used control and C several times from the cmd line in the Pi but looking at the pvoutput later the time stamps don't stop until I did a reboot at 09:57am.

I swopped some stuff from false to true in the pvoutput section of the soliscloud_to_pvoutput.cfg to get more data viewable while I was there.

I ran dos2unix as instructed on the new file once installed. :)

I have a new file appeared in the solis folder since today, it may be because of my file changes "live" ?
Its called d2utmpUxXN65.log and looks to be empty.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk The python script runs in the background, if you want to stop that you have to kill that process. I have in one of my posts put that command ("ps -ef | grep soluis.sh" and "kill -9"). When you change settings, you need to restart the script.

The temporary log file can be removed.

PVOutput fields are limited, so I am curious which settings you did change. Because there are not much settings to choose from/overrule.

The information in the script available is:
code:
1
2
3
4
5
6
7
8
9
10
11
12
date
time
energy_generation
solar_power
battery_power
battery_soc
grid_power
family_load
home_consumption
inverter_temperature
dc_voltage
ac_voltage


Currently in PVOutput fields you can only override the power_consumption (default ac-voltage) with family_load or home_consumption for PVOutput. And voltage (default dc_voltage) with ac_voltage.

With Domoticz or MQTT (e.g. Home Assistant) all the settings above are available, but much much more complex and not suitable for your Raspberry Pi.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
So to stop the script can I just type "kill -9" and must it be from cmd line or must I "cd solis" first? will that kill all scripts?

Or must I at the cmd line type "ps -ef | grep solis.sh" or do I need to cd to solis first?

Temp file has removed itself.


I put fill temp with inverter temp = true
fill voltage with ac voltage = true
fill power cons with homeconsumption = true
fill power cons with homeconsumption = false
fill power cons with ac voltage = false

date
time
energy_generation
solar_power
battery_power
battery_soc
grid_power
family_load
home_consumption
inverter_temperature
dc_voltage
ac_voltage

So although the above are available, they are not for the Pi so I cant use battery soc anyway or battery power.
Is that because they didn't yet get added to the script or because the Pi or pvoutput cant cope with the extra data?

Oh and the time seems to have gone out of sync. The pvoutput update is now near 2 mins behind real time updating. It used to be at worst 20seconds delayed.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op dinsdag 17 december 2024 @ 15:13:
@ZuinigeRijder
So to stop the script can I just type "kill -9" and must it be from cmd line or must I "cd solis" first? will that kill all scripts?

Or must I at the cmd line type "ps -ef | grep solis.sh" or do I need to cd to solis first?
No, you have to find the process id first and put that number as parameter of kill -9 as described in this post earlier. But a reboot will of course kill also all running scripts.
Temp file has removed itself.

I put fill temp with inverter temp = true
fill voltage with ac voltage = true
fill power cons with homeconsumption = true
fill power cons with homeconsumption = false
fill power cons with ac voltage = false

date
time
energy_generation
solar_power
battery_power
battery_soc
grid_power
family_load
home_consumption
inverter_temperature
dc_voltage
ac_voltage

So although the above are available, they are not for the Pi so I cant use battery soc anyway or battery power.
Is that because they didn't yet get added to the script or because the Pi or pvoutput cant cope with the extra data?
The only way is to misuse one of the fields of PVOutput, e.g. inverter_temp. But then you must adapt soliscloud_to_pvoutput.py yourself by changing line 483 into something elese, e.g.:

code:
1
                pvoutput_string = f"data={today_yyymmdd},{current_time},{energy_generation},{solar_power},{energy_consumption},{power_consumption},{temperature},{voltage}"  # noqa


into

code:
1
                pvoutput_string = f"data={today_yyymmdd},{current_time},{energy_generation},{solar_power},{energy_consumption},{power_consumption},{battery_power},{voltage}"  # noqa


If you look closely you see I changed {temperature} into {battery_power}.
Because PVOutput is meant for solar panels, all the battery information cannot be send too. If you pay for PVOutput, you can have extended parameters.
However, then you also need to adapt the python script yourself.
Oh and the time seems to have gone out of sync. The pvoutput update is now near 2 mins behind real time updating. It used to be at worst 20seconds delayed.
That is probably more to when SolisCloud does the updates, the python script checks once per minute if there is new data. So in practice there can be a delay of 1 minute due to the python script. But that does not matter, because the timestamp of SolisCloud update is send with the data.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder pvoutput_string = f"data={today_yyymmdd},{current_time},{energy_generation},{solar_power},{energy_consumption},{power_consumption},{temperature},{voltage}" # noqa

So if I change the above to {battery_soc} instead of {temperature}

What exactly do I change the cfg line too?

[PVOutput]
send_to_pvoutput = True
pvoutput_fill_temperature_with_inverter_temperature = True

From above to below?

pvoutput_fill_temperature_with_battery_soc= True


Anywhere else I need to change ?

Finding the processs ID is confusing.

There are several numbers given, how do I know which is the right one to use? Is the ID always the same even after a reboot? Is there not a simple code if the ID constantly changes to use on the cmd line that tells a string to shut down the process. And maybe another to start it rather than have to go through a reboot?

Here is my list of ID's.

Afbeeldingslocatie: https://tweakers.net/i/vhiAjc0-jl9IVwySK3GP5pXdqmc=/800x/filters:strip_icc():strip_exif()/f/image/U9reXAacGQxwln9CwCKafLK8.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op dinsdag 17 december 2024 @ 17:22:
@ZuinigeRijder pvoutput_string = f"data={today_yyymmdd},{current_time},{energy_generation},{solar_power},{energy_consumption},{power_consumption},{temperature},{voltage}" # noqa

So if I change the above to {battery_soc} instead of {temperature}

What exactly do I change the cfg line too?

[PVOutput]
send_to_pvoutput = True
pvoutput_fill_temperature_with_inverter_temperature = True

From above to below?

pvoutput_fill_temperature_with_battery_soc= True


Anywhere else I need to change ?
You do not need to change the cfg config file, because you programmatically overrule what is programmed in the settings for this item.
Finding the processs ID is confusing.

There are several numbers given, how do I know which is the right one to use? Is the ID always the same even after a reboot? Is there not a simple code if the ID constantly changes to use on the cmd line that tells a string to shut down the process. And maybe another to start it rather than have to go through a reboot?

Here is my list of ID's.

[Afbeelding]
It is the oldest number you need to kill.
Another approach is to use:
code:
1
2
pkill -9 solis.sh
nohup /home/pi/solis/solis.sh &


The first one kills the process with name solis.sh and the second one starts solis.sh in the background and it keeps running, also when logged out. I do not if pkill is installed on your Raspberry Pi, for me it is.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder Once more thank you for your continued assistance.

"It is the oldest number you need to kill."

There are 6 numbers in my picture which number is oldest?


pkill -9 solis.sh doesn't seem to do anything. pkill is installed though. help gets me a list of its options.

I assume that should I wish to shutdown the pi without maybe corrupting the script I can use shutdown on the gui desktop or sudo shutdown -r from the command line? I assume again that the os closes down any scripts before shutting down?
Reboot with sudo reboot?

I did use the file editor while the script was running it seems, I had no idea if it was stopped or not.
I now have my battery soc showing on the graph instead of inverter temperature, it will look worrying when the battery is fully charged (100 deg C inverter) ;)

Oh and nohup solis.sh & gets errors no such file I think it said.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op dinsdag 17 december 2024 @ 21:56:
@ZuinigeRijder Once more thank you for your continued assistance.

"It is the oldest number you need to kill."

There are 6 numbers in my picture which number is oldest?
270
pkill -9 solis.sh doesn't seem to do anything. pkill is installed though. help gets me a list of its options.
It kills the script silently, you can check with "ps -ef | grep solis.sh" if it is still running. Note that you should ignore the line with "grep" in it.
I assume that should I wish to shutdown the pi without maybe corrupting the script I can use shutdown on the gui desktop or sudo shutdown -r from the command line? I assume again that the os closes down any scripts before shutting down?
Reboot with sudo reboot?
Yes, that is correct.
I did use the file editor while the script was running it seems, I had no idea if it was stopped or not.
I now have my battery soc showing on the graph instead of inverter temperature, it will look worrying when the battery is fully charged (100 deg C inverter) ;)
When the python script is running and you make changes, those will not be taken over yet. So you have to stop and start solis.sh or reboot.
Oh and nohup solis.sh & gets errors no such file I think it said.
You need to prepend the directory path, e.g.:
code:
1
nohup /home/pi/solis/solis.sh &


or when you are already in the solis directory:

code:
1
nohup ./solis.sh &

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder

So tomorrow I will use Pi imager to make a backup of my SD card.

Then safe in the knowledge that I have a backup copy I will use it as is, if I need to make changes to the pvoutput lines I can either do that live and then reboot to save me from having to learn the 100's of commands you have shown me. Or make copies and substitute files though I cannot see a reason for needing to do that.

Oh and keep this page bookmarked so I can return for a refresher :)

Many thanks for the crash course.

Does the solis.log self empty older days data as its getting quite large after just 3 days.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder
ZuinigeRijder schreef op dinsdag 17 december 2024 @ 09:50:

- Add "run_unendless = True" to the [api_secrets] section in soliscloud_to_pvoutput.cfg
- copy the updated soliscloud_to_pvoutput.py to your Raspbery Pi (and run dos2unix on this one)
I did exactly that, remember i'm doing just what I am told :)

At 11pm the script stopped.

Afbeeldingslocatie: https://tweakers.net/i/Z_17J_WRxby9v3sAfUuQBejxvzA=/800x/filters:strip_icc():strip_exif()/f/image/ODc4kXc9Z8CYc6pfLUMuxWAx.jpg?f=fotoalbum_large

So I searched soliscloud_to_pvoutput.py for what could be wrong and of course found the False line.

69 RUN_UNENDLESS = get_bool(api_secrets, "run_unendless", False)

Changed to True and rebooted, now working again.

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
oldman2uk schreef op dinsdag 17 december 2024 @ 22:50:
@ZuinigeRijder

Does the solis.log self empty older days data as its getting quite large after just 3 days.
Does not matter how big solis.log gets. You can get e.g. the last 100 lines with the command:

tail -100 solis.log

And of course you can just delete solis.log if it gets too big, but is normally not needed:

rm solis.log
oldman2uk schreef op woensdag 18 december 2024 @ 04:06:
@ZuinigeRijder

[...]


I did exactly that, remember i'm doing just what I am told :)

At 11pm the script stopped.

[Afbeelding]

So I searched soliscloud_to_pvoutput.py for what could be wrong and of course found the False line.

69 RUN_UNENDLESS = get_bool(api_secrets, "run_unendless", False)

Changed to True and rebooted, now working again.
Did you not add "run_endless = True" to soliscloud_to_pvoutput.cfg 8)7 See here example config.

Because you did not need to change soliscloud_to_pvoutput.py for that.

[ Voor 4% gewijzigd door ZuinigeRijder op 18-12-2024 08:13 ]


Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
@ZuinigeRijder Just this once ;) you are wrong.

I did add run_endless = true at the time of the original post telling me to do so, picture below.

A reboot last night left me with the same "come back tomorrow" message. Only after changing soliscloud_to_pvoutput.py did the script run again, started at 2:40am

Oh and while I am awake nursing my script I tried changing the pvoutput string {voltage} to {grid_power} but the result wasn't what I expected. When the grid was supplying 3600watts I got 3.0v so even with a multiplier the number would have been wrong, I will try another substitution later today.

Afbeeldingslocatie: https://tweakers.net/i/6Vo6NGXhZDh92lSmjs6Dhn0wn8c=/800x/filters:strip_icc():strip_exif()/f/image/qBEEJv94sEKOG0Pac55mnMPc.jpg?f=fotoalbum_large

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk I also make sometimes typo's, in the config the setting must be:

code:
1
run_unendless = True


You can also log all the values in the solis.log file, by changing lines 451 to 453:
From:
code:
1
2
3
if logging.DEBUG >= logging.root.level:
                debug_string = f"date={today_yyymmdd}, time={current_time}, energy_generation={energy_generation}, solar_power={solar_power}, battery_power={battery_power}, battery_soc={battery_soc}, grid_power={grid_power}, family_load={family_load}, home_consumption={home_consumption}, inverter_temperature={inverter_temperature}, dc_voltage={dc_voltage}, ac_voltage={ac_voltage}"  # noqa
                logging.debug(debug_string)


Into:

code:
1
2
            debug_string = f"date={today_yyymmdd}, time={current_time}, energy_generation={energy_generation}, solar_power={solar_power}, battery_power={battery_power}, battery_soc={battery_soc}, grid_power={grid_power}, family_load={family_load}, home_consumption={home_consumption}, inverter_temperature={inverter_temperature}, dc_voltage={dc_voltage}, ac_voltage={ac_voltage}"  # noqa
            print(debug_string)


Note that the "if" is removed and the indentation is 4 spaces less, logging.debug is changed into print and should align with the previous line:
code:
1
            current_time = datetime_current.strftime("%H:%M")


At least you can look at all the values got from SolisCloud, even afterwards, although not in PVOutput.

Acties:
  • 0 Henk 'm!

  • oldman2uk
  • Registratie: December 2024
  • Laatst online: 07:42
ZuinigeRijder schreef op woensdag 18 december 2024 @ 09:16:

code:
1
            current_time = datetime_current.strftime("%H:%M")


At least you can look at all the values got from SolisCloud, even afterwards, although not in PVOutput.
Where does this last line go? in a file or?

I now have enough commands and notes from here to start a book ;)

This task has become all consuming and with Christmas just days away I need to get stuff done as I expect do you, so I am going to thank you yet again _/-\o_ and back up what I have, then put it to one side for the holiday before I go any deeper into this black hole ;)

Acties:
  • 0 Henk 'm!

  • ZuinigeRijder
  • Registratie: Oktober 2009
  • Niet online
@oldman2uk Editing soliscloud_to_pvoutput.py, changing line 451 to 453. On line 450 you will find the line starting with current_time.
Pagina: 1 2 3 Laatste