Jump to content

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


IsolarSMGII

Recommended Posts

I answer myself.
esp-home can only read data from a modbus device and send it to homeassistant.
It is NOT a modbus gateway.
If you want to make the esp32 a modbus gateway, another firmware must be installed.
One solution is to create a flow with nodered, take the data from homeassistant and maybe send it to emoncms for example...

Link to comment
Share on other sites

Hello,

from ESPHome you can send data to HomeAssistant, but also to a MQTT server.

Then  Node-Red could read data from MQTT server (for example Mosquitto).

mqtt:
  broker: 192.168.2.32
  client_id: esphome_m5stack_220

In this way all your sensors will be sent also to MQTT.

Using "MQTT Explorer" you can check which messages where sent.

You can also define a custom message

sensor:
  - platform: sdm_meter
    address: 10
      active_power:
        name: "${friendly_name} Power"
        id: ${device_name}_active_power
        unit_of_measurement: "W"
        device_class: power
        on_value:
          then:
            - mqtt.publish:
                topic: domoticz/in
                payload: !lambda |-
                   std::string messageO;
                   char str[16];
                   snprintf(str, sizeof(str), "%.2f", x);
                   messageO += "{\"idx\":438,\"nvalue\":0,\"svalue\":\"";
                   messageO += str;
                   messageO += "\"}";
                   return messageO;

 

Note that if you configure MQTT integration in HomeAssistant, then you will have double messages on HomeAssistant from ESPHome, just use one

Link to comment
Share on other sites

Here is the yaml if anyone wants to hack in Hungarian
 
 
esphome:
  name: easun-smx-ll-inverter
  friendly_name: Easun SMX-ll Inverter
 
esp8266:
  board: esp07
# Enable logging
logger:
# Enable Home Assistant API
api:
 
ota:
  password: ......................................................
 
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
 
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Easun-Smx-Ll-Inverter"
    password: ".............................."
web_server:
  port: 80
captive_portal:
uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  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: 20s
 
sensor:
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Akkumlátor 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: "Akkumlátor 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: "Akkumlátor Áram"
    id: battery_current
    register_type: holding
    address: 0x0102
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Akkumlátor Töltés Napi"
    id: battery_charging_day
    register_type: holding
    address: 0xF02D
    unit_of_measurement: "Ah"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Akkumlátor Fogyaszás Napi"
    id: battery_discharging_day
    register_type: holding
    address: 0xF02E
    unit_of_measurement: "Ah"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1    
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Napelem Feszültség"
    id: solar_voltage
    register_type: holding
    address: 0x0107
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Napelem Áram"
    id: solar_amp
    register_type: holding
    address: 0x0108
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Napelem Watt"
    id: solar_power
    register_type: holding
    address: 0x0109
    unit_of_measurement: "W"
    value_type: U_WORD
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Napelem Töltés Napi "
    id: solar_power_generation
    register_type: holding
    address: 0xF02F
    unit_of_measurement: "kWh"
    value_type: U_WORD  
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
    device_class: energy
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Feszültség"
    id: inverter_voltage
    register_type: holding
    address: 0x0216
    unit_of_measurement: "V"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Áram"
    id: inverter_current
    register_type: holding
    address: 0x0217
    unit_of_measurement: "A"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Hz"
    id: inverter_frequency
    register_type: holding
    address: 0x0218
    unit_of_measurement: "Hz"
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.01
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Dc Hőfok"
    id: inverter_dc_temp
    register_type: holding
    address: 0x0221
    unit_of_measurement: "C"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Ac Hőfok"
    id: inverter_ac_temp
    register_type: holding
    address: 0x0222
    unit_of_measurement: "C"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1  
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Tr Hőfok"
    id: inverter_tr_temp
    register_type: holding
    address: 0x0223
    unit_of_measurement: "C"
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Fogyasztás Napi"
    id: load_power_generation_on_day
    register_type: holding
    address: 0xF030
    unit_of_measurement: "kWh"
    value_type: U_WORD  
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
    device_class: energy
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Napelem Halmozott Termelés"
    id: PV_Cumulative_Power_Generation
    register_type: holding
    address: 0xF038
    unit_of_measurement: "kWh"
    value_type: U_WORD  
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
    device_class: energy
 
  - platform: modbus_controller
    modbus_controller_id: easun
    name: "Inverter Halmozott Fogyasztás"
    id: Load_Cumulative_Power_Consumption
    register_type: holding
    address: 0xF03A
    unit_of_measurement: "kWh"
    value_type: U_WORD  
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
    device_class: energy
 
 
select:
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_priority
    name: "Kimeneti Prioritás"
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "SOL": 0
      "UTI": 1
      "SBU": 2
 
  - platform: modbus_controller
    modbus_controller_id: easun
    id: output_power_saving
    name: "Energia Takarékos Mód"
    address: 0xE20C
    value_type: U_WORD
    optionsmap:
      "KI": 0
      "BE": 1
 
     
output:
  - platform: gpio
    pin: GPIO0
    id: srv_led
status_led:
  pin:
    number: GPIO4
    inverted: false    
 
binary_sensor:
- platform: gpio
  pin:
    number: GPIO12
    mode:
      input: true
      pullup: false
    inverted: true
  name: "Loger"
- platform: gpio
  pin:
    number: GPIO14
    mode:
      input: true
      pullup: false
    inverted: true
  name: "Loger1"
   
Link to comment
Share on other sites

13 hours ago, pongo said:

Hello,

from ESPHome you can send data to HomeAssistant, but also to a MQTT server.

Then  Node-Red could read data from MQTT server (for example Mosquitto).

mqtt:
  broker: 192.168.2.32
  client_id: esphome_m5stack_220

In this way all your sensors will be sent also to MQTT.

Using "MQTT Explorer" you can check which messages where sent.

You can also define a custom message

sensor:
  - platform: sdm_meter
    address: 10
      active_power:
        name: "${friendly_name} Power"
        id: ${device_name}_active_power
        unit_of_measurement: "W"
        device_class: power
        on_value:
          then:
            - mqtt.publish:
                topic: domoticz/in
                payload: !lambda |-
                   std::string messageO;
                   char str[16];
                   snprintf(str, sizeof(str), "%.2f", x);
                   messageO += "{\"idx\":438,\"nvalue\":0,\"svalue\":\"";
                   messageO += str;
                   messageO += "\"}";
                   return messageO;

 

Note that if you configure MQTT integration in HomeAssistant, then you will have double messages on HomeAssistant from ESPHome, just use one

Hi Pongo,

I've activate MQTT on Esp-Home dongle and now inverter send all data to mosquito, but there only numbers...

Please can you explain me a little well how to setup it?

 

Thanks

Link to comment
Share on other sites

Hello,

what is supposed to view on Node-Red?

You can pass sensor values from Inverter to Node-Red via MQTT, then on Node-Red can select specific topic (sensor) and do what you want with it.

MQTT_Explorer_2023-03-15_09-10-52.png.53906678e0e2f0a0f524e8ed639668e8.png

For each inverter sensor/button/... you will have a specific topic on MQTT, for example:

On EpsHome:

firefox_2023-03-14_15-23-36.png.8065a75becdf96547bcc822af66f8097.png

firefox_2023-03-14_15-22-26.png.e6c4e182b007fbce0a62301db1d1f315.png

On Node-Red:

firefox_2023-03-14_15-13-29.png.23f12c6f5c1efbbe7cf476e54396ab22.png

EspHome:

firefox_2023-03-14_15-29-48.png.efa9678b6d509559185b5df5d71e6705.png

Node-Red:

firefox_2023-03-14_15-27-00.png.506dd77956f5f70754fabf154edfd0c7.png

If you want to use Node-Red, I suppose you know how to use it. Otherwise, why to use it?

Edited by pongo
Link to comment
Share on other sites

19 minutes ago, gazzzzton said:

you must set your own wifi password at this place

I don't have Home Assistant and I have no way to upload my yaml configuration at the beginning. I want to run ESP Logger and send to MQTT to Domoticz

Link to comment
Share on other sites

4 minutes ago, Ikis said:

I don't have Home Assistant and I have no way to upload my yaml configuration at the beginning. I want to run ESP Logger and send to MQTT to Domoticz

I think you must find and try other firmware to put in esp because esphome works only with homeassist.

On GitHub I think you can easy find a firmware that read data from modbus and send it to a mqtt server 

Link to comment
Share on other sites

59 minutes ago, antonio.ste said:

I think you must find and try other firmware to put in esp because esphome works only with homeassist.

On GitHub I think you can easy find a firmware that read data from modbus and send it to a mqtt server 

I found a solution, maybe it will be useful to someone.

https://www.google.com/search?q=esphome+compile+on+windows&rlz=1C1GCEU_plPL1007PL1007&oq=esp-home+haw+compi&aqs=chrome.1.69i57j0i22i30l9.18892j0j15&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:b93dd58f,vid:a3iay-g1AsI

 

Link to comment
Share on other sites

5 hours ago, Ikis said:

I don't have Home Assistant and I have no way to upload my yaml configuration at the beginning. I want to run ESP Logger and send to MQTT to Domoticz

You don't need HomeAssistant, you need to install EspHome. And you need original yaml file where you can change everything (including wifi password).

Inside yaml file you can enable/disable HomeAssistant integration and also can send data to domoticz:

If you put

api:

you enable HA integration, if you don't then no integration.

To send data to domoticz:

sensor:
  - platform: modbus_controller
    modbus_controller_id: dds666
    name: "Active Power"
    id: ${id_name}_active_power
    register_type: holding
    address: 0x2004
    unit_of_measurement: "W"
    device_class: power
    value_type: FP32
    accuracy_decimals: 1
    filters:
      - multiply: 1000
    on_value:
      then:
       - mqtt.publish:
           topic: domoticz/in 
           payload: !lambda |-
              std::string messageO;
              char str[256];
              snprintf(str, sizeof(str), "{\"idx\":25666,\"nvalue\":0,\"svalue\":\"%.2f\"}", x);
              messageO += str;
              return messageO;

 

Edited by pongo
Link to comment
Share on other sites

8 hours ago, pongo said:

You don't need HomeAssistant, you need to install EspHome. And you need original yaml file where you can change everything (including wifi password).

Inside yaml file you can enable/disable HomeAssistant integration and also can send data to domoticz:

If you put

api:

you enable HA integration, if you don't then no integration.

To send data to domoticz:

sensor:
  - platform: modbus_controller
    modbus_controller_id: dds666
    name: "Active Power"
    id: ${id_name}_active_power
    register_type: holding
    address: 0x2004
    unit_of_measurement: "W"
    device_class: power
    value_type: FP32
    accuracy_decimals: 1
    filters:
      - multiply: 1000
    on_value:
      then:
       - mqtt.publish:
           topic: domoticz/in 
           payload: !lambda |-
              std::string messageO;
              char str[256];
              snprintf(str, sizeof(str), "{\"idx\":25666,\"nvalue\":0,\"svalue\":\"%.2f\"}", x);
              messageO += str;
              return messageO;

 

Thank you for your help. I am also uploading another project for ISolar/EASUN SMG II

https://github.com/syssi/esphome-smg-ii

 

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...