November 21, 20223 yr 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}`
November 21, 20223 yr 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.
November 21, 20223 yr 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.
November 21, 20223 yr 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
November 21, 20223 yr 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 !
November 21, 20223 yr 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 November 21, 20223 yr by burleanu
November 21, 20223 yr 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
November 21, 20223 yr 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 November 29, 20223 yr 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.
December 17, 20223 yr 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
December 18, 20223 yr 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 December 18, 20223 yr by pongo
December 19, 20223 yr 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
December 19, 20223 yr 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 ?
December 19, 20223 yr 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 December 19, 20223 yr by pongo
February 20, 20233 yr 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.
February 20, 20233 yr 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.
February 20, 20233 yr 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?
February 20, 20233 yr Yes you can use the "pongo" example and you must change the corresponding registers numbers
February 20, 20233 yr 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
February 20, 20233 yr Solpiplog is for "MPP Solar" like inverters, non for ModBus ones Different protocols (pip solar)
February 20, 20233 yr 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
February 20, 20233 yr 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)
February 21, 20233 yr 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?
February 21, 20233 yr 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): This is EspHome webserver on ESP, you can see values in real-time and also change parameters: And this is HomeAssistant integration: Edited February 21, 20233 yr by pongo Added missing images
March 11, 20233 yr 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 March 11, 20233 yr 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.