GithubHelp home page GithubHelp logo

Comments (78)

robmit68 avatar robmit68 commented on July 17, 2024

Hello i had made some adjustments to the run command now i am getting the ERROR:solaredge:Unhandled exception: int too large to convert to float
Expecting for your response
I appreciated, thank you

Roberto

Capture from the cli
pi@gen-raspi-node05:~/Solaredge-influxdb $ python3 ./solaredge.py solaredge --influxdb 192.168.1.134 --influxport 8086
/usr/local/lib/python3.6/site-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb 192.168.1.134 on port 8086
ERROR:solaredge:Unhandled exception: int too large to convert to float
ERROR:solaredge:Unhandled exception: int too large to convert to float
ERROR:solaredge:Unhandled exception: int too large to convert to float
ERROR:solaredge:Unhandled exception: int too large to convert to float
^CTraceback (most recent call last):
File "./solaredge.py", line 126, in
asyncio.get_event_loop().run_until_complete(write_to_influx(args.influxdb, args.influxport))
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 454, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 421, in run_forever
self._run_once()
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 1390, in _run_once
event_list = self._selector.select(timeout)
File "/usr/local/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt

from solaredge-influxdb.

salberin avatar salberin commented on July 17, 2024

Hi! Sorry for the late reply, I seem to have missed your issue. I'll try and have a look at this as soon as possible.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

salberin avatar salberin commented on July 17, 2024

Can you please re-run the command with the -d flag? This will give some more debugging output. Also, what inverter are you using? I wrote this against an SE7K.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

salberin avatar salberin commented on July 17, 2024

DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 0.0, 'AC Current phase A': 0.0, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 0.0, 'AC Lifetimeproduction': 172831539.2, 'DC Current': 0.0, 'DC Voltage': 65535.0, 'DC Power input': 0.0}, 'time': '2019-10-18T04:09:13.542391+00:00'}

The 6553.5 values shown about indicate that the decode is overflowing. This means that the values I read from the inverter are larger that what has been allocated to store them with. I have no idea why that is the case, especially without access to that specific inverter.
The lifetimeproduction value also seems quite large. I get the feeling that in this inverters case information is read offset 1 byte left or right, causing all calculations to go wrong and report the wrong values.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

salberin avatar salberin commented on July 17, 2024

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

Hello Sander,
any news with resolving this issue, please advise
Regards

Robe

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Hi, i've got the same problem.
I'm new to github.

Started counting bits with help of
https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note.pdf

And changed a view dataskips
Row 63 from 24 to 22
Row 68 from 2 to 4
Row 70 from -2 to -4

And things started working

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos
I did the same and follow you changes and i got it sort of working for most parts with the exception of the following items below, i am not sure if the counting bits are correct for all of them to be the same or it will need a separate count.
Let me know if you were able to check that please. i am new in python as well.

40073 AC Current phase A i get a readout (working)
40074 AC Current phase B i get 655.35 (i believe they are not correct)
40075 AC Current phase C i get 655.35 (i believe they are not correct)

40080 AC Voltage phase A i get 6553.5 (i believe they are not correct)
40081 AC Voltage phase B i get 6553.5 (i believe they are not correct)
40082 AC Voltage phase C i get 6553.5 (i believe they are not correct)

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

robmit68
Do you have the same device?
I've made a copy of my setup, so you can check.

solaredge.txt

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i have a Solar Edge Model SE7600H-US with 28 panels.
I have copied your solaredge.txt file into the solaredge,py, but unfortunately i am getting the following error below:

pi@gen-raspi-node05:~ $ python3.7 ~/Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
File "/home/pi/Solaredge-influxdb/solaredge.py", line 47
global client
^
IndentationError: unexpected unindent

please advise.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i saw you repeated some of the commands in your solaredge.txt but in essence is the same file just the extension but content same.

below the output with -d on the command

pi@gen-raspi-node05:~ $ python3.7 ~/Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb gen-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 31.38, 'AC Current phase A': 31.38, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 7559.0, 'AC Lifetimeproduction': 17148040.0, 'DC Current': 17.76, 'DC Voltage': 432.0, 'DC Power input': 7674.0}, 'time': '2020-05-19T19:50:15.669939+00:00'}
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 31.42, 'AC Current phase A': 31.42, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 7580.0, 'AC Lifetimeproduction': 17148052.0, 'DC Current': 17.86, 'DC Voltage': 430.8, 'DC Power input': 7696.0}, 'time': '2020-05-19T19:50:20.760077+00:00'}
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 31.4, 'AC Current phase A': 31.4, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 7559.0, 'AC Lifetimeproduction': 17148064.0, 'DC Current': 17.78, 'DC Voltage': 431.5, 'DC Power input': 7674.0}, 'time': '2020-05-19T19:50:25.814734+00:00'}
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 31.44, 'AC Current phase A': 31.44, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 7576.0, 'AC Lifetimeproduction': 17148074.0, 'DC Current': 17.89, 'DC Voltage': 429.9, 'DC Power input': 7691.0}, 'time': '2020-05-19T19:50:30.890472+00:00'}
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 31.49, 'AC Current phase A': 31.49, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 7594.0, 'AC Lifetimeproduction': 17148084.0, 'DC Current': 17.96, 'DC Voltage': 429.4, 'DC Power input': 7710.0}, 'time': '2020-05-19T19:50:36.021059+00:00'}

below the ones are failing to provide output

40074 AC Current phase B i get 655.35 (i believe they are not correct)
40075 AC Current phase C i get 655.35 (i believe they are not correct)

40080 AC Voltage phase A i get 6553.5 (i believe they are not correct)
40081 AC Voltage phase B i get 6553.5 (i believe they are not correct)
40082 AC Voltage phase C i get 6553.5 (i believe they are not correct)

Let me know

Thank you.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i repeated most of the commands line by line in your solaredge.txt almost there except with the other registers 40074, 40075, 40080, 40081 and 40082 which still not reporting correctly.

Attached my solaredge file
solaredge.txt

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68,

If i'm correct you're skipping the AC Current and Voltage part of my code. For each fase. That means that there's a shift in the byts. That's messing things up.

If you want to skip a datapoint. You need to replace this with:
data.skip_bytes(2)
For 16bit

Or
data.skip_bytes(4)
For 32bit

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Absolutely not trying to skip AC Current and Voltage those items are part in my script, When i try to compare your text file with mine i discovered #Register 40072-40075; 40080-40082 and 40084 are repeating after 40084 let me know if that's required to get successful readouts without shifting bytes.
Please advise thank you. I appreciate the help

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
No problem, i'm reading to fast.

I've made a better copy of my file. So the syntax should check out.
I will try to run your file later today. Lets check if i can recreate the problem.

solaredge.py.txt

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
Now its getting complicated. Both files work at my end...
Could you try port 1502 instead of 502? By adding --port 1502
My solaredge uses this port.

My readout from my setup:
'AC Total Current': -1900.0,
'AC Current phase A': -630.0,
'AC Current phase B': -638.0,
'AC Current phase C': -628.0,
'AC Voltage phase A': 235.8,
'AC Voltage phase B': 232.9,
'AC Voltage phase C': 238.7,
'AC Power output': 2227.0,
'AC Lifetimeproduction': 5402255.0,
'DC Current': 3.02,
'DC Voltage': 747.8,
'DC Power input': 2260.9},
'time': '2020-05-21T06:10:06.248381+00:00'}

And from your file
'AC Total Current': -1870.0,
'AC Current phase A': -622.0,
'AC Current phase B': -622.0,
'AC Current phase C': -624.0,
'AC Voltage phase A': 233.8,
'AC Voltage phase B': 233.4,
'AC Voltage phase C': 239.2,
'AC Power output': 2196.0,
'AC Lifetimeproduction': 5402225.0,
'DC Current': 2.98,
'DC Voltage': 747.5,
'DC Power input': 2229.4},
'time': '2020-05-21T06:09:18.522491+00:00

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
my unit modbus port its 502, below results from your file and mine:
Regards

Your file (i copied as it was send on the attachment)
pi@gen-raspi-node05:~/Solaredge-influxdb $ python3.7 /Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
File "/home/pi/Solaredge-influxdb/solaredge.py", line 47
global client
^
IndentationError: unexpected unindent
pi@gen-raspi-node05:
/Solaredge-influxdb $ python3.7 /Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
File "/home/pi/Solaredge-influxdb/solaredge.py", line 47
global client
^
IndentationError: unexpected unindent
pi@gen-raspi-node05:
/Solaredge-influxdb $ python3.7 ~/Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
File "/home/pi/Solaredge-influxdb/solaredge.py", line 47
global client
^
IndentationError: unexpected unindent

My File
pi@gen-raspi-node05:~/Solaredge-influxdb $ python3.7 ~/Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb gen-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running event
solaredge py txt file sent by you
loop
INFO:solaredge:Database opened and initialized
0.01
INFO:solaredge:40072
INFO:solaredge:40073
INFO:solaredge:40074
INFO:solaredge:40075
INFO:solaredge:40080
INFO:solaredge:40081
INFO:solaredge:40082
INFO:solaredge:40084
INFO:solaredge:40094
INFO:solaredge:40097
INFO:solaredge:40099
INFO:solaredge:40101
INFO:solaredge:40108
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': 28.63, 'AC Current phase A': 28.63, 'AC Current phase B': 655.35, 'AC Current phase C': 655.35, 'AC Voltage phase A': 6553.5, 'AC Voltage phase B': 6553.5, 'AC Voltage phase C': 6553.5, 'AC Power output': 6896.0, 'AC Lifetimeproduction': 17247268.0, 'DC Current': 18.25, 'DC Voltage': 383.6, 'DC Power input': 7002.0, 'Operating State': 0.0}, 'time': '2020-05-21T19:26:09.319093+00:00'}

Attached you will find the file i copy from your last email i copied and run it on my solaredge device in port 502

i am highlighting the duplicates on the file, perhaps the file gets tampered on github i am not sure??
Thank you looking forward to get this resolve.

Thank you Agsain

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

robmit68
Hmm,
My file has a part that doubles for some reason. My bad i guess...
solaredge.py.txt

Your inverter isn't the same as mine. Mine uses the SunSpec modbus settings.
Read: https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note.pdf

Can you update the firmware or something. Or is your device older? In that case the Original code from salberin should work...

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
No problem i was going crazy with the file but no worries, any how let me provide the details of my solaredge PV unit below

SolarEdge SU7600H-US Single Phase Inverter, would that be i don't have phase B and C? i am so new to this with little electrical experience. PV was installed sometime late October 2018 and its running CPU: 3.2221, i saw they have 3.2225 but at this point will be trivial to upgraded.
I am using SunSpec TCP/IP Modbus protocol.

I can possibly remove some of the AC Phase B/C to no provide the wrong readings, let me know

Regards

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
can you also help me to reconcile my solaredge.py with the correct bytes as per your comments on our communication before, let me know and help me understand the bytes read

for example in a single phase Solaredge solaredge.py file how would i start counting this bytes so i can get accurate reads from my meter and go forward from there to a successful reads, please advise.

---Commnets----
If you want to skip a datapoint. You need to replace this with:
data.skip_bytes(2)
For 16bit

Or
data.skip_bytes(4)
For 32bit

Snip sample
# Register 40072-40075
datapoint['fields']['AC Total Current'] = trunc_float(data.decode_16bit_uint() * scalefactor)
datapoint['fields']['AC Current phase A'] = trunc_float(data.decode_16bit_uint() * scalefactor)
datapoint['fields']['AC Current phase B'] = trunc_float(data.decode_16bit_uint() * scalefactor) # Needed if 3phase Current
datapoint['fields']['AC Current phase C'] = trunc_float(data.decode_16bit_uint() * scalefactor) # Needed if 3phase Current
data.skip_bytes(14) # whats this means in reference to the read
scalefactor = 10**data.decode_16bit_int()
data.skip_bytes(-8) # whats does means in reference to the read
logger.info('40072')
logger.info('40073')
logger.info('40074')
logger.info('40075')

Thank you for your patient

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

robmit68
Here is a test file. It wil readout al datapoints and write it to influx.

The first datapoint 'Sunspec ID' should be a 101 (Single fase)
The second datapoint 'Sunspec Length' Should be 50

Please test
solaredge-test.py.txt

My readout of the file:
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'SunSpec ID': 103.0, 'Sunspec Length': 50.0, 'AC Current': 380.0, 'AC Current A': 127.0, 'AC Current B': 125.0, 'AC Current C': 128.0, 'AC Current SF': 65534.0, 'AC Voltage AB': 4027.0, 'AC Voltage BC': 4036.0, 'AC Voltage CA': 4070.0, 'AC Voltage AN': 2354.0, 'AC Voltage BN': 2306.0, 'AC Voltage CN': 2343.0, 'AC Voltage SF': 65535.0, 'AC Power output': 7460.0, 'AC Power SF': 65535.0, 'AC Frequency': 5001.0, 'AC Frequency SF': 65534.0, 'AC VA': 8892.0, 'AC VA SF': 65535.0, 'AC VAR': 60696.0, 'AC VAR SF': 65535.0, 'AC PF': -8381.0, 'AC PF SF': 65534.0, 'AC Energy Wh': 5588409.0, 'AC Energy Wh SF': 0.0, 'DC Current': 10133.0, 'DC Current SF': 4294712625.0, 'DC Voltage': 65535.0, 'DC Voltage SF': 7573.0, 'DC Power input': -1.0, 'DC Power SF': -32768.0, 'Temp Sink': 4517.0, 'Temp SF': -32768.0, 'Status': -32768.0, 'Status Vendor': -2.0}, 'time': '2020-05-23T17:27:26.945183+00:00'}

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
great file i am seeing the difference on the script, i appreciated the effort, below my result.
I am using your file now to get my readouts.
The first datapoint 'Sunspec ID' is 102 (is that correct?) (split phase according to DID)
The second datapoint 'Sunspec Length' is 50

My readout of your File:
pi@gen-raspi-node05:~ $ python3.7 ~/Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 --port 502 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb gen-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[102, 50, 2853, 2853, 65535, 65535, 65534, 2434, 65535, 65535, 65535, 65535, 65535, 65535, 6937, 0, 5999, 65534, 6952, 0, 4642, 65535, 9977, 65534, 264, 46852, 0, 18186, 65533, 3872, 65535, 7042, 0, 32768, 7054, 32768, 32768, 65534]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'SunSpec ID': 102.0, 'Sunspec Length': 50.0, 'AC Current': 2853.0, 'AC Current A': 2853.0, 'AC Current B': 65535.0, 'AC Current C': 65535.0, 'AC Current SF': 65534.0, 'AC Voltage AB': 2434.0, 'AC Voltage BC': 65535.0, 'AC Voltage CA': 65535.0, 'AC Voltage AN': 65535.0, 'AC Voltage BN': 65535.0, 'AC Voltage CN': 65535.0, 'AC Voltage SF': 65535.0, 'AC Power output': 6937.0, 'AC Power SF': 0.0, 'AC Frequency': 5999.0, 'AC Frequency SF': 65534.0, 'AC VA': 6952.0, 'AC VA SF': 0.0, 'AC VAR': 4642.0, 'AC VAR SF': 65535.0, 'AC PF': 9977.0, 'AC PF SF': 65534.0, 'AC Energy Wh': 17348356.0, 'AC Energy Wh SF': 0.0, 'DC Current': 18186.0, 'DC Current SF': 4294774560.0, 'DC Voltage': 65535.0, 'DC Voltage SF': 7042.0, 'DC Power input': 0.0, 'DC Power SF': -32768.0, 'Temp Sink': 7054.0, 'Temp SF': -32768.0, 'Status': -32768.0, 'Status Vendor': -2.0}, 'time': '2020-05-23T19:26:44.641207+00:00'}

Again thank you for your help. Please advise

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit

Let's look at your question again.

Below the ones are failing to provide output
40074 AC Current phase B i get 655.35 (i believe they are not correct)
40075 AC Current phase C i get 655.35 (i believe they are not correct)
40080 AC Voltage phase A i get 6553.5 (i believe they are not correct)
40081 AC Voltage phase B i get 6553.5 (i believe they are not correct)
40082 AC Voltage phase C i get 6553.5 (i believe they are not correct)

Current phase B and C, and Voltage B and C aren't failing. They don't exist because it's single fase

Voltage phase A is incorrect. Judging your data. Voltage AN is blank. It looks like the N wire isn't attaged. You do have a reading on Voltage AB. Maybe that's the split fase part.

So i created a file that doesn't read the B and C phases. And registers Voltage AB. Please test.
solaredge-splitfase.py.txt

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i have tried the the new file, below the results, there is an unhandled exception.
Please advise

Thank you.

pi@gen-raspi-node05:~ $ python3.7 ~/Solaredge-influxdb/solaredge.py solaredge --influxdb gen-raspi-master01 --influxport 8086 -d
/home/pi/.local/lib/python3.7/site-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb gen-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[102, 50, 106, 106, 65535, 65535, 65534, 2395, 65535, 65535, 65535, 65535, 65535, 65535, 8818, 65534, 6001, 65534, 25388, 65534, 23808, 65534, 3473, 65534, 265, 54346, 0, 23471, 65531, 3814, 65535, 8952, 65534, 32768, 4233, 32768, 32768, 65534]
-2
ERROR:solaredge:Unhandled exception: skip_bytes() missing 1 required positional argument: 'nbytes'
[102, 50, 107, 107, 65535, 65535, 65534, 2396, 65535, 65535, 65535, 65535, 65535, 65535, 8823, 65534, 6000, 65534, 25835, 65534, 24282, 65534, 3415, 65534, 265, 54346, 0, 23484, 65531, 3814, 65535, 8957, 65534, 32768, 4233, 32768, 32768, 65534]
-2
ERROR:solaredge:Unhandled exception: skip_bytes() missing 1 required positional argument: 'nbytes'
ERROR:solaredge:Send or receive error!
[102, 50, 104, 104, 65535, 65535, 65534, 2396, 65535, 65535, 65535, 65535, 65535, 65535, 8802, 65534, 5999, 65534, 24991, 65534, 23390, 65534, 3521, 65534, 265, 54346, 0, 23417, 65531, 3816, 65535, 8936, 65534, 32768, 4234, 32768, 32768, 65534]
-2
ERROR:solaredge:Unhandled exception: skip_bytes() missing 1 required positional argument: 'nbytes'

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Sorry, wrong file version
solaredge-splitfase.py.txt

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
I am seeing the results in my panel, thank you, the file is working as it should. Thank you so much for the assistance.
In the future i will add a meter to check power production and consumption, hopefully i can make it work. You have been great support and resourceful. i appreciated.
Regards.

[102, 50, 2702, 2702, 65535, 65535, 65534, 2421, 65535, 65535, 65535, 65535, 65535, 65535, 6526, 0, 5997, 65534, 6541, 0, 4540, 65535, 9975, 65534, 266, 22512, 0, 17198, 65533, 3852, 65535, 6625, 0, 32768, 7501, 32768, 32768, 65534]
INFO:solaredge:40077
INFO:solaredge:40080
INFO:solaredge:40084
INFO:solaredge:40094
INFO:solaredge:40097
INFO:solaredge:40099
INFO:solaredge:40101
INFO:solaredge:40108

DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': -5404.0, 'AC Voltage phase AB': 242.1, 'AC Power output': 6526.0, 'AC Lifetimeproduction': 17455088.0, 'DC Current': 17.2, 'DC Voltage': 385.2, 'DC Power input': 6625.0}, 'time': '2020-05-25T20:14:32.534599+00:00'}

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Is there any way to read the energy today, this month and the year. i already get the AC lifetime Energy Production. Please advise. I appriciated
IMG_7734

Thank you

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68

Great.

I'm using grafana for that part.

Grafana

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Great i am using grafana too, but i am not getting the day, month and year charts or single stats. can you provide me feedback on how to accomplished? that i saw the picture is that the monthly graph is good? Thank you.
Regards

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
This is the month chart. You can see my settings in the picture. It uses last() difference()

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
got it now, how can you calculate energy produce today, is that a formula can you share please
Thank you

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
You mean like a single stat? Same formula, different relative time.
Grafana

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i was looking onto your settings and the ones you send me for the grafana, but i am afraid i am not getting the same or close readout from the python scripts at least on the current power and energy today, perhaps something i missed. I am sending you the pictures taken at the same time for comparison. Lifetime energy is on the money.
I appreciate the help

Capture of grafana readings
Capture of solaredge readings from app

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68

The python data is correct. So it must be the calculations by grafana. I have a view questions. The letters of the question matches the letters in the picture

A. Current Power seems low. It should be 550W. Thats strange because the graph 'FNC Solar Current Power' is correct. See point E.
B. This seems correct.
C. This is incorrect. But next month is should be correct.
D. This seems correct.
E. This is about 500W. So this reading is the current power.
F. This total is wrong and doesn't say mutch. Why do you want to know this?
G. What is the formula of this one? It looks like the the sum of the current power reading. What are you trying to accomplisch?
H. It's a strange number, should be around 2A. But in my installation i'm also getting a negative reading and a strange number. So i'm not using it.
I. Voltage is in V
J, Power output is in W. It looks like the correct current Power...
K. Seems correct. I think your vertical axis is set on kWh. It needs to be Wh.

Grafana

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
Thanks to your Current reading i've found an typo in my own file
Line 44, the first scalefactor is missing its 10**
It had to be: scalefactor = 10**data.decode_16bit_int()

Like al the others. Please correct

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i corrected all the errors you pointed out on my grafana, thank you i appreciated so much all your efforts, i can say i am getting the correct information thanks to you.
i have updated the 10** scale factor as you pointed out
Can i get some help on the Energy Billing Cycle graph (solaredge dashboard pic sent earlier), to be precise my power utility company bills me every two months, periods are January 6, 2020; March 5, 2020; May 4, 2020; July 02, 2020; September 01, 2020 and November 02, 2020 for a full year 2020 i would like to calculate that as well like my dashboard in SolarEdge.

Thank you very much in advance

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
Glad i could help.
I don't know if and how you could setup a specific timerange in grafana. The best option is to drop the question in a forum for grafana.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Thank you i will let them know, anyhow is there a way to correct this graph is kind of off looking at the time in the operational day, please advise.
FNC Solar Energy Today Graph
FNC Solar Energy Today Graph detail
FNC Solar Energy Today Graph visual

Thank you

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
Set the Y-axis on Wh instead of KWh.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Thank you now it is set and working. I appreciated your time and effort.
Regards

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
You're welcome. It was fun to do.
Regards

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit68
Its a slave meter. So the address shifts.
Meters base address:
 1st meter – 40000 + 121
 2nd meter – 40000 + 295
 3rd meter – 40000 + 469

Your script starts at:
reg_block = client.read_holding_registers(40069, 38)

You could try to run a second script that starts at
reg_block = client.read_holding_registers(40190, 38)

The WattNode is a threefase device? Then use my threefase file:
solaredge.py (1).txt

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

Jaaphoenderdos,
Correct The Watt Node it is an slave meter on the MODBUS.

Watt Node is a three phase meter but i am running an split phase in my SolarEdge as you can see to attached solaredge.py which in fact you help me a lot to get it perfect - for that i appriciated.

I had tried to rewrite the test file into a wattnode.py.txt, with the correct registers 40190, 38 but i am getting errors i am sending you the file as well.

error
pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/wattnode.py solaredge.futurenetwork.local --influxdb influxdb --influxport 8086 -d
File "Solaredge-influxdb/wattnode.py", line 110
datapoint['time'] = str(datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).isoformat())
^
SyntaxError: invalid syntax

At Last i would like to integrate it both of them into a single script if possible (Solaredge + Watt Node Meter)

Thank you for the help.

solaredge.py.txt
wattnode.py.txt

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

robmit68
Hmm, i don't unsterstand why you've got a syntax error.

Maybe its the length of the holding register. In your wattnode are many data point. How did you created them?
Try
reg_block = client.read_holding_registers(40190, 68)

Some other test options

  • Stop the soleredge script when testing the wattnode
  • remove the datapoint time for now. For testing we need the logging data. So we can see if we're on the right track.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

Jaaphoenderdos,
Syntax errors comes after place a # or remove line from the script and it complains line after line.
i did run again solaredge-test.py without no problems

The Wattnode data points i used that from the SolardEdge MODBUS 40190 + 121 meter one

i did change the reg_block to (40190, 68) but not luck

Let me look into the watnode registers and past them on a file later

Thank you

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Okay,
If you use the solaredge test file and only change the reg_block it runs without problems. Then you have a readout of the registers. The script printsout the regblock. Something like:
[102, 50, 2702, 2702, 65535, 65535, 65534, 2421, 65535, 65535, 65535, 65535, 65535, 65535, 6526, 0, 5997, 65534, 6541, 0, 4540, 65535, 9975, 65534, 266, 22512, 0, 17198, 65533, 3852, 65535, 6625, 0, 32768, 7501, 32768, 32768, 65534]

Did you get this type of printout and does it contain any data? Could you share?

If there is data, we could check if we're on the right track.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
I run the test with and change the reg_block to (40190, 68) and i got results as you expected. We are on the right track. I am sharing that dat below
Regards

pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/solaredge-test.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[0, 0, 0, 0, 65535, 11996, 11996, 12003, 0, 14928, 20784, 12003, 11996, 65534, 6001, 65534, 1186, 478, 707, 0, 0, 1187, 479, 707, 0, 0, 65485, 65500, 65522, 0, 0, 55552, 55566, 55539, 0, 65534, 0, 25017, 0, 10141, 0, 15458, 0, 0, 0, 46810, 0, 28579, 0, 18813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'SunSpec ID': 0.0, 'Sunspec Length': 0.0, 'AC Current': 0.0, 'AC Current A': 0.0, 'AC Current B': 65535.0, 'AC Current C': 11996.0, 'AC Current SF': 11996.0, 'AC Voltage AB': 12003.0, 'AC Voltage BC': 0.0, 'AC Voltage CA': 14928.0, 'AC Voltage AN': 20784.0, 'AC Voltage BN': 12003.0, 'AC Voltage CN': 11996.0, 'AC Voltage SF': 65534.0, 'AC Power output': 6001.0, 'AC Power SF': 65534.0, 'AC Frequency': 1186.0, 'AC Frequency SF': 478.0, 'AC VA': 707.0, 'AC VA SF': 0.0, 'AC VAR': 0.0, 'AC VAR SF': 1187.0, 'AC PF': 479.0, 'AC PF SF': 707.0, 'AC Energy Wh': 0.0, 'AC Energy Wh SF': 65485.0, 'DC Current': -36.0, 'DC Current SF': 4294049792.0, 'DC Voltage': 0.0, 'DC Voltage SF': 55552.0, 'DC Power input': -9970.0, 'DC Power SF': -9997.0, 'Temp Sink': 0.0, 'Temp SF': -2.0, 'Status': 0.0, 'Status Vendor': 25017.0}, 'time': '2020-07-15T20:33:51.827550+00:00'}

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit
Nice. Data. Problem is that i can't tell what is what...

The Wattnode modbus uses 32 bit registers. So maybe one of the testfiles makes sense of the data. According to https://ctlsys.com/wp-content/uploads/2016/10/WNC-MODBUS-Manual-V16.pdf

wattnode-test-2.py.txt
wattnode-test.py.txt

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Below you will find the collected data on each of the test wattnode files. thank you for your support.
Regards

Data test for the wattnode-test.py

pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/wattnode-test.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[27, 20, 6, 0, 65535, 11996, 11996, 12057, 0, 14961, 20831, 12057, 11996, 65534, 6026, 65534, 65233, 65293, 65476, 0, 0, 321, 250, 76, 0, 0, 65431, 65478, 65490, 0, 0, 8802, 9725, 7879, 0, 65534, 0, 33027, 0, 13370, 0, 20367, 0, 0, 0, 57754, 0, 35477, 0, 22987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M EnergySum': 1769492.0, 'M EnergyPosSum': 393216.0, 'M EnergySumNR': 4294913756.0, 'M EnergyPosSumNR': 786181913.0, 'M PowerSum': 14961.0, 'M PowerA': 1365192473.0, 'M PowerB': 786235390.0, 'M PowerC': 394985470.0, 'M VoltAvgLN': 4275175181.0, 'M VoltA': 4291035136.0, 'M VoltB': 321.0, 'M VoltC': 16384076.0, 'M VoltAvgLL': 0.0, 'M VoltAB': 4288151494.0, 'M VoltBC': 4291952640.0, 'M VoltAC': 8802.0, 'M Freq': 637345479.0, 'M Backup1': 65534.0, 'M Backup2': 33027.0, 'M Backup3': 13370.0, 'M Backup4': 20367.0}, 'time': '2020-07-17T02:32:50.038344+00:00'}
[27, 21, 6, 0, 65535, 11996, 11996, 11985, 0, 14916, 20768, 11985, 11996, 65534, 6001, 65534, 65231, 65290, 65477, 0, 0, 323, 253, 76, 0, 0, 65431, 65478, 65489, 0, 0, 8772, 9731, 7814, 0, 65534, 0, 33027, 0, 13370, 0, 20367, 0, 0, 0, 57755, 0, 35478, 0, 22987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M EnergySum': 1769493.0, 'M EnergyPosSum': 393216.0, 'M EnergySumNR': 4294913756.0, 'M EnergyPosSumNR': 786181841.0, 'M PowerSum': 14916.0, 'M PowerA': 1361063633.0, 'M PowerB': 786235390.0, 'M PowerC': 393347070.0, 'M VoltAvgLN': 4275044106.0, 'M VoltA': 4291100672.0, 'M VoltB': 323.0, 'M VoltC': 16580684.0, 'M VoltAvgLL': 0.0, 'M VoltAB': 4288151494.0, 'M VoltBC': 4291887104.0, 'M VoltAC': 8772.0, 'M Freq': 637738630.0, 'M Backup1': 65534.0, 'M Backup2': 33027.0, 'M Backup3': 13370.0, 'M Backup4': 20367.0}, 'time': '2020-07-17T02:32:55.159444+00:00'}

Data test for wattnode-test2.py

pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/wattnode-test-2.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[28, 22, 6, 0, 65535, 11996, 11996, 11985, 0, 14916, 20768, 11985, 11996, 65534, 6001, 65534, 65227, 65279, 65485, 0, 0, 326, 263, 70, 0, 0, 65430, 65478, 65488, 0, 0, 8732, 9760, 7704, 0, 65534, 0, 33027, 0, 13370, 0, 20367, 0, 0, 0, 57767, 0, 35488, 0, 22989, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M EnergySum': 469767680.0, 'M EnergyPosSum': 100663551.0, 'M EnergySumNR': 4281261102.0, 'M EnergyPosSumNR': 3694055680.0, 'M PowerSum': 3818577.0, 'M PowerA': 539939118.0, 'M PowerB': 3707764247.0, 'M PowerC': 1912602366.0, 'M VoltAvgLN': 3422486527.0, 'M VoltA': 3439329280.0, 'M VoltB': 83457.0, 'M VoltC': 117458432.0, 'M VoltAvgLL': 255.0, 'M VoltAB': 2533345023.0, 'M VoltBC': 3489660928.0, 'M VoltAC': 2235430.0, 'M Freq': 538843136.0, 'M Backup1': 16776704.0, 'M Backup2': 8454912.0, 'M Backup3': 3422720.0, 'M Backup4': 5213952.0}, 'time': '2020-07-17T02:35:23.451098+00:00'}
[28, 22, 6, 0, 65535, 11996, 11996, 11985, 0, 14916, 20768, 11985, 11996, 65534, 6001, 65534, 65218, 65277, 65478, 0, 0, 335, 266, 75, 0, 0, 65430, 65478, 65488, 0, 0, 8732, 9760, 7704, 0, 65534, 0, 33027, 0, 13370, 0, 20367, 0, 0, 0, 57767, 0, 35488, 0, 22989, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M EnergySum': 469767680.0, 'M EnergyPosSum': 100663551.0, 'M EnergySumNR': 4281261102.0, 'M EnergyPosSumNR': 3694055680.0, 'M PowerSum': 3818577.0, 'M PowerA': 539939118.0, 'M PowerB': 3707764247.0, 'M PowerC': 1912602366.0, 'M VoltAvgLN': 3271491071.0, 'M VoltA': 3321888768.0, 'M VoltB': 85761.0, 'M VoltC': 167791360.0, 'M VoltAvgLL': 255.0, 'M VoltAB': 2533345023.0, 'M VoltBC': 3489660928.0, 'M VoltAC': 2235430.0, 'M Freq': 538843136.0, 'M Backup1': 16776704.0, 'M Backup2': 8454912.0, 'M Backup3': 3422720.0, 'M Backup4': 5213952.0}, 'time': '2020-07-17T02:35:28.539518+00:00'}

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Below you will find the attached file i capture to make sense of the data, in advance thank you for your help
Regards
sample data from wattnode files.txt

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit,
The data doesn't make any sense, as far as i can see.

Could you create the data and give the readings in the solaredge app. So we can compare the data.

Then we'll know what to look for.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Below you will find the capture i have done in a modbus poll tcp software, i downloaded from the internet, i am not seeing the data but probably you can make sense if that. let me know if anything
Regards
WattNode Modbus Reading via Modbus Poll Software.xlsx

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Thanks.
Could you send the corresponding data from your solaredge app. So we can compare the data.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Below you will find capture of the data from the solaredge app, thank you for your support
Regards

IMG_7982
IMG_7981
IMG_7980

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit,
I've seen your excel file. It seems like that your columns are correct.

So that means that we have to build one file that can readout both modbus meters.

I've made a first testfile:
solaredge-test-wattnode.py.txt

Please run this file. And make another pull with modbus poll tcp software at the same time. So we can compare.
Run the modbus poll tcp software from 40069 to 40260

If the data from the wattnode is missalignt you could change the skip_byte to correct.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i have run the solaredge-test-wattnode.py.txt file you attached earlier and some how it failed running on line 45
Regards

pi@gen-raspi-node05:~/Solaredge-influxdb $ python3.7 /home/pi/Solaredge-influxdb/solaredge-test-wattnode.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
File "/home/pi/Solaredge-influxdb/solaredge-test-wattnode.py", line 45
datapoint['fields']['Sunspec Length'] = trunc_float(data.decode_16bit_uint() )
^
TabError: inconsistent use of tabs and spaces in indentation

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Above the early statement before, i have run the solaredge-test-wattnode.py.txt file you attached earlier and corrected a syntax error but is hanging without results. below you will see the output and the prompt is flashing without data

i look into influxdb and capture below after stop the working file

Regards

pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/solaredge-test-wattnode.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized

Capture From InfluxDB
1595902517406671000 20151628 83.29 1.05 238.2 0.22 84.56 379.7 1
1595902564338248000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 370921472 2687418158 1526726167 1912602366 3795024 3422552064 2533344511 2159398 255 3288267007 85761 3523215360 251676160 1
1595902569458937000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 370921472 2687418158 1526726167 1912602366 3795024 3523215360 2533344511 2159398 255 3405707775 83969 3523215360 234897920 1
1595902574555485000 16776704 24207872 10039552 14756352 83886335 1513012992 469767936 4281227822 522060288 2687418158 1526726167 1912602366 3795024 3506438144 2550121983 2232358 255 3422485247 83457 3539992576 218120448 1
1595902579649556000 16776704 24207872 10039552 14756352 83886335 1513012992 469767936 4281227822 522060288 2687418158 1526726167 1912602366 3795024 3506438144 2550121983 2232358 255 3422485247 83457 3539992576 218120448 1
1595902584739602000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 438158336 2687418158 1526726167 1912602366 3795024 3489660928 2550121727 2223910 255 3388930559 84225 3539992576 234897920 1
1595902589828904000 16776704 24207872 10039552 14756352 83886335 1194245888 469767936 4281222958 555610368 2418982702 1207959063 1912602366 3792208 3388997632 2550121983 2230566 255 3237934847 86273 3539992576 268453632 1
1595902594912537000 16776704 24207872 10039552 14756352 83886335 1194245888 486545152 4281222958 438178304 2418982702 1207959063 2332032766 3792208 3372220416 2533344255 2233894 255 3154047743 87553 3539992576 352339712 1
1595902600001239000 16776704 24207872 10039552 14756352 83886335 1194245888 469767680 4281222958 287027456 2418982702 1207959063 2332032766 3792208 3355443200 2483012863 2154790 255 3221157887 87041 3489660928 268454400 1
1595902605086174000 16776704 24207872 10039552 14756352 83886335 1194245888 469767680 4281222958 303841792 2418982702 1207959063 1912602366 3792208 3338665984 2483012863 2173478 255 3187603199 87297 3489660928 268454656 1
1595902610214360000 16776704 24207872 10039552 14756352 83886335 1194245888 469767680 4281222958 303841792 2418982702 1207959063 1912602366 3792208 3472883712 2483012863 2173478 255 3338598399 85249 3489660928 268453120 1
1595902615298004000 16776704 24207872 10039552 14756352 100663551 1513012992 486545152 4281227822 303980288 2687418158 1526726167 1912602366 3795024 3355443200 2533344255 2242598 255 3204380415 86785 3539992576 285231104 1
1595902620406916000 16776704 24207872 10039552 14756352 100663551 1513012992 486545152 4281227822 303980288 2687418158 1526726167 1912602366 3795024 3372220416 2533344255 2242598 255 3221157887 86529 3539992576 268453632 1
1595902625490532000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 270422016 2687418158 1526726167 1912602366 3795024 3388997632 2533344255 2240550 255 3254712319 86273 3539992576 268453376 1
1595902638011702000 16776704 24207872 10039552 14756352 83886335 1513008384 469767680 4281227822 454807808 2435755310 1526726167 1912602366 3792208 3472883712 2499790335 2160166 255 3170823679 87553 3489660928 419447808 1
1595902649285262000 16776704 24207872 10039552 14756352 83886335 1831775488 469767936 4281232686 370970112 2704190766 1845493271 2332032766 3795280 3405774848 2499789823 2183718 255 3187602431 87041 3506438144 335562496 1
1595902654394314000 16776704 24207872 10039552 14756352 83886335 1831775488 469767936 4281232686 370970112 2704190766 1845493271 2332032766 3795280 3456106496 2499789823 2183718 255 3305043711 85505 3506438144 285230080 1
1595902659476662000 16776704 24207872 10039552 14756352 83886335 1513008384 486545152 4281227822 203243776 2435755310 1526726167 1912602366 3792208 3422552064 2483012351 2205478 255 3221157119 86785 3523215360 318785024 1
1595902664579997000 16776704 24207872 10039552 14756352 83886335 1513008384 486545152 4281227822 203243776 2435755310 1526726167 1912602366 3792208 3439329280 2483012351 2205478 255 3321821439 85505 3523215360 251675904 1
1595902669667091000 16776704 24207872 10039552 14756352 83886335 1513008384 486545152 4281227822 203243776 2435755310 1526726167 1912602366 3792208 3422552064 2483012351 2205478 255 3221157119 86785 3523215360 318785024 1
1595902680991765000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 253536512 2687418158 1526726167 1912602366 3795024 3439329280 2483012607 2186278 255 3288266751 85761 3506438144 268453376 1
1595902686093584000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 253536512 2687418158 1526726167 1912602366 3795024 3439329280 2483012607 2186278 255 3271489023 86273 3506438144 302007808 1
1595902691186713000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 253536512 2687418158 1526726167 1912602366 3795024 3439329280 2483012607 2186278 255 3271489023 86273 3506438144 302007808 1
1595902698546729000 16776704 24207872 10039552 14756352 83886335 1513012992 469767680 4281227822 253536512 2687418158 1526726167 1912602366 3795024 3422552064 2483012607 2186278 255 3271489279 86017 3506438144 285230848 1
1595903872649901000 20151648 23.12 1.18 238.2 0.06 23.47 379.3 1

You can see stop of my working file and start of my working file in between the test you send me

Regards

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Hmm.

It seems to hang between logger.info('Database opened and initialized') and print(reg_block). Because i don't see a printout of the reg_block.

So reg_block = client.read_holding_registers(40069, 190) must be the culprit...

I'm unable to test things on my own setup until friday. But google is our friend. Maybe it's the read timeout setting that is to short.

In the last lines there's:
client = ModbusClient(args.solaredge, port=args.port, unit_id=args.unitid, auto_open=True)

Try to add a timeout:
client = ModbusClient(args.solaredge, port=args.port, unit_id=args.unitid, auto_open=True, timeout=10)

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

I tried the timeout value but same result no printout and it hangs. I will be reading to see if anything if not I will touch basis till Friday, thank you for your help.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
I was able to get the registers with your help and a modify file you provide me for the test, attached is the file with the script and result gathered from the python script, I am not familiar with the skip bits to each register. I would appreciated your help on that. Looking forward to your input.

I validated at least one register 'M1 AC Frequency': 6001.0, 'M1 AC Frequency SF': -2.0, = 60.01 Hertz

At the end once you help me figure this thing out can we combine the inverter and the meter readings in one file
wattnode-test-fnc-results.txt
?

Thank you

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Nice.
We're getting there. It took some time, but i think this is the way to go.

I've calculated the scalefactor directly in the script. They probebly never change.

So this should work:
Wattnode-test.txt

I've also tested to combine the two files in to one. And hopefully this works to:
Wattnode-solardge-test.txt

The only reading i don't understand is: 'M1 Imported VA SF': -32768.0
This is incorrect.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
i was able to get results on the Wattnode-test.txt file only, below the output, in other hand the combine Wattnode-solardege.txt did not work is the second output result, somehow it runs but it doesn't read registers.
i agree we are very closed to get the information on this devices, thank you for your help
Regards

First Output
pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/Wattnode-test.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[112, 56, 55, 0, 65535, 11866, 11866, 11859, 0, 14757, 20547, 11859, 11866, 65534, 6001, 65534, 64231, 64867, 64900, 0, 0, 1319, 669, 657, 0, 0, 196, 29, 167, 0, 0, 9830, 9990, 9671, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11798, 1, 62948, 1, 17347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.2, 'M1 AC Current A': 5.6, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 118.59, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 147.57, 'M1 AC Voltage A B': 205.47, 'M1 AC Voltage B C': 118.59, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1305.0, 'M1 AC Power A': -669.0, 'M1 AC Power B': -636.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1319.0, 'M1 AC VA A': 669.0, 'M1 AC VA B': 657.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 196.0, 'M1 AC VAR A': 29.0, 'M1 AC VAR B': 167.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.3, 'M1 AC PF A': 99.9, 'M1 AC PF B': 96.71, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208406.0, 'M1 Imported A': 128484.0, 'M1 Imported B': 82883.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:08:29.170286+00:00'}
[112, 57, 55, 0, 65535, 11866, 11866, 11859, 0, 14757, 20547, 11859, 11866, 65534, 6001, 65534, 64223, 64858, 64902, 0, 0, 1327, 678, 656, 0, 0, 192, 26, 166, 0, 0, 9832, 9992, 9673, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11804, 1, 62951, 1, 17351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.2, 'M1 AC Current A': 5.7, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 118.59, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 147.57, 'M1 AC Voltage A B': 205.47, 'M1 AC Voltage B C': 118.59, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1313.0, 'M1 AC Power A': -678.0, 'M1 AC Power B': -634.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1327.0, 'M1 AC VA A': 678.0, 'M1 AC VA B': 656.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 192.0, 'M1 AC VAR A': 26.0, 'M1 AC VAR B': 166.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.32, 'M1 AC PF A': 99.92, 'M1 AC PF B': 96.73, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208412.0, 'M1 Imported A': 128487.0, 'M1 Imported B': 82887.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:08:34.498574+00:00'}
[112, 57, 55, 0, 65535, 11866, 11866, 11859, 0, 14757, 20547, 11859, 11866, 65534, 6001, 65534, 64223, 64857, 64902, 0, 0, 1328, 680, 655, 0, 0, 192, 26, 166, 0, 0, 9832, 9992, 9673, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11804, 1, 62951, 1, 17351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.2, 'M1 AC Current A': 5.7, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 118.59, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 147.57, 'M1 AC Voltage A B': 205.47, 'M1 AC Voltage B C': 118.59, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1313.0, 'M1 AC Power A': -679.0, 'M1 AC Power B': -634.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1328.0, 'M1 AC VA A': 680.0, 'M1 AC VA B': 655.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 192.0, 'M1 AC VAR A': 26.0, 'M1 AC VAR B': 166.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.32, 'M1 AC PF A': 99.92, 'M1 AC PF B': 96.73, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208412.0, 'M1 Imported A': 128487.0, 'M1 Imported B': 82887.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:08:39.721215+00:00'}
[112, 57, 55, 0, 65535, 11866, 11866, 11859, 0, 14757, 20547, 11859, 11866, 65534, 6001, 65534, 64225, 64858, 64904, 0, 0, 1325, 679, 654, 0, 0, 192, 26, 166, 0, 0, 9832, 9992, 9673, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11804, 1, 62951, 1, 17351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.2, 'M1 AC Current A': 5.7, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 118.59, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 147.57, 'M1 AC Voltage A B': 205.47, 'M1 AC Voltage B C': 118.59, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1311.0, 'M1 AC Power A': -678.0, 'M1 AC Power B': -632.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1325.0, 'M1 AC VA A': 679.0, 'M1 AC VA B': 654.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 192.0, 'M1 AC VAR A': 26.0, 'M1 AC VAR B': 166.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.32, 'M1 AC PF A': 99.92, 'M1 AC PF B': 96.73, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208412.0, 'M1 Imported A': 128487.0, 'M1 Imported B': 82887.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:08:45.113640+00:00'}
[112, 57, 55, 0, 65535, 11866, 11866, 11931, 0, 14802, 20609, 11931, 11866, 65534, 6001, 65534, 64222, 64855, 64904, 0, 0, 1330, 682, 655, 0, 0, 204, 31, 172, 0, 0, 9818, 9989, 9648, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11808, 1, 62953, 1, 17353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.2, 'M1 AC Current A': 5.7, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 119.31, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 148.02, 'M1 AC Voltage A B': 206.09, 'M1 AC Voltage B C': 119.31, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1314.0, 'M1 AC Power A': -681.0, 'M1 AC Power B': -632.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1330.0, 'M1 AC VA A': 682.0, 'M1 AC VA B': 655.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 204.0, 'M1 AC VAR A': 31.0, 'M1 AC VAR B': 172.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.18, 'M1 AC PF A': 99.89, 'M1 AC PF B': 96.48, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208416.0, 'M1 Imported A': 128489.0, 'M1 Imported B': 82889.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:08:50.276988+00:00'}
[112, 57, 55, 0, 65535, 11866, 11866, 11931, 0, 14802, 20609, 11931, 11866, 65534, 6001, 65534, 64234, 64868, 64902, 0, 0, 1318, 669, 657, 0, 0, 204, 31, 172, 0, 0, 9818, 9989, 9648, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11808, 1, 62953, 1, 17353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.2, 'M1 AC Current A': 5.7, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 119.31, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 148.02, 'M1 AC Voltage A B': 206.09, 'M1 AC Voltage B C': 119.31, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1302.0, 'M1 AC Power A': -668.0, 'M1 AC Power B': -634.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1318.0, 'M1 AC VA A': 669.0, 'M1 AC VA B': 657.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 204.0, 'M1 AC VAR A': 31.0, 'M1 AC VAR B': 172.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.18, 'M1 AC PF A': 99.89, 'M1 AC PF B': 96.48, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208416.0, 'M1 Imported A': 128489.0, 'M1 Imported B': 82889.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:08:55.560383+00:00'}
[111, 56, 55, 0, 65535, 11866, 11866, 11895, 0, 14780, 20578, 11895, 11866, 65534, 6001, 65534, 64229, 64863, 64902, 0, 0, 1322, 674, 655, 0, 0, 195, 28, 166, 0, 0, 9830, 9990, 9670, 0, 65534, 1, 53321, 0, 49070, 1, 7213, 0, 0, 3, 11812, 1, 62955, 1, 17355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'M1 AC Current': 11.1, 'M1 AC Current A': 5.6, 'M1 AC Current B': 5.5, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.66, 'M1 AC Voltage A N': 118.66, 'M1 AC Voltage B N': 118.95, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 147.8, 'M1 AC Voltage A B': 205.78, 'M1 AC Voltage B C': 118.95, 'M1 AC Voltage C A': 118.66, 'M1 AC Frequency': 60.01, 'M1 AC Power': -1307.0, 'M1 AC Power A': -673.0, 'M1 AC Power B': -634.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1322.0, 'M1 AC VA A': 674.0, 'M1 AC VA B': 655.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': 195.0, 'M1 AC VAR A': 28.0, 'M1 AC VAR B': 166.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': 98.3, 'M1 AC PF A': 99.9, 'M1 AC PF B': 96.7, 'M1 AC PF C': 0.0, 'M1 Exported': 118857.0, 'M1 Exported A': 49070.0, 'M1 Exported B': 72749.0, 'M1 Exported C': 0.0, 'M1 Imported': 208420.0, 'M1 Imported A': 128491.0, 'M1 Imported B': 82891.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T04:09:00.736068+00:00'}

Second Output

pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/Wattnode-solaredge-test.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[102, 50, 0, 0, 65535, 65535, 65534, 2384, 65535, 65535, 65535, 65535, 65535, 65535, 0, 0, 5999, 65534, 0, 0, 0, 0, 10000, 65534, 310, 58888, 0, 0, 0, 0, 65535, 0, 0, 32768, 3849, 32768, 32768, 65534]
-2
ERROR:solaredge:Unhandled exception: skip_bytes() missing 1 required positional argument: 'nbytes'
[102, 50, 0, 0, 65535, 65535, 65534, 2381, 65535, 65535, 65535, 65535, 65535, 65535, 0, 0, 5999, 65534, 0, 0, 0, 0, 10000, 65534, 310, 58888, 0, 0, 0, 0, 65535, 0, 0, 32768, 3849, 32768, 32768, 65534]
-2
ERROR:solaredge:Unhandled exception: skip_bytes() missing 1 required positional argument: 'nbytes'
[102, 50, 0, 0, 65535, 65535, 65534, 2382, 65535, 65535, 65535, 65535, 65535, 65535, 0, 0, 5999, 65534, 0, 0, 0, 0, 10000, 65534, 310, 58888, 0, 0, 0, 0, 65535, 0, 0, 32768, 3848, 32768, 32768, 65534]
-2
ERROR:solaredge:Unhandled exception: skip_bytes() missing 1 required positional argument: 'nbytes'
^CTraceback (most recent call last):
File "Solaredge-influxdb/Wattnode-solaredge-test.py", line 172, in
asyncio.get_event_loop().run_until_complete(write_to_influx(args.influxdb, args.influxport, args.period))
File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
self.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.7/selectors.py", line 468, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Typo....

Wattnode-solardge-test.txt

I'm unable to test these files because i dont have the meter.

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
the last file its working now i am getting readings from the Modbus slave meter thank you very much i appreciated the time and effort.

I notice that the 'AC Total Current': -4994.0 is negative, is that normal?

Now i have to figure it out the formulas and graphs to get the information on Grafana
Thank You.

Results
pi@gen-raspi-node05:~ $ python3.7 Solaredge-influxdb/Wattnode-solaredge-test.py solaredge --influxdb titi-raspi-master01 --influxport 8086 -d
/usr/local/lib/python3.7/dist-packages/aioinflux/compat.py:12: UserWarning: Pandas/Numpy is not available. Support for 'dataframe' mode is disabled.
warnings.warn(no_pandas_warning)
Starting up solaredge monitoring
Connecting to Solaredge inverter solaredge on port 502 using unitid 1
Writing data to influxDb titi-raspi-master01 on port 8086 every 5 seconds
DEBUG:solaredge:Running eventloop
INFO:solaredge:Database opened and initialized
[102, 50, 2497, 2497, 65535, 65535, 65534, 2386, 65535, 65535, 65535, 65535, 65535, 65535, 5948, 0, 5998, 65534, 5960, 0, 3872, 65535, 9978, 65534, 311, 23504, 0, 15885, 65533, 3801, 65535, 6038, 0, 32768, 7616, 32768, 32768, 65534]
[0, 0, 0, 0, 65535, 11885, 11885, 11949, 0, 14825, 20641, 11949, 11885, 65534, 6001, 65534, 1003, 362, 641, 0, 0, 1004, 362, 641, 0, 0, 65506, 65523, 65520, 0, 0, 55542, 55544, 55540, 0, 65534, 1, 56989, 0, 50621, 1, 9414, 0, 0, 3, 18336, 2, 1359, 1, 20024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768]
DEBUG:solaredge:Writing to Influx: {'measurement': 'SolarEdge', 'tags': {'inverter': '1'}, 'fields': {'AC Total Current': -4994.0, 'AC Voltage phase AB': 238.6, 'AC Power output': 5948.0, 'AC Lifetimeproduction': 20405200.0, 'DC Current': 15.88, 'DC Voltage': 380.1, 'DC Power input': 6038.0, 'M1 AC Current': 0.0, 'M1 AC Current A': 0.0, 'M1 AC Current B': 0.0, 'M1 AC Current C': 0.0, 'M1 AC Voltage L N': 118.85, 'M1 AC Voltage A N': 118.85, 'M1 AC Voltage B N': 119.49, 'M1 AC Voltage C N': 0.0, 'M1 AC Voltage L L': 148.25, 'M1 AC Voltage A B': 206.41, 'M1 AC Voltage B C': 119.49, 'M1 AC Voltage C A': 118.85, 'M1 AC Frequency': 60.01, 'M1 AC Power': 1003.0, 'M1 AC Power A': 362.0, 'M1 AC Power B': 641.0, 'M1 AC Power C': 0.0, 'M1 AC VA': 1004.0, 'M1 AC VA A': 362.0, 'M1 AC VA B': 641.0, 'M1 AC VA C': 0.0, 'M1 AC VAR': -30.0, 'M1 AC VAR A': -13.0, 'M1 AC VAR B': -16.0, 'M1 AC VAR C': 0.0, 'M1 AC PF': -99.94, 'M1 AC PF A': -99.92, 'M1 AC PF B': -99.96, 'M1 AC PF C': 0.0, 'M1 Exported': 122525.0, 'M1 Exported A': 50621.0, 'M1 Exported B': 74950.0, 'M1 Exported C': 0.0, 'M1 Imported': 214944.0, 'M1 Imported A': 132431.0, 'M1 Imported B': 85560.0, 'M1 Imported C': 0.0, 'M1 EXported VA': 0.0, 'M1 EXported VA A': 0.0, 'M1 EXported VA B': 0.0, 'M1 EXported VA C': 0.0, 'M1 Imported VA': 0.0, 'M1 Imported VA A': 0.0, 'M1 Imported VA B': 0.0, 'M1 Imported VA C': 0.0}, 'time': '2020-08-02T20:25:48.099387+00:00'}

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Hi,
Nice.
'AC Total Current': -4994.0 looks strange. It's a reading from your solaredge. You could comfirm by using your original script. And check if there is a difference.

If there is a difference. Please send your original script.

your welcome

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
there is a slight difference attached file
Thank you

solaredge.py.txt

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Found it, see:
Wattnode-solardge-test.txt

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
Thank you now all readings are correct, still working on the Grafana graphs to consolidate all new readings, it is awesome and thank you for your help. I appreciate it.

Regards

I would like to pick your brain on some of the register readings and skip bytes I am interested for the experience to help and assist others.

Can you tell me what does mean below statements and how to read them please

            # Register 40072 
            datapoint['fields']['AC Total Current'] = trunc_float(data.decode_16bit_uint() * scalefactor)
            data.skip_bytes(20)
            scalefactor = 10**data.decode_16bit_int()
            data.skip_bytes(-14)

I see register 40072 = AC Total Current,
data.skip_bytes(20) what does it means
data.skip_bytes(-14) what does it means

I would appreciate any help on this so I can learn more of the python coding

Thank You

from solaredge-influxdb.

jaaphoenderdos avatar jaaphoenderdos commented on July 17, 2024

Robmit,
your welcome,

How it works:

We read a part of the modbus, starting at point 40069, readout 38 points:
reg_block = client.read_holding_registers(40069, 38)
print(reg_block)
Your data is:
[102, 50, 2497, 2497, 65535, 65535, 65534, 2386, 65535, 65535, 65535, 65535, 65535, 65535, 5948, 0, 5998, 65534, 5960, 0, 3872, 65535, 9978, 65534, 311, 23504, 0, 15885, 65533, 3801, 65535, 6038, 0, 32768, 7616, 32768, 32768, 65534]

Every number is a set of 2 bytes.

The first number is position 40070 (I know, we've started at 40069, but the readout starts at 40070, i don't know why)

Step 1 is skipping to the reading i want:
data.skip_bytes(12)
Brings us 6 numbers further to position 40076 (65534), this is know as the scalefactor of AC current. So we read it out:
scalefactor = 10**data.decode_16bit_int()
The result is: scalefactor = 0.01
The data decode is 16bit int. And results in a -2.

When we do a data.decode my position automaticly go's to the next position. So my position at this point is 40077.

We need to go back to the reading of the AC current. So.
data.skip_bytes(-10)
Brings us 5 numbers back to position 40072 (2497)
# Register 40072
datapoint['fields']['AC Total Current'] = trunc_float(data.decode_16bit_uint() * scalefactor)
We decode register 40072 and multiply it with the scalefactor. Resulting in 24,97
The result is stored as datapoint in a string.

The proces repeats for every reading.

This proces is needed because my meter has different scalefactors as your meter and this setup works for every solaredge meter. In the wattnode part we've took a shortcut. because you're the only one with a wattnode meter. I've simply put al the scalefactors directly in the readout.

Example:
First we decode the AC Current C. And multiply it with the scalefactor 10**-1
datapoint['fields']['M1 AC Current C'] = trunc_float(data.decode_16bit_int() * 10**-1)
The a skip to bytes, because this is the scalefactor. And i don't need it.
data.skip_bytes(2)
Then i continue with the next datapoint
datapoint['fields']['M1 AC Voltage L N'] = trunc_float(data.decode_16bit_int() * 10**-2)

We could make the solaredge part the same as the wattnode part.

Some points are 32 bit. They use 4 bytes, and 2 numbers. To create a bigger number.

This proces is not really python. It's more ModBus.

Hopefully my story makes any sense.

Regards

from solaredge-influxdb.

robmit68 avatar robmit68 commented on July 17, 2024

jaaphoenderdos,
It is very helpful and now i am reading to understand the details to know
Thank you.

from solaredge-influxdb.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.