antonio.ste Posted March 11, 2023 Share Posted March 11, 2023 i'm trying to read the values from the modbus with node-red, but i can't, if i set port 502 it doesn't connect to the modbus gateway, if i set port 80 it's fine, it connects but of course it doesn't read the values. Some idea? Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 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... Quote Link to comment Share on other sites More sharing options...
pongo Posted March 13, 2023 Share Posted March 13, 2023 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 Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 Thanks Pongo! I will try it soon as possible Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 Hello, I also created a yaml file for my SMX-ll 3.6 inverter and loaded the firmware into the data logger, which can be integrated into homeassistans. to do. Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 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" Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 can you explain to me how you loaded the alternative firmware into the datalogger? Thank you Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 You take it apart, and there are the rx, tx 3.3v, gnd, and the gpio0 port and a usb rs232 adapter and ESPHome-Flasher for gpio0 to gnd. Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 srv too gnd Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 Ok, and if you want to restore original firmware? is possibile? A simply adapter usb-> rs232 is ok? Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 Then you have to save him with the tasomizer in front of him. and you need a usb rs232 adapter that is 3.3v because the esp07 will be destroyed. Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 Excuse me but I've not understand what is "tasomizer" Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 https://github.com/tasmota/tasmotizer Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 Ok, now is all clear. Wich firmware you have installed? allways esp-home? Quote Link to comment Share on other sites More sharing options...
Tybord Posted March 13, 2023 Share Posted March 13, 2023 easun-smx-ll-inverter.bin Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 13, 2023 Share Posted March 13, 2023 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 Quote Link to comment Share on other sites More sharing options...
pongo Posted March 14, 2023 Share Posted March 14, 2023 (edited) 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. For each inverter sensor/button/... you will have a specific topic on MQTT, for example: On EpsHome: On Node-Red: EspHome: Node-Red: If you want to use Node-Red, I suppose you know how to use it. Otherwise, why to use it? Edited March 15, 2023 by pongo Quote Link to comment Share on other sites More sharing options...
Ikis Posted March 15, 2023 Share Posted March 15, 2023 On 2023/03/13 at 10:02 PM, Tybord said: easun-smx-ll-inverter.bin 449.89 kB · 1 download Hi, what is the set wifi password in your file for network Easun-Smx-Ll-Inverter? I uploaded your file to the ESP logger but I can't connect to it Quote Link to comment Share on other sites More sharing options...
gazzzzton Posted March 15, 2023 Share Posted March 15, 2023 (edited) you must set your own wifi password at this place Edited March 15, 2023 by gazzzzton Quote Link to comment Share on other sites More sharing options...
Ikis Posted March 15, 2023 Share Posted March 15, 2023 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 Quote Link to comment Share on other sites More sharing options...
antonio.ste Posted March 15, 2023 Share Posted March 15, 2023 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 Quote Link to comment Share on other sites More sharing options...
Ikis Posted March 15, 2023 Share Posted March 15, 2023 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 Quote Link to comment Share on other sites More sharing options...
pongo Posted March 15, 2023 Share Posted March 15, 2023 (edited) 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 March 16, 2023 by pongo Quote Link to comment Share on other sites More sharing options...
Ikis Posted March 16, 2023 Share Posted March 16, 2023 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.