Go to navigation
last updated –
posted 2017-Nov-30, 5:45 pm AEST
posted 2017-Nov-30, 5:45 pm AEST
User #792501   2 posts
I'm new here, please be nice
reference: whrl.pl/Re2MxE
posted 2017-Nov-27, 7:13 pm AEST
posted 2017-Nov-27, 7:13 pm AEST
O.P.

Hello,
My first post.. love your work.
After searching for a while I have failed to find any local logging solution for my new SOFAR TL5000 inverter.
So I have been talking with sofar china and have managed to get there modbus protocol information.
I have knocked up this simple python script and have successfully connected to the inverter and received a response.
YAY!
But I suck at decoding byte's...
Can one of you people have a look at the response for me and give me a hand as to what i am seeing..

I send this
01 03 00 00 00 24 45 D1

and receive this :
01 03 48 00 02 00 00 00 00 00 00 00 00 00 00 07 37 00 1a 0d e1 00 22 00 04 00 0c 00 11 00 00 13 8f 09 a4 00 4f 00 00 00 00 00 00 00 00 00 00 00 d5 00 00 00 73 0b 45 03 22 00 20 00 2a 0f 3a 07 37 0d e1 00 3c 00 00 00 01 00 00 cc 49

modbus info :
https://drive.google.com/file/d/0B_B2fQCYwJRiUzFvZXZUZy1ucTNxUVdVYXc5ZW1HRDdYVXZz/view?usp=sharing
python script :
https://drive.google.com/file/d/1Xeu_Dht9Rnrw7UFIIQN0pLxhWmG6VfL5/view?usp=sharing

any help appreciated.
Thanks.

User #46036   29581 posts
Whirlpool Forums Addict
reference: whrl.pl/Re2MZh
posted 2017-Nov-27, 10:19 pm AEST
posted 2017-Nov-27, 10:19 pm AEST

Tried node-red?

Sample flow – https://flows.nodered.org/flow/75a4715fb6a3595057343a92abc493e4

Modify registers to match or add new ones.

User #785096   44 posts
Participant
reference: whrl.pl/Re2NcA
posted 2017-Nov-28, 6:07 am AEST
posted 2017-Nov-28, 6:07 am AEST

Also check out the Solariot project on Github https://github.com/meltaxa/solariot which leverages the pymodbus library. You'll need to work out the modbus register map, which will be based of the inverter address table from that modbus document. To help define the SOFAR map file, refer to the Solariot modbus map files for the SMA Sunnyboy or Sungrow inverters, in particular the SMA file for reading different data types. If you get it working, contribute back to Solaroit with a pull request containing the SOFAR modbus file. Good luck!

User #109674   563 posts
Whirlpool Enthusiast
reference: whrl.pl/Re2O0I
posted 2017-Nov-28, 6:45 pm AEST
posted 2017-Nov-28, 6:45 pm AEST

Hi daviddawe1982,

What are you intending to do with the data you receive – are you also building an application to historise and chart it? Send it to some other service?

I only ask because it looks like you're trying to reinvent the wheel with such low-level communication. Modbus is so ubiquitous and supported in so many applications and libraries which would remove the complexity here. In other words, you shouldn't need to look at the raw bytes and deal with CRC and so on (unless you want to).

If you use an application/library that supports Modbus to do the polling, then all you really need to tell it is that to get the 'active power output' value, poll register number 12 (0x000C in hex) and read an unsigned integer of size two bytes (16 bits), with a scaling factor is .001 and in kW units. If you've worked with Modbus before and I'm teaching you to suck eggs here, sorry.

Someone has already suggested using Node Red, which I haven't had a chance to play around with yet. One application that I really like is Mango Automation (https://infiniteautomation.com/). You can use a free license for up to 100 datapoints. It will poll, log, and graph all of your data. If you need any help to set it up I'm happy to give pointers.

User #792501   2 posts
I'm new here, please be nice
reference: whrl.pl/Re2V33
posted 2017-Nov-30, 5:45 pm AEST
posted 2017-Nov-30, 5:45 pm AEST
O.P.

I have made head way...
With the bytes side not the true modbus side.
For the life of me i could not get other modbus programs to work with the unit..

I will post my script soon. It gets all the data you could want then saves it in a mysql database. I will now make a webpage hosted locally to display data.
This unit is also derating with temp so i will also add a bit in the script to lach a esp8266 relay module. I currently have a arduino-temp probe-relay-fan set up but i would prefer to use the units own internal temp measurements that i currently get with the script as is.

Im am a diyer and just prefer to do this stuff my self and learn a thing or too.

Next will be a ct on my power meater and integrate a live power usage page
Thanks