Modbus binding with Sunny Boy SMA inverter

That tells that connection to that ip is not working from openHAB…you might have slightly more details in logs

If you are new to the topic - double check if modbus interface is enabled for your inverter. Sometimes it may involve obtaining technician privilege. Best way to comfirm actual procedure is verification of official SMA documentation.

Modbus is definitely enabled. Or was, as I cannot reach the Inverter anymore over http. I think the modbus bridge made so many requests that the server inside the inverter suffers from an overload… I’m afraid I will have to manually restart the inverter. Difficult, since I am 300 Km away for the next two weeks :frowning: .
For now I have removed all the small stuf from Openhab. When the inverter responds again I will try again.

Not sure if this is the same problem as mine - but my Tripower did an automatic firmware update on Monday evening. This stopped the Modbus interface until the next morning. Are you able to connect to the inverter through the sunnyportal login? I was able to see the logbook and this is where I saw it had done an update then turned off.

Inverter is still completely inaccessible. Not through the web interface (via VPN since I’m away), nor via Sunnyportal. Will have to have patience…

@Julian_Divett
My Inverter did not deactivate the Modbus interface, it is definitely set to on. But thanks for the suggestion
@arjena
mine is accessible through web interface and reacts totaly normal.
Only as modbus host there are problems. My openhab logfile has these type of warnings:

2023-03-08 16:39:19.414 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl] - Connect reached max tries 3, throwing last error: No route to host (Host unreachable). Connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.0.34, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false]. Endpoint ModbusIPSlaveEndpoint [address=192.168.0.34, port=502]
2023-03-08 16:39:19.415 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.0.34, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false] for endpoint ModbusIPSlaveEndpoint [address=192.168.0.34, port=502]: No route to host (Host unreachable)
2023-03-08 16:39:19.417 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Could not connect to endpoint ModbusIPSlaveEndpoint [address=192.168.0.34, port=502] – aborting request ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30053, length=4, maxTries=3] [operation ID 19a79da6-eaef-4052-9179-4fa21c775ea9]

Same errors as mine. Don’t know for sure if the fact that my inverter is unreachable is related to Openhab. I’m away for the next two weeks so it may also be related to my VPN or something else. But I’ll keep my eye on this topic, if you manage to solve the problem I can try the same ;).
Thanks,
Arjen

Seems like restarting inverter and the openhab system solved the issue. Now the communication with the host is working and every value can be seen.
Thanks for all your help!

Good news. Will have to restart the inverter anyway, so let’s hope that will work.

Well, I finally got it working. It is still not fully clear to me but I want to at least post my current config. I did it completely via the GUI. Device: " SMA SUNNY BOY 3.6".
Check your device manufacturer manual for the specific Modbus connection settings. and use a tool like qModMaster do do your first tests.

  1. Make sure that Modbus is Enabled on the device and is listening on port 502.
  2. Install the Modbus binding and configure a “Modbus TCP Slave”
UID: modbus:tcp:fc615f00df
label: Mb_Slave_SMA-SP
thingTypeUID: modbus:tcp
configuration:
  rtuEncoded: false
  connectMaxTries: 1
  reconnectAfterMillis: 0
  timeBetweenTransactionsMillis: 100
  port: 502
  timeBetweenReconnectMillis: 0
  connectTimeoutMillis: 10000
  host: 192.168.1.x
  afterConnectionDelayMillis: 0
  id: 3
  enableDiscovery: true
  1. Configure Regular pol (You need to point this at the tcp bridge, “modbus:tcp:fc615f00df”)
    With this data point, you can pull anything between “30509-30549”
UID: modbus:poller:fc615f00df:4bb3356c8a
label: SMA-SP_P_30509-49
thingTypeUID: modbus:poller
configuration:
  start: 30509
  length: 40
  refresh: 5000
  maxTries: 3
  cacheMillis: 50
  type: holding
bridgeUID: modbus:tcp:fc615f00df
  1. Configure data point “”
UID: modbus:data:4bb3356c8a:34559e5a7b
label: SMA-SP-I_Yield_day
thingTypeUID: modbus:data
configuration:
  readValueType: uint32
  readTransform: default
  writeTransform: default
  readStart: "30535"
  updateUnchangedValuesEveryMillis: 1000
  writeMultipleEvenWithSingleRegisterOrCoil: false
  writeMaxTries: 3
bridgeUID: modbus:poller:fc615f00df:4bb3356c8a
channels:
  - id: number
    channelTypeUID: modbus:number-type
    label: Value as Number
    description: Number item channel
    configuration: {}
  1. Create an item based on the channel “Value as Number”

To get other things monitored, outside of the range of the current poller you need to create a new poller and a data point.
In my case “Power delivery- 30776”
Poller: 30760-30800
Datapoint 30776