SMA Solar WebConnect

Anyone else successfully using the SMA webconnect component?
I’m running a Sunnyboy inverter with the WebConnect module with the latest firmware. It’s working fine, but I can’t get this component to connect to it.

Config:

sensor sma:
  - platform: sma
    host: 192.168.1.205
    group: user
    password: ???????
    sensors:
      current_power:

Error Log:

2018-03-28 16:11:44 ERROR (MainThread) [pysma] Could not connect to SMA at http://192.168.1.205

Can you remove group ?

you have to login to your sma ( local, with the ip adres). Make a password, and use this …

Tried it with and without. Tried with to make sure it was trying to connect with the correct account User vs. Installer.

Make a password where? I can connect just fine using Sunny Explorer software with both the User and Installer accounts. Other than that, don’t know of any other way to connect to the SMA via the webconnect module, other then using the Modbus protocol. What kind of setup do you have??? How did you connect directly to the IP?

just go to http://192.168.1.205 and look if you can login there. You have to use that password in your config, not your online panel

Thanks. I’ve tried that, no response from my Webconnect on port 80. Can only talk to it with Modbus protocol so far that I have found. So again, what is your setup? What kind of SMA inverter and interface are you using? I’m in the USA, if you’re another country, maybe your setup is different?

I don’t know much about it. But i use sunnyportal.com to look online. And local I just go to my ipadres.

I have a Sunny Boy 3.0 1AV-40 and I live in Belgium. I use HA on my synology

Thanks for the reply. That probably explains it then. My inverter is about 5 years old, you have one of the newest models with the network interface built in… They obviously have changed the interface.

Sorry i can’t help you with the problem. That was the only problem I’ve got :slight_smile:

Hi. Did you solve this in the meantime? I have the same problem.

I have been unable to connect to my 5000TL-21 with the additional WebConnect module.

Spoke to SMA Australia, and apparently this model will only connect with Sunny Portal or Sunny Explorer - no internal web interface.

I wonder if this is the same issue a few others have encountered. Using Sunny Explorer I could connect via bluetooth and see that the WebConnect module had an IP and was happily sending data to Sunny Portal - but could not access via browser on the LAN.

Yes, yours is the older model also, does not support http connections.

for old Sma inverters with web connect you can enable modbus over tcp…
i have these set in configuration.yaml:

modbus:
  - type: tcp
    host: {ip_of_inverter}
    port: 502

sensor:
  - platform: modbus
    scan_interval: 60   #time in seconds for getting values
    registers:
    - name: SMA_Power_AC
      unit_of_measurement: W
      slave: 3
      register: 30775
      count: 2
      data_type: int
    - name: PV Daily Yield
      unit_of_measurement: kWh
      slave: 3
      register: 30517
      scale: 0.001
      precision: 3
      count: 4
      data_type: uint
    - name: PV Total Production
      unit_of_measurement: MWh
      slave: 3
      register: 30513
      scale: 0.000001
      precision: 3
      count: 4
    - name: Grid Voltage
      unit_of_measurement: V
      slave: 3 
      register: 30783
      count: 2
      scale: 0.01
      precision: 2
      data_type: uint
    - name: Grid frequency
      unit_of_measurement: Hz
      slave: 3 
      register: 30803
      count: 2
      scale: 0.01
      precision: 2
      data_type: uint
    - name: SMA_temp
      unit_of_measurement: °C
      slave: 3
      register: 30953
      count: 2
      scale: 0.1
      precision: 1
      data_type: int
    - name: SMA_status
      slave: 3
      register: 30201
      count: 2
    - name: SMA_grid
      slave: 3
      register: 30217
      count: 2
    - name: Insulation
      slave: 3
      register: 30225
      count: 2
      scale: 0.001
      unit_of_measurement: kOhms
    - name: SMA_Residual_current
      slave: 3
      register: 31247
      count: 2
      scale: 1
      unit_of_measurement: mA
    - name: Apparent Power
      unit_of_measurement: VA
      slave: 3
      register: 30813
      scale: 1
      precision: 0
      count: 2
      data_type: int
    - name: Reactive Power
      unit_of_measurement: VAr
      slave: 3
      register: 30805
      scale: 1
      precision: 0
      count: 2
      data_type: int
      
  - platform: template
    sensors:
      modbus_sma_pv_power:
        entity_id: sensor.sma_power_ac
        friendly_name: 'Power Output'
        value_template: >-
            {% if states('sensor.sma_power_ac')|float < 0 or states('sensor.sma_power_ac')|float > 10000 %}
              0
            {% else %}
              {{ states('sensor.sma_power_ac') }}
            {% endif %}
        unit_of_measurement: "W"
        icon_template: mdi:flash-circle
      modbus_sma_pv_apparent_power:
        entity_id: sensor.apparent_power
        friendly_name: 'Apparent Power'
        value_template: >-
            {% if states('sensor.apparent_power')|float < 0 or states('sensor.apparent_power')|float > 10000 %}
              0
            {% else %}
              {{ states('sensor.apparent_power') }}
            {% endif %}
        unit_of_measurement: "VA"
        icon_template: mdi:flash-circle
      modbus_sma_pv_reactive_power:
        entity_id: sensor.reactive_power
        friendly_name: 'Reactive Power'
        value_template: >-
            {% if states('sensor.reactive_power')|float < 0 or states('sensor.reactive_power')|float > 10000 %}
              0
            {% else %}
              {{ states('sensor.reactive_power') }}
            {% endif %}
        unit_of_measurement: "VAr"
        icon_template: mdi:flash-circle
      modbus_sma_pv_residual:
        entity_id: sensor.sma_residual_current
        friendly_name: 'Residual Current'
        value_template: >-
            {% if states('sensor.sma_residual_current')|float < 0 or states('sensor.sma_residual_current')|float > 10000 %}
              0
            {% else %}
              {{ states('sensor.sma_residual_current') }}
            {% endif %}
        unit_of_measurement: "mA"
        icon_template: mdi:flash-circle
      modbus_sma_temperature:
        entity_id: sensor.sma_temp
        friendly_name: 'Inverter Temp'
        value_template: >-
            {% if states('sensor.sma_temp')|float < 0 or states('sensor.sma_temp')|float > 100 %}
              0
            {% else %}
              {{ states('sensor.sma_temp') }}
            {% endif %}
        unit_of_measurement: "°C"
      modbus_grid_frequency:
        entity_id: sensor.grid_frequency
        friendly_name: 'Grid Frequency'
        value_template: >-
            {% if states('sensor.grid_frequency')|float < 30 or states('sensor.grid_frequency')|float > 100 %}
              Not Measured
            {% else %}
              {{ states('sensor.grid_frequency') }}
            {% endif %}
        unit_of_measurement: "Hz"
      modbus_grid_voltage:
        entity_id: sensor.grid_voltage
        friendly_name: 'Grid Voltage'
        value_template: >-
            {% if states('sensor.grid_voltage')|float < 180 or states('sensor.grid_voltage')|float > 300 %}
              Not Measured
            {% else %}
              {{ states('sensor.grid_voltage') }}
            {% endif %}
        unit_of_measurement: "V"
      modbus_inverter_status:
        entity_id: sensor.sma_status
        friendly_name: 'Inverter Status'
        value_template: >-
            {% if is_state('sensor.sma_status', '307' ) %}
              OK
            {% elif is_state('sensor.sma_status', '303' ) %}
              Off
            {% elif is_state('sensor.sma_status', '455' ) %}
              Warning
            {% elif is_state('sensor.sma_status', '35' ) %}
              Fault
            {% endif %}
      modbus_grid_contactor:
        entity_id: sensor.sma_grid
        friendly_name: 'Grid contactor'
        value_template: >-
            {% if is_state('sensor.sma_grid', '51' ) %}
              Closed
            {% else %}
              Open
            {% endif %} 
1 Like

and lovelace a vertical stack which hides most of the values when inverter is not connected to grid:

cards:
  - entities:
      - entity: sensor.modbus_inverter_status
      - entity: sensor.modbus_grid_contactor
    show_header_toggle: false
    title: PV Inverter
    type: entities
  - card:
      entities:
        - entity: sensor.modbus_sma_pv_power
        - entity: sensor.modbus_sma_pv_apparent_power
        - entity: sensor.modbus_sma_pv_reactive_power
        - entity: sensor.pv_daily_yield
        - entity: sensor.pv_total_production
        - entity: sensor.modbus_sma_temperature
        - entity: sensor.modbus_grid_voltage
        - entity: sensor.modbus_grid_frequency
        - entity: sensor.insulation
        - entity: sensor.modbus_sma_pv_residual
      show_header_toggle: false
      type: entities
    conditions:
      - entity: sensor.sma_grid
        state: '51'
    type: conditional
type: vertical-stack

Thanks for sharing mamra.

But i’ve tried to connect via the modbus, i can’t reach my device.
Error:

Connection to (192.168.1.175, 502) failed: timed out

code from configuration.yaml:

modbus:

  • type: tcp
    host: 192.168.1.175
    port: 502

I’m sure that the right IP from my SMA STP 6000TL, because i can read it from my local Sunny Explored connected trough speedwire.

Any idea’s?

Found it…

In the Sunny portal i had to turn on tcp server.

Hello MatijnB,

We bought an second hand inverter with an Webconnect unit. I cant connect by http and my modbus isn’t working to. Can you explain me where you turned on the tcp server?

log into the inverter as an installer, and change the settings under device parameters

I can’t login to an HTTP web interface,
but if i look in the Sunny Explorer there isn’t an option to turn it on. The only option i am seeing is Webconnect : on/off

I am using the SB 3000TLST-21 408 in combination with an SWDM-10 connected to my router.