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.

I want to know protocol used in ISolar SMG II 5Kw

Featured Replies

Hi Burleanu,

I flashed the module with tasmota but I have trouble configuring the esp afterwards.
Are gpio1 and gpio3 used?
If yes, what did you put as module configuration?
I tried serbrtx in gpio1 and serbrrx in gpio3 without success.
Then in the console I send it the following command but no succes:
ModBusSend {"deviceaddress": 1, "functioncode": 2, "startaddress": 256, "type":"hex", "count":1}`

  • Replies 98
  • Views 53.3k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Hello all,   In case is not too late and you didn't abandon the project I can confirm that the above protocol is the one used. After many nights spent to reverse-engineering I was able

  • Wow. That's very different to Axperts. Strange that they don't specify the bit rate, parity, etc.

  • Hello, Also I'm looking for easun SMX II 5.6 kW protocol. Edit: I found that SMX II 5.6 is compatible with SRNE inverters protocol. I tried https://github.com/shakthisachintha/SRNE-Hybr

Posted Images

Hello, 

That's s is how I did configure my tasmota.

Have you compile your own tasmota? Because the default doesn't have the modbus implemented.

Take care mine is acting as gateway for modbus-rtu and need to create a script in start up to run to activate the port and baud rate for the device to work.

Screenshot_2022-11-21-12-30-48-73_40deb401b9ffe8e1df2f1cc5ba480b12.thumb.jpg.9a84945d4d6fc4b376aef4dc519dbe49.jpg

9 hours ago, pongo said:

I already have an atom rs485. In my opinion implementing ModBus on ESPHOME is not so hard

Indeed it is not that hard but I did get lost on the part with writing registers. For example the value of the battery or the charging priority or the SBU and SUB modes.

That I didn't know how to make it.

Via TCP with the help of tasmota I was able to get it work with the default integration in HA and I can change it easier IMHO.Screenshot_2022-11-21-13-01-38-16_c3a231c25ed346e59462e84656a70e50.thumb.jpg.bafd44ed2faf5eaa801d614451d136fd.jpg

sensor:
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Battery Capacity of SOC"
    id: battery_capacity_soc
    register_type: holding
    address: 0x0100
    unit_of_measurement: "%"
    value_type: U_WORD

select:
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_priority
    name: "Output Priority"
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "SOL": 0
      "UTI": 1
      "SBU": 2

 

Oh yes indeed I had not understood that the card does the job on its own.

So Which version of tasmota are you using? Because I have installed tasmota (english) release in generic version 0 but in the gpio configuration I do not have tcp tx and tcp rx in the list like you. 

do you have to add a template in configure other to have these functions?

thanks for all !

Hello, 

I'm not home right now to see were is the file I had compiled but you can take a look at this

https://tasmota.github.io/docs/Serial-to-TCP-Bridge/#commands

And there you can compile your own one to support TCP and afterwards you can create the sensors accordingly else you can take the route of @pongo and use it via esphome if you have HA and you know how to do it.

Good luck.

LE:

This way you can just read the values that you configure in the script. (Still need to be complied)

https://tasmota.github.io/docs/Smart-Meter-Interface/

Edited by burleanu

1 hour ago, burleanu said:

Hello, 

I'm not home right now to see were is the file I had compiled but you can take a look at this

https://tasmota.github.io/docs/Serial-to-TCP-Bridge/#commands

And there you can compile your own one to support TCP and afterwards you can create the sensors accordingly else you can take the route of @pongo and use it via esphome if you have HA and you know how to do it.

Good luck.

LE:

This way you can just read the values that you configure in the script. (Still need to be complied)

https://tasmota.github.io/docs/Smart-Meter-Interface/

Would it be possible that you send me your tasmota configuration file that I try to import it on my module when you have the opportunity?
I have searched with the links you provided me, I can not get the tcp tx and tcp rx
thanks in advance, Alexis
On 2022/11/21 at 3:53 PM, gazzzzton said:
Would it be possible that you send me your tasmota configuration file that I try to import it on my module when you have the opportunity?
I have searched with the links you provided me, I can not get the tcp tx and tcp rx
thanks in advance, Alexis

Here are the file I currently use, I add a little readme file to know how to set in the console of tasmota.

 readme.txt

This will give the option to be able to access via TCP.

Also I think the ready made tasmota-zbbrige firmware have already build in the TCP. Mine is already one year old.

For test if you don't have home assistant and also if you want to see all the registers you can use a software call " Radzio! Modbus master simulator"

https://en.radzio.dxp.pl/modbus-master-simulator/

After you set up your tasmota then this Radzio software can connect to it via "Modbus RTU over TCP/IP" and there you set the IP and port and after you can connect.

Inside this you have to specify what registers you want to access and at what address. For example for me "holdings registers" at address 200+ I can see all the important values I need, you can see it in my first photo.

Also if you have HA you have the example how to setup HA to read them over TCP in one of my photo.

Once you have tasmota you can flash esphome over and use the other function pongo use and build yours like that, if you use HA.

LE:

I look again and see that you use Node-Red so you can add the needed parameters inside Node-Red because I see they have a "package" for modbus and is able to read over TCP.

So you just need to know what registers you need and add them in.

 

tasmota-zbbridge.bin

Edited by burleanu
Unfortunately the tasmota file was built for my WiFi network so is hard to modify/use. Normally this variant should work because it does have TCP Rx/Tx.

  • 4 weeks later...
On 2022/11/21 at 12:12 PM, pongo said:
sensor:
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Battery Capacity of SOC"
    id: battery_capacity_soc
    register_type: holding
    address: 0x0100
    unit_of_measurement: "%"
    value_type: U_WORD

select:
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_priority
    name: "Output Priority"
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "SOL": 0
      "UTI": 1
      "SBU": 2

 

Hi Pongo, I try to connect my esp32 with my rs485 TTL converter like the home assistant docs, I programmed the following code, I can see it sending the modbus request but it returns nothing in return. Do you have any idea where it can come from in my esphome code?

esphome:
  name: easun
 
esp32:
  board: esp32dev
  framework:
    type: esp-idf
    version: latest
 
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
 
ota:
logger:
api:
#mqtt:
#  broker: !secret mqtt_host
#  username: !secret mqtt_username
#  password: !secret mqtt_password
#  id: mqtt_client
 
uart:
  id: mod_bus
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 9600
  stop_bits: 1
 
modbus:
  id: modbus1
   
 
modbus_controller:
  - id: easun
    address: "0x01"
    modbus_id: modbus1
   
sensor:
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Battery Capacity of SOC"
    id: battery_capacity_soc
    register_type: holding
    address: 0x0100
    unit_of_measurement: "%"
    value_type: U_WORD
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "tension entree edf"
    id: tension_entree_edf
    register_type: holding
    address: 0x0213
    unit_of_measurement: "V"
    value_type: U_WORD  
 
select:
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_priority
    name: "Output Priority"
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "SOL": 0
      "UTI": 1
      "SBU": 2

 

IMG_20221217_180155.jpg

Hello,

are you sure using correct gpio numbers for UART RX and TX?

This is my complete yaml file (work in progress):

substitutions:
  device_name: easun
  friendly_name: "EasunSMX"
  name: easun
  device_id: easun

esphome:
  name: ${device_name}
  platform: ESP32
  board: m5stack-atom
  platformio_options:
    upload_speed: 115200

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
    - ssid: !secret wifi_ssid_2
      password: !secret wifi_password_2

  manual_ip:
      static_ip: 192.168.1.235
      gateway: 192.168.1.1
      subnet: 255.255.255.0
      dns1: 8.8.8.8
      dns2: 192.168.1.1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "atom-3 Fallback Hotspot"
    password: "sAAGiW4YfU9F"

web_server:
  port: 80

captive_portal:

light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} Light
    effects:
      - random:
      - flicker:
      - addressable_rainbow:

binary_sensor:
  - platform: gpio
    pin:
      number: 39
      inverted: true
    name: ${friendly_name} Button
    on_press:
      then:
        - light.toggle: status_led

button:
    - platform: restart
      id: ${device_id}_restart_button
      name: "${friendly_name} Restart"

uart:
  rx_pin: GPIO22
  tx_pin: GPIO19
  id: mod_bus
  baud_rate: 9600
  stop_bits: 1

modbus:
  #send_wait_time: 200ms
  id: mod_bus_1

modbus_controller:
  - id: easun
    ## the Modbus device addr
    address: 0x1
    modbus_id: mod_bus_1
    #command_throttle: 200ms
    setup_priority: -10
    update_interval: 5s

sensor:
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Batteria Capacità of SOC"
    id: battery_capacity_soc
    register_type: holding
    address: 0x0100
    unit_of_measurement: "%"
    value_type: U_WORD

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Batteria Volt"
    id: battery_voltage
    register_type: holding
    address: 0x0101
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Corrente ricarica (batteria FV)"
    id: charging_current
    register_type: holding
    address: 0x0224
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 0
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Consumo da EASUN"
    id: load_active_power
    register_type: holding
    address: 0x021B
    unit_of_measurement: "W"
    value_type: U_WORD

select:
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_priority
    name: "Priorità Uscita"
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "SOL": 0
      "UTI": 1
      "SBU": 2

  - platform: modbus_controller
    modbus_controller_id: easun
    id: mains_charge_current_limit
    name: "Ampere Carica in AC"
    address: 0xE205
    value_type: U_WORD
    optionsmap:
      "0": 0
      "5": 50
      "10": 100
      "15": 150
      "20": 200
      "25": 250
      "30": 300
      "35": 350
      "40": 400
      "45": 450
      "50": 500
      "55": 550
      "60": 600

  - platform: modbus_controller
    modbus_controller_id: easun
    id: max_charge_current
    name: "Ampere di Carica"
    address: 0xE20A
    value_type: U_WORD
    optionsmap:
      "0": 0
      "5": 50
      "10": 100
      "15": 150
      "20": 200
      "25": 250
      "30": 300
      "35": 350
      "40": 400
      "45": 450
      "50": 500

 

Edited by pongo

Dear Burleanu many thanks for your posts.
I'm also fighting with esp8266/32 communication for Home Assistant with SMG II inverters.
May I kindly ask you to share just shortly how you can flash wifi dongle delivered with SMG II inverter with tasmota firmware?
Many thanks

On 2022/12/18 at 11:35 AM, pongo said:

Hello,

are you sure using correct gpio numbers for UART RX and TX?

This is my complete yaml file (work in progress):

substitutions:
  device_name: easun
  friendly_name: "EasunSMX"
  name: easun
  device_id: easun

esphome:
  name: ${device_name}
  platform: ESP32
  board: m5stack-atom
  platformio_options:
    upload_speed: 115200

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
    - ssid: !secret wifi_ssid_2
      password: !secret wifi_password_2

  manual_ip:
      static_ip: 192.168.1.235
      gateway: 192.168.1.1
      subnet: 255.255.255.0
      dns1: 8.8.8.8
      dns2: 192.168.1.1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "atom-3 Fallback Hotspot"
    password: "sAAGiW4YfU9F"

web_server:
  port: 80

captive_portal:

light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} Light
    effects:
      - random:
      - flicker:
      - addressable_rainbow:

binary_sensor:
  - platform: gpio
    pin:
      number: 39
      inverted: true
    name: ${friendly_name} Button
    on_press:
      then:
        - light.toggle: status_led

button:
    - platform: restart
      id: ${device_id}_restart_button
      name: "${friendly_name} Restart"

uart:
  rx_pin: GPIO22
  tx_pin: GPIO19
  id: mod_bus
  baud_rate: 9600
  stop_bits: 1

modbus:
  #send_wait_time: 200ms
  id: mod_bus_1

modbus_controller:
  - id: easun
    ## the Modbus device addr
    address: 0x1
    modbus_id: mod_bus_1
    #command_throttle: 200ms
    setup_priority: -10
    update_interval: 5s

sensor:
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Batteria Capacità of SOC"
    id: battery_capacity_soc
    register_type: holding
    address: 0x0100
    unit_of_measurement: "%"
    value_type: U_WORD

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Batteria Volt"
    id: battery_voltage
    register_type: holding
    address: 0x0101
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Corrente ricarica (batteria FV)"
    id: charging_current
    register_type: holding
    address: 0x0224
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 0
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Consumo da EASUN"
    id: load_active_power
    register_type: holding
    address: 0x021B
    unit_of_measurement: "W"
    value_type: U_WORD

select:
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_priority
    name: "Priorità Uscita"
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "SOL": 0
      "UTI": 1
      "SBU": 2

  - platform: modbus_controller
    modbus_controller_id: easun
    id: mains_charge_current_limit
    name: "Ampere Carica in AC"
    address: 0xE205
    value_type: U_WORD
    optionsmap:
      "0": 0
      "5": 50
      "10": 100
      "15": 150
      "20": 200
      "25": 250
      "30": 300
      "35": 350
      "40": 400
      "45": 450
      "50": 500
      "55": 550
      "60": 600

  - platform: modbus_controller
    modbus_controller_id: easun
    id: max_charge_current
    name: "Ampere di Carica"
    address: 0xE20A
    value_type: U_WORD
    optionsmap:
      "0": 0
      "5": 50
      "10": 100
      "15": 150
      "20": 200
      "25": 250
      "30": 300
      "35": 350
      "40": 400
      "45": 450
      "50": 500

 

Hi, thank you for your response.

I use an rs485/TTL converter. I connect the A and the B to the converter and +3.3v, tx, rx, gnd respectively on the vcc, rx (gpio16), tx (gpio17), gnd terminals of my classic esp32. It's not good ?

ESP32-Pinout.png

Hello,

possible causes:

- swapped A and B (RX=A, TX=B), connect RX converter to TX on ESP32 and viceversa, try also other way 

- bad gpios (maybe 16 and 17 are used by console, l don't remember, try other free bidirectional gpios)

- noise on cable (add 120 ohm resistor between A and B on converter)

- bad cable (try a shielded cable)

If none of those helps I don't know

Edited by pongo

  • 2 months later...

Hi @burleanu, @pongo

little recap: the easun inverter SMX and SMG series use different protocol? I've undestand well?
 

I've SMX-II-5.6KW-WIFI, for connect it to my local network wich i must use?

I've esp8266 and ttl converter, the idea is to install tamota firware in esp and connect it to rs485 port of my 5,6kw inverter. Is possibile? it is modbus capable?

And: If i want to monitor my inverter from remote? How I can it?
Thanks a lot.

hi, both use modbus protocol but use different registers. a little earlier in the conversation someone provided the smx2 protocol, it helped me to make a glow under node-red and now it communicates very well.

personally I use the usb cable directly on my raspberry for communication.

26 minutes ago, gazzzzton said:

hi, both use modbus protocol but use different registers. a little earlier in the conversation someone provided the smx2 protocol, it helped me to make a glow under node-red and now it communicates very well.

personally I use the usb cable directly on my raspberry for communication.

HI,
ok, thanks, now I'm starting to understand something.
So my idea of putting the smx inverter in the local network with an esp3266 can be done, I just have to use the SNRE inverter registers?

9 minutes ago, gazzzzton said:

Yes you can use the "pongo" example and you must change the corresponding registers numbers

Ok, perfect, and where I can find register numbers?

Other question: You say: "personally I use the usb cable directly on my raspberry for communication"

I've my inverters connect with USB cable to a tv box with ubuntu and on it there is Solpiplog, but it is not able to read data. How you can read data with Raspberry? I want to try with my box.

thanks

23 minutes ago, pongo said:

Solpiplog is for "MPP Solar" like inverters, non for ModBus ones

Different protocols (pip solar)

I realized it too late!

for this i want to find an alternative way to see the values in real time.
but I don't know where to start

If you use esp8266 you can install esphome enabling web server and you can see data using a browser in real-time.

Or, alternatively, you can use tasmota compiling by yourself adding modbus support (harder way)

13 hours ago, pongo said:

If you use esp8266 you can install esphome enabling web server and you can see data using a browser in real-time.

Or, alternatively, you can use tasmota compiling by yourself adding modbus support (harder way)

Kind Pongo, do you mean that esp8266 can read value and show it on webserver "it-self" ?

If yes what I can search? Wich rom for example?

You have to attach an RS485/ttl to a ESP8266 (or better a ESP32), as said in previous posts.

Or use an all-in-one ESP32+RS485, for example m5stack atom lite RS485 (as I did) and install on it esphome custom rom.

But you have to read and learn how to do it: esphome is a custom rom project for ESPs born to integrate with HomeAssistant, but can work also stand-alone (webserver for sure works on ESP32).

You can use my yaml configuration file for ESPHome as reference.

This is how atom is connected to inverter (inverter also powers ESP32):

411372269_ImmagineWhatsApp2022-11-21ore12_29_03.thumb.jpg.75321616eb66e393ba57f199fa2048dc.jpg

This is EspHome webserver on ESP, you can see values in real-time and also change parameters:

1795371350_ImmagineWhatsApp2023-01-26ore11_48_48.thumb.jpg.04a947f8abf464f0c09ff0269d2b3d84.jpg

And this is HomeAssistant integration:

2063013624_ImmagineWhatsApp2022-11-21ore11_00_24.thumb.jpg.025c302bb24bbe82607768444adff995.jpg

Edited by pongo
Added missing images

  • 3 weeks later...

a big thank you to all, i also made the modbus adapter with a mini d1, with esphome and homeassistant firmware.
following the instructions of pongo and creating a .yaml file with the addresses of the SRNE inverters I was able to read all the values from my inverter.

Edited by antonio.ste

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.