Hi Ronny,
Thnx for your reply, I have the modbus working an hour ago.![]()
The problem was in my tags in the Jmobile software.
What would be the fastest way when i hit a button on my HMI that homey starts a flow?
Hi Ronny,
Thnx for your reply, I have the modbus working an hour ago.![]()
The problem was in my tags in the Jmobile software.
What would be the fastest way when i hit a button on my HMI that homey starts a flow?
Modbus can only be polled.
You can create a flow with a time based trigger (every xx seconds). Then read the Modbus register and use logic cards to check the value. Then you can use action cards to do something.
If you want to react on a change, you can create variables to remember a register state. Set the variable in your modbus flow.
Then I suggest to create a second flow to react on the “variable changed” trigger to do something.
Are you inside a “standard” flow? You have to use AdvancedFlow to combine several flow cards in a line to use the read value in the next card(s).
Hello RonnyW,
I want to say THANKS for your MODBUS application since it has helped me already a lot. I never could believe that I would achieve the things that I’ve achieved now by using this application. It started around X-mass 2025 when I tried to get my Mennekes Amtron Charging station to become CONTROLLABLE via MODBUS. Before I knew this application, I found out that within Home Assistant is was possible. So I installed HA on a older computer and started to work. Together with ChatGPT and Google-AI I’ve managed to get a grip via MODBUS from my charging station from within HA. Then I’ve created a connection between my Homey and HA end from that moment onwards I could control my charging station from within Homey. Great achievement, somewhere early Jan 26. Then,… I found your application and thought, … OK. Together with my yaml-file from HA end how it worked there, together with your nice MODBUS-app en I agree, again ChatGPT and Google-AI I managed fairly quickly, to control my Charging station directly from within Homey. Then I removed my HA application since it was only there for that reason… That same computer is now a Homey-SHS ==>
. Recently, my Mennekes Amtron charging station died on me. The controller inside ( a known … bug ) has stopped its function. That controller was no longer available so, I could trow it away. Now ( today arrived ) replaced by a new one, via a special deal with Mennekes ( thanks for that ). That one I still need to re-install and then connect again with my Homey via MODBUS. Should be possible without to many hassle. The MAIN reason for this writing is my achievement from today, this evening. A whole day searching , reading, trying, checking … but I succeeded to get my SMA SB5.0 Storage Home-Battery Manager that has 3 batteries ( 30kWh capacity in total ) , that also has MODBUS, to control its charging. My SMA Home Manager 2.0 controls all, so in fact, all works well. But I wanted to control my Battery Manager to be able to CHARGE or DIS-CHARGE the batterij at my wish or command.
And, I achieved it today.
So my SMA SB5.0 Storage Home Battery is now able to charge and dis-charge at MY command, to the power-levels I want. This is important to BETTER control the Capacity Tarif in Belgium, to allow my battery NOT to charge yet in the morning when the SUN shines and I produce solar-energy when the Dynamic Power tarifs are still high. Only when I want my batterij to charge, I allow it to charge via the SMA Manager. I charge my CAR. But when I have my home battery full, from today onwards, I will also be able to DIS-charge my home-battery even to the leven that I start to dump energy on the GRID. This will allow me my still almost full battery, in the early morning-hours, just before the sun starts shining, to DUMP that energy to the GRID exactly at the moments the Dynamic Electricity prices are still high.
So, its working.
Here a short overview :
This is naturally only a first version, for Test. By now I’ve created newer and nicer Advanced flows per specific needm, using a Variable to define the power level, a variable that I can CALCULATE out of different and many values I have within my Homey. Since I MEASURE and by that I KNOW a lot ![]()
This is a Thank-you to Ronny.
Success with your further developments. They are APPRECIATED.
Walter
Many Thanks, Walter.
Nice to hear your feedback and experience ![]()
Hi Ronny,
Thanks for this great app.
I have been tinkering with Sungrow iHomeManager to try to make it work with my Homey Pro Mini.
Specifically I am trying to set the “charge/discharge power” (register 8026).
From Sungrow’s documentation:
But I am pretty sure there are some bugs or weird implementation on Sungrow’s side, using a Modbus TCP client on my PC to try different combinations to get it to work, I have found out that using function 6 didn’t work for this register (getting error code 3), but using function 16 works.
This is the only combination that I have found to be working (setting charge / discharge power to 40 aka 4.0kWh)
So my question is, is there any chance you could implement support for function 16?
On another note, I also found that if I try to send a write command via Homey, if I use (U)INT16, sending value “32” is literally sent as “32” to iHomeManager which actually expects “00 32”, but I am unable to make the app send “00 32”.
Any assistance would be greatly appreciated. I have also emailed Sungrow to ask why using function 6 to write that register doesn’t seem to work for me.
The Homey device a a device setting to use “Write multiple registers” (FC 16) instead of “Write single register” (FC 6).
About “32”: The app is using a module for low level Modbus communication. As far as I know, for (U)INT16, the integer value is sent as bytes, not a string with “0032”. An integer value 32 is sent as UINT with value 00 20.
dec: 32
hex: 0x0020
You can use the “test” option in the flow card and write the result (byte string) to the timeline.Then you can see what’s sent as bytes (used to get the correct byte order for all the big/low endian variants).
@RonnyW with great thanks, all sorted now.
I set “write multiple registers” to “yes”, and for some reason I had to use Int32-LE(16bit word LE) to make it work, as long as it works I am not gonna question it.
This is the flow I created to start forced mode and charge at x kW on iHomeManager, in case anyone needs a reference. The flow starts with a numeric value, which is then passed onto the flow to set the charge power. The flow “IHM Get EMS Status” basically reads the register to confirm that it has been set successfully, and then sets a numeric variable on Homey. Before I start charging, I will check that value to make sure it’s not already charging.
Sungrow also got back to me saying the value type for register 8026 is U32, hence it needs to write 2x 16-bit registers, so it needs fc 16.
Thanks for your prompt response again.
As the Refluxion app had its functionality removed, I"ve now switched to the Modbus app to control my Sungrow inverter and battery. However, I am encountering some issues;
If I set the inverter to ‘Keep connection’, I get very occasional “no connection to modbus server” (ignore the number, that’s just a way for me to troubleshoot the exact moment the flow aborts):
If I set the inverter to ‘Manual’ (and then use Connect/Disconnect cards), I get an occasional “Req timed out” error.
Any suggestions on how to deal with this, or how to fix this?
Some devices can handle only one connection and some are closing the connection after a while. It’s device/manufactor specific.
But if you get errors also for single connects, then it would be good to split your flows.
Make every task (connect, read/write, disconnect) as one flow. Use the “flow has started…” card as start point (you can also pass variables into the flow).
Then make a “manager” flow around. Start your task-flows from there. Use the error output from this flow card to do an error handling. The easy way is to start the flow a second time. If this also errors, perhaps write to timeline or send you a message so you can check, how often this occours. Hopefully this erorr are only on-time issues and the second try solves it.