Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SunSynk - Inverter Monitoring

Featured Replies

44 minutes ago, JuanH said:

Tried it last night. One thing that is missing from our flows to have this work is state_class and last_reset properties. They are needed for Long Term Statistics, which the new system uses: https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics 

Once I added these in the the necesarry values, I was able to use them in the new HA Energy configuration:

image.png.5c7bf027348b88d78a4d856ec6bc1186.png

image.png.a2d081c97ceccc6b8a95ca9a5e4c5d67.png

Ok, something's gone wrong, and maybe you guys can help me figure it out. The above values stopped working at midnight last night. My guess is it has something to do woth the last_reset? Maybe I need to be passing it a value at midnight to update it as having re-initialized?

  • Replies 734
  • Views 203.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Thanks to @Bloubul7and all the other contributors. This is my HA dashboard. It has all I need to view at a glance. (PS: really impressed with the Sunsynk)  

  • Thanks for sharing. Did not know about the horseshoe or plotly cards. Added to Dashboard  

  • Think I figured it out. Copied the Raw Config file. EDIT: Open the file at the bottom with notepad or Text Editor. Copy and paste in Dashboard "Raw configuration editor" You need to install

Posted Images

In the new "Energy" settings in HA there is the Grid consumption bit where you can add entities, I saw my BNETA power monitor plugs were there so I had a look in InfluxDB at those and see they send last_reset, in what looks like a number that is just the date and time. It looks like HA then adds a column called "last_reset_str"

image.png.a8c58e723ce7716ed0b88472d2e250c1.png

last_reset                                last_reset_str
202011251456369984.00 -> 2020-11-25T14:56:37+00:00

I've tried using the "J: expression" in the change node to set the value.
I've tried the following expressions (with - > being the resulting value from the expression)
$now('[Y0001][M01][D01]000000000.00') -> "20210805000000000.00"
$string($now('[Y0001][M01][D01]000000000.00')) -> "20210805000000000.00"
$number($now('[Y0001][M01][D01]000000000.00')) -> 20210805000000000
(can't seem to get the .00 decimal using the expression unless it is a string)

If I use the debug node to see the data going to MQTT I can see the relevant values but HA seems to be ignoring/disregarding them.

image.png.2b361c873d4fdfa189ddbfc314ea1b7a.png

On 2021/07/26 at 10:51 AM, RhysMcW said:

Has anyone tried setting the time on the inverter using the modbus connection?
I've done a NR flow to get the current date/time from the inverter and compare it to the current date/time, on my HA box, and if there is more than 10 seconds difference then I want to set the date/time on the inverter.
The registers are 22,23 & 24 which are 2-byte registers. I can get the date/time fine in NR but I can't seem to get the inverter time set.
Does anyone know how you're supposed to setup the payload for sending to the inverter?
Here's my current function code for setting up the house/minute for register 24 which the inverter seems to be ignoring as the hour/minute is not getting set. (msg.minutes & msg.seconds are setup in a function prior to this one)

function byteArrayToLong(byteArray) {
    var b_value = 0;
    for ( var i = 0; i <= byteArray.length - 1; i++) {
        b_value = (b_value * 256) + byteArray[i];
    }
    return b_value;
}

msg.payload = {
    'value': [byteArrayToLong([msg.minutes,msg.seconds])],
    'fc': 16,
    'unitid': 1,
    'address': 24,
    'quantity': 1 };

return msg;

 

which results in the following payload being sent to the ModBusWrite flow, via a link-in/out

"payload": {
        "value": [ 11318 ],
        "fc": 16,
        "unitid": 1,
        "address": 24,
        "quantity": 1
    }

My inverter also loses time - about 15 minutes every month. Not sure if there is a RTC or battery somewhere? (there is a huge array of batteries the inverter can use if it wanted to :))

Did you manage to figure out how to write to 2-byte registers?

Thanks

Innes

Just now, innesleroux said:

Did you manage to figure out how to write to 2-byte registers?

it's not so much the method of writing 2-byte registers, that I can see, it's the format the inverter will accept the new date/time that I think is the issue. I have tried so many variations now I've lost track of what I've tried so given up for now, hoping someone else has a look and finds a solution.

  • Author
On 2021/08/05 at 1:47 PM, Bloubul7 said:

Could do it with an inject function, timer and timestamp.  And then set the MQTT to retain last value

Managed to get it working via MQTT.

Changed the Assemble config to the following

image.thumb.png.9444c91280a998f8f70fabd8871433fc.png

 

Added a timestamp inject that injects every 24 hours.  Date/ Time Formatter uses a pallete called moment

 

image.png.21fc0c65eeacc07ba38a4ee0d7fd0f46.png

 

image.png.5a4fe6dee998bee4279ceba13ea4ecce.png

flows (9).json

On 2021/08/08 at 12:16 PM, Bloubul7 said:

Managed to get it working via MQTT.

Changed the Assemble config to the following

image.thumb.png.9444c91280a998f8f70fabd8871433fc.png

 

Added a timestamp inject that injects every 24 hours.  Date/ Time Formatter uses a pallete called moment

 

image.png.21fc0c65eeacc07ba38a4ee0d7fd0f46.png

 

image.png.5a4fe6dee998bee4279ceba13ea4ecce.png

flows (9).json 4.71 kB · 6 downloads

Thanks, @Bloubul7

I've given your new flow a try, but I've noticed that the entities don't update with the "last_reset_topic". I've checked the topic value, and it definitely sends an updated value over MQTT, either as scheduled, or when done manually, but the subscribing entities don't seem to pick it up. Not sure what I am doing wrong?

Example of manually triggering the inject:

image.png.7f816191d6028afbafd7b953b9408b3e.png

Entity's last_rest stays the same:

image.png.62a746edc7888499b15e1bb3056627cc.png

  • Author
19 minutes ago, JuanH said:

Thanks, @Bloubul7

I've given your new flow a try, but I've noticed that the entities don't update with the "last_reset_topic". I've checked the topic value, and it definitely sends an updated value over MQTT, either as scheduled, or when done manually, but the subscribing entities don't seem to pick it up. Not sure what I am doing wrong?

Example of manually triggering the inject:

image.png.7f816191d6028afbafd7b953b9408b3e.png

Entity's last_rest stays the same:

image.png.62a746edc7888499b15e1bb3056627cc.png

Have you tried restarting HA?  I have not defined the last_reset on as a value on my entities, only defined the subscribed topic.  See below screenshot

image.png.b02eeae8431f1f567aad20e74cff393c.png

Hi All,

Complete Noob here.

I want to build a nice dashboard in Home Assistant for my solar installation. I have a Deye inverter which is the base for Sunsynk.

I have a Raspberry 3b+ and a USB to RS232 Cable. How would I get started to get the firmware on the Raspberry, connecting the raspberry and start playing with Node Red?

Thanks

Kind Regards

Jeremy

Hi Jeremy, the standard rasbian OS for the PI3 has node red pre-installed. 

You'd simply connect everything up, and access the node red web ui from a browser. 

From there you'd be able to install the prerequisite modules and import the flows into NR. once you have readings in NR, next step is to check integration with mqtt or home assistant running elsewhere on the network. 

On 2021/08/12 at 9:36 AM, JeremyJvR said:

Hi All,

Complete Noob here.

I want to build a nice dashboard in Home Assistant for my solar installation. I have a Deye inverter which is the base for Sunsynk.

I have a Raspberry 3b+ and a USB to RS232 Cable. How would I get started to get the firmware on the Raspberry, connecting the raspberry and start playing with Node Red?

Thanks

Kind Regards

Jeremy

Did you succeed?

  • 2 weeks later...

Hi Guys, I currently hard code my "Grid trickle feed" because I can't figure out which inverter register stores the value.  Does anyone know which modbus register stores the value in the screenshot below?

image.png.823a15c0e9c481af65e9882f9a750b6b.png

15 hours ago, Denarius said:

Hi Guys, I currently hard code my "Grid trickle feed" because I can't figure out which inverter register stores the value. 

Grid_inverter_load - 167      - I think 

I'm looking to setup HA, and so far, only got a NUC. This thread looks like a great source for flows and everything that comes after setting up HA and Node Red. Is there a guide that can be followed to get through the initial setup? The reserved posts look exactly like what I need.

 

FYI, I installed HA Container on Docker, but it didn't look to have the supervisor mode available. I might just need to install HA OS? I'd like to connect to all my SonOff devices without flashing the firmware

 

Any assistance will be appreciated

11 minutes ago, Saliegh said:

I'm looking to setup HA, and so far, only got a NUC. This thread looks like a great source for flows and everything that comes after setting up HA and Node Red. Is there a guide that can be followed to get through the initial setup? The reserved posts look exactly like what I need.

 

FYI, I installed HA Container on Docker, but it didn't look to have the supervisor mode available. I might just need to install HA OS? I'd like to connect to all my SonOff devices without flashing the firmware

 

Any assistance will be appreciated

Hey Saliegh.

 

My recomendation would be to install HA OS: https://www.home-assistant.io/installation/generic-x86-64

Once done, install the Node Red add-on from the included add-on store.

Then you can start with the flows in this thread.

 

I also recomend the Everything Smart Home channel on Youtube. Loads of useful guides for HA on there: https://www.youtube.com/c/EverythingSmartHome/featured

10 hours ago, JuanH said:

Hey Saliegh.

 

My recomendation would be to install HA OS: https://www.home-assistant.io/installation/generic-x86-64

Once done, install the Node Red add-on from the included add-on store.

Then you can start with the flows in this thread.

 

I also recomend the Everything Smart Home channel on Youtube. Loads of useful guides for HA on there: https://www.youtube.com/c/EverythingSmartHome/featured

Thanks @JuanH, this got me up and running in no time. Using a live OS on a USB was the simplest way to get there.

 

I've been told to get the follow device to hook my NUC up to the Inverter

https://www.robotics.org.za/W17286?search=485

Do I use get CAT5 network cable to connect the 2? Probably going to run it about 10 meters

 

CAT5 cable yes. Or any other copper cable. 10m should be no issue, 485 can run long distances.

Never seen this device before, but can't see why it won't work

2 hours ago, Saliegh said:

Thanks @JuanH, this got me up and running in no time. Using a live OS on a USB was the simplest way to get there.

 

I've been told to get the follow device to hook my NUC up to the Inverter

https://www.robotics.org.za/W17286?search=485

Do I use get CAT5 network cable to connect the 2? Probably going to run it about 10 meters

 

The USB will most likely fail pretty soon if you keep it as the main drive, due to the amount of reads/writes.

 

Look through the Everything Smart Home channel I mentioned earlier. There is a good guide on moving your installation onto an external (or internal if you can with the NUC) SSD drive.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.