Skip to content

Instantly share code, notes, and snippets.

@vladyspavlov
Last active November 9, 2024 21:00
Show Gist options
  • Save vladyspavlov/5ac21cb58923482eff8e7bbb2d0854b3 to your computer and use it in GitHub Desktop.
Save vladyspavlov/5ac21cb58923482eff8e7bbb2d0854b3 to your computer and use it in GitHub Desktop.
Must inverter ESPHome configuration for ESP32
substitutions:
inverter_id: inverter
updates: 5s
api_key: xxx
ota_password: xxx
esphome:
name: inverter-monitor
comment: "Inverter monitor"
esp32:
board: esp32dev
framework:
type: esp-idf
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
logger:
level: DEBUG
api:
encryption:
key: ${api_key}
ota:
password: ${ota_password}
uart:
- id: uart_inverter
baud_rate: 19200
tx_pin: GPIO19
rx_pin: GPIO18
stop_bits: 1
parity: NONE
data_bits: 8
debug:
direction: BOTH
dummy_receiver: false
modbus:
- id: modbus_inverter
uart_id: uart_inverter
send_wait_time: 200ms
modbus_controller:
- id: must_inverter
address: 0x04
modbus_id: modbus_inverter
command_throttle: 200ms
setup_priority: -10
update_interval: ${updates}
sensor:
# charger sensors
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15201
name: "PV Charger Workstate"
register_type: holding
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15202
name: "PV Charger MPPT state"
register_type: holding
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15203
name: "PV Charger Charging state"
register_type: holding
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15205
name: "PV Charger Voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15206
name: "PV Charger Battery voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15207
name: "PV Charger Current"
register_type: holding
unit_of_measurement: "A"
accuracy_decimals: 1
icon: mdi:current-dc
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15208
register_type: holding
name: "PV Charger power"
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15209
register_type: holding
name: "PV Charger Radiator temp"
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: mdi:temperature-celsius
# - platform: modbus_controller
# modbus_controller_id: must_inverter
# address: 15210
# register_type: holding
# name: "PV Charger External temp"
# unit_of_measurement: "°C"
# accuracy_decimals: 1
# icon: mdi:temperature-celsius
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15212
register_type: holding
name: "PV Relay"
icon: mdi:electric-switch
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15217
register_type: holding
id: charger_total_mwh
internal: true
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15218
register_type: holding
id: charger_total_kwh
internal: true
filters:
multiply: 0.1
- platform: template
name: "PV Charger Accumulated charger power"
unit_of_measurement: kWh
lambda: !lambda 'return (id(charger_total_mwh).state * 1000.0 + id(charger_total_kwh).state );'
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15219
register_type: holding
name: "PV Charger Accumulated day"
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15220
register_type: holding
name: "PV Charger Accumulated hour"
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 15221
register_type: holding
name: "PV Charger Accumulated minute"
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
# inverter sensors
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25201
register_type: holding
name: "Inverter Work state"
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25205
name: "Inverter Battery Voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25206
name: "Inverter Voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25207
name: "Inverter Grid voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25207
name: "Inverter Grid voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25208
name: "Inverter BUS Voltage"
register_type: holding
unit_of_measurement: "V"
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25209
name: "Inverter Control current"
register_type: holding
unit_of_measurement: "A"
accuracy_decimals: 1
icon: mdi:current-dc
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25210
name: "Inverter Current"
register_type: holding
unit_of_measurement: "A"
accuracy_decimals: 1
icon: mdi:current-dc
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25211
name: "Inverter Grid current"
register_type: holding
unit_of_measurement: "A"
accuracy_decimals: 1
icon: mdi:current-ac
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25212
name: "Inverter Load current"
register_type: holding
unit_of_measurement: "A"
accuracy_decimals: 1
icon: mdi:current-ac
filters:
multiply: 0.1
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25213
name: "Inverter Power"
register_type: holding
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25214
name: "Inverter Grid power"
register_type: holding
unit_of_measurement: "W"
accuracy_decimals: 1
value_type: S_WORD
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25215
name: "Inverter Load power"
register_type: holding
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25216
name: "Inverter System load"
register_type: holding
unit_of_measurement: "%"
accuracy_decimals: 1
icon: mdi:flash
# MOST INFO
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25233
register_type: holding
name: "Inverter AC radiator temp"
accuracy_decimals: 1
unit_of_measurement: "°C"
icon: mdi:temperature-celsius
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25234
register_type: holding
name: "Inverter Transformer temp"
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: mdi:temperature-celsius
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25235
register_type: holding
name: "Inverter DC Radiator temp"
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: mdi:temperature-celsius
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25237
register_type: holding
name: "Inverter Relay state"
icon: mdi:electric-switch
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25238
register_type: holding
name: "Inverter Relay state Grid"
icon: mdi:electric-switch
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25239
register_type: holding
name: "Inverter Relay state Load"
icon: mdi:electric-switch
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25240
register_type: holding
name: "Inverter Relay state NLine"
icon: mdi:electric-switch
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25241
register_type: holding
name: "Inverter Relay state DC"
icon: mdi:electric-switch
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25242
register_type: holding
name: "Inverter Relay state Earth"
icon: mdi:electric-switch
# Inverter Accumulated discharge power
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25247
register_type: holding
id: discharger_total_mwh
internal: true
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25248
register_type: holding
id: discharger_total_kwh
internal: true
filters:
multiply: 0.1
- platform: template
name: "Accumulated discharger power"
unit_of_measurement: kWh
accuracy_decimals: 1
lambda: !lambda 'return (id(discharger_total_mwh).state * 1000.0 + id(discharger_total_kwh).state);'
# Inverter Accumulated buy power
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25249
register_type: holding
id: buy_mwh
internal: true
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25250
register_type: holding
id: buy_kwh
internal: true
filters:
multiply: 0.1
- platform: template
name: "Accumulated buy power"
unit_of_measurement: kWh
lambda: |-
return (id(buy_mwh).state * 1000.0 + id(buy_kwh).state);
accuracy_decimals: 1
# Inverter Accumulated sell power
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25251
register_type: holding
id: sell_mwh
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25252
register_type: holding
id: sell_kwh
filters:
multiply: 0.1
- platform: template
name: "Accumulated sell power"
unit_of_measurement: kWh
accuracy_decimals: 1
lambda: !lambda return (id(sell_mwh).state * 1000.0 + id(sell_kwh).state);
# Inverter Accumulated load power
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25253
register_type: holding
id: load_mwh
internal: True
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25254
register_type: holding
id: load_kwh
internal: True
filters:
multiply: 0.1
- platform: template
name: "Accumulated load power"
unit_of_measurement: kWh
accuracy_decimals: 1
lambda: !lambda return (id(load_mwh).state * 1000.0 + id(load_kwh).state);
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25273
register_type: holding
value_type: S_WORD
name: "Inverter Battery power"
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25274
register_type: holding
value_type: S_WORD
name: "Inverter Battery current"
unit_of_measurement: "A"
accuracy_decimals: 1
icon: mdi:current-dc
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25275
register_type: holding
value_type: S_WORD
name: "Inverter Battery grade"
unit_of_measurement: "V"
icon: mdi:alpha-V
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 25277
register_type: holding
name: "Inverter Rated power"
unit_of_measurement: "W"
accuracy_decimals: 1
icon: mdi:flash
select:
- platform: modbus_controller
modbus_controller_id: must_inverter
id: energy_use_mode
name: "Inverter Energy use mode (parameter 00)"
address: 20109
optionsmap:
"SBU (Solar/battery/utility)": 1
"SUB (Solar/utility/battery)": 2
"UTI (Utility only)": 3
"SOL (Solar only)": 4
- platform: modbus_controller
modbus_controller_id: must_inverter
id: charger_source_priority
name: "Inverter Charger source priority (parameter 10)"
address: 20143
optionsmap:
"CSO (Solar first)": 0
"SNU (Solar and utility)": 2
"OSO (Solar only)": 3
- platform: modbus_controller
modbus_controller_id: must_inverter
address: 20111
id: inverter_ac_input_voltage_range
name: "Inverter AC input voltage range (02)"
optionsmap:
"VDE (184-253VAC)": 0
"UPS (170-280VAC)": 1
"APL (90-280VAC)": 2
"GEN (Generator)": 3
number:
- platform: modbus_controller
id: batt_float_voltage
name: "PV Charger Float voltage"
unit_of_measurement: "V"
address: 10103
value_type: U_WORD
multiply: 10
- platform: modbus_controller
id: batt_absorb_voltage
name: "PV Charger Absorb voltage"
unit_of_measurement: "V"
address: 10104
value_type: U_WORD
multiply: 10
- platform: modbus_controller
id: batt_stop_dischg
name: "Inverter Battery stop discharging voltage"
unit_of_measurement: "V"
address: 20118
value_type: U_WORD
lambda: "return x * 0.1; "
write_lambda: |-
return x * 10 ;
- platform: modbus_controller
id: batt_stop_chg
name: "Inverter Battery stop charging voltage"
unit_of_measurement: "V"
address: 20119
value_type: U_WORD
multiply: 10
- platform: modbus_controller
id: batt_low_voltage
name: "Inverter Battery low voltage"
unit_of_measurement: "V"
address: 20127
value_type: U_WORD
multiply: 10
- platform: modbus_controller
id: batt_high_voltage
name: "Inverter Battery high voltage"
unit_of_measurement: "V"
address: 20128
value_type: U_WORD
multiply: 10
- platform: modbus_controller
id: solar_charger_current
name: "Inverter Charger current"
unit_of_measurement: "A"
address: 20132
value_type: U_WORD
multiply: 10
@kiberhim
Copy link

У вас вийшло зробити комунікацію таким чином через USB WiFi порт?
Я всі комбінації A+/B- та Rx/Tx спробував, не працює

Яка саме модель інвертора у вас?

MUST pv18-5248 pro

У мене такий же інвертор, все працює.

Video

В червоній термоусадці модуль RS485 - TTL, посилання кидав вище.

Доброї ночі. Щось я не зрозумів, у вас на ESP32 все базовано?

@vladyspavlov
Copy link
Author

vladyspavlov commented Sep 30, 2024

У вас вийшло зробити комунікацію таким чином через USB WiFi порт?
Я всі комбінації A+/B- та Rx/Tx спробував, не працює

Яка саме модель інвертора у вас?

MUST pv18-5248 pro

У мене такий же інвертор, все працює.
Video
В червоній термоусадці модуль RS485 - TTL, посилання кидав вище.

Доброї ночі. Щось я не зрозумів, у вас на ESP32 все базовано?

Так. Конкретно на відео - WT32, але поки що на вай-фаї

@gjury
Copy link

gjury commented Sep 30, 2024

Thanks for this file!. I confirm it is working perfectly fine in my MUST PV18-3024 VHM
You have a couple of additional registers missing although:
address: 25225
name: "Inverter frequency"
unit_of_measurement: "Hz"

address: 25226
name: "Grid frequency"

@kiberhim
Copy link

У вас вийшло зробити комунікацію таким чином через USB WiFi порт?
Я всі комбінації A+/B- та Rx/Tx спробував, не працює

Яка саме модель інвертора у вас?

MUST pv18-5248 pro

У мене такий же інвертор, все працює.
Video
В червоній термоусадці модуль RS485 - TTL, посилання кидав вище.

Доброї ночі. Щось я не зрозумів, у вас на ESP32 все базовано?

Так. Конкретно на відео - WT32, але поки що на вай-фаї

Тобто це така сама solar2mqtt? У мене так і не виходить одружити з моїм anenji. 6500вт 48в. У нього на борту 232 та 485 порти, я правильно зрозумів, 232 до вайфай, у мене він є та працює (заводський) але додтаок та сервери ... це мрак. У мене також є налаштований та працюючий home assistant. 485 для підключення фірмових батарей? Я тільки сьогодні побачив цей пост, допаяв до esp8266 (nodeMCU) все як у вас, ткнув в 485 - нема (перетворювач у мене э). 232 - так само, також э саморобний перетворювач на max232 та заводський. Байдуже, тиша. Можливо є якісь інші распіновки? але ж живлення та земля співпадають у мене 4й 12в, 8й - земля. Це я про 232. У вас є схема та бінарний файл для вашого девайсу? Можливо є для 8266?

@bernstein7
Copy link

bernstein7 commented Oct 1, 2024

У вас вийшло зробити комунікацію таким чином через USB WiFi порт?
Я всі комбінації A+/B- та Rx/Tx спробував, не працює

Яка саме модель інвертора у вас?

MUST pv18-5248 pro

У мене такий же інвертор, все працює.

Video

В червоній термоусадці модуль RS485 - TTL, посилання кидав вище.

Такий же інвертор, така сама RS485-TTL, на базі esp32 wroom32 (gpio 1/3 у якості tx/rx) - все перепробував, досі отримую

[21:33:24][D][modbus_controller:038]: Modbus command to device=4 register=0x6295 no response received - removed from send queue

для всіх каналів. Вже не знаю яку ще комбінацію спробувати.

UPD: ще отакий побачив ворнінг

[22:59:44][W][modbus_controller:027]: Modbus device=4 set offline

UPD: спробував інший rs-485-ttl та А/В брати з перших пінів RJ45, а не USB WiFi, результат такий самий

@LionBS76
Copy link

LionBS76 commented Oct 2, 2024

Такий же інвертор, така сама RS485-TTL, на базі esp32 wroom32 (gpio 1/3 у якості tx/rx) - все перепробував, досі отримую

[21:33:24][D][modbus_controller:038]: Modbus command to device=4 register=0x6295 no response received - removed from send queue

для всіх каналів. Вже не знаю яку ще комбінацію спробувати.

UPD: ще отакий побачив ворнінг

[22:59:44][W][modbus_controller:027]: Modbus device=4 set offline

UPD: спробував інший rs-485-ttl та А/В брати з перших пінів RJ45, а не USB WiFi, результат такий самий

Я не читав ще про Wroom плату, але у мене була схожа ситуація з NodeMCU (ESP8266). Проблема у тому, що на платі для розробок NodeMCU вже є модуль USB-UART і він під'єднаний до RX/TX контролера. І виявляється що він постійно тримає RX в стані HIGH. Тобто використовувати RX пін напряму майже не можливо.
Можливо з wroom платою така сама засада ?

@bernstein7
Copy link

Такий же інвертор, така сама RS485-TTL, на базі esp32 wroom32 (gpio 1/3 у якості tx/rx) - все перепробував, досі отримую

[21:33:24][D][modbus_controller:038]: Modbus command to device=4 register=0x6295 no response received - removed from send queue

для всіх каналів. Вже не знаю яку ще комбінацію спробувати.
UPD: ще отакий побачив ворнінг

[22:59:44][W][modbus_controller:027]: Modbus device=4 set offline

UPD: спробував інший rs-485-ttl та А/В брати з перших пінів RJ45, а не USB WiFi, результат такий самий

Я не читав ще про Wroom плату, але у мене була схожа ситуація з NodeMCU (ESP8266). Проблема у тому, що на платі для розробок NodeMCU вже є модуль USB-UART і він під'єднаний до RX/TX контролера. І виявляється що він постійно тримає RX в стані HIGH. Тобто використовувати RX пін напряму майже не можливо. Можливо з wroom платою така сама засада ?

Дійсно, перекинув на інші gpio піни які вміють UART і запрацювало.
Велика подяка вам і автору конфіга!

@LionBS76
Copy link

LionBS76 commented Oct 7, 2024

Hello!
Your config works for me only once :)

Now it logs out this:

21:46:07 | [E] | [json:041] | Could not allocate memory for JSON document! Requested 512 bytes, largest free heap block: 512 bytes
21:46:07 | [E] | [json:041] | Could not allocate memory for JSON document! Requested 512 bytes, largest free heap block: 512 bytes
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=10103 count=2
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20127 count=2
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20132 count=1
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20143 count=1
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25201 count=1
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25205 count=12
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25233 count=3
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25237 count=6
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25247 count=8
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25273 count=3
21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25277 count=1
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15201 count=3
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15205 count=5
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15212 count=1
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15217 count=5
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20109 count=1
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20111 count=1
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20118 count=2
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25233 count=3
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25237 count=6
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25247 count=8
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25273 count=3
21:46:24 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25277 count=1
21:46:29 | [I] | [safe_mode:041] | Boot seems successful; resetting boot loop counter
21:46:34 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=10103 count=2
21:46:34 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15205 count=5
21:46:34 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15212 count=1
21:46:34 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=15217 count=5

Do you know where is the problem ?

And thanks for you work !

@LionBS76
Copy link

LionBS76 commented Oct 8, 2024

Hello! Your config works for me only once :)

Now it logs out this:

21:46:07 | [E] | [json:041] | Could not allocate memory for JSON document! Requested 512 bytes, largest free heap block: 512 bytes 21:46:07 | [E] | [json:041] | Could not allocate memory for JSON document! Requested 512 bytes, largest free heap block: 512 bytes 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=10103 count=2 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20127 count=2 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20132 count=1 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=20143 count=1 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25201 count=1 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25205 count=12 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25233 count=3 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25237 count=6 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25247 count=8 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25273 count=3 21:46:14 | [W] | [modbus_controller:181] | Duplicate modbus command found: type=0x3 address=25277 count=1 21:46:24 | [W] | [modbus_controller:181] |

Do you know where is the problem ?

And thanks for you work !

Have additional experiments and results.
I use ESP-01 with latest ESPHome firmware + your YAML config. I chosed original RX/TX for communication with RS485 becouse ESP-01 have only this pins.
So , it works if I doesn't try to view LOGs from device.
If i try to view LOGs - Inverter are stuck and stop give parameters. And only one solution - restart Inverter.
So I suppose that LOG (Debug) use the same UART and thus stuck Inverter with flooded information.
I have changed UART for logging but withh no success ;(

I use such config, but only works if don't use LOG :)

esp8266:
board: esp01_1m

# Enable logging
logger:
level: DEBUG
hardware_uart: UART1
baud_rate: 0

uart:
- id: uart_inverter
baud_rate: 19200
tx_pin: GPIO01
rx_pin: GPIO03
stop_bits: 1
parity: NONE
data_bits: 8
debug:
direction: BOTH
dummy_receiver: false

modbus:
- id: modbus_inverter
uart_id: uart_inverter
send_wait_time: 300ms

modbus_controller:
- id: must_inverter
address: 0x04
modbus_id: modbus_inverter
command_throttle: 300ms
setup_priority: -10
update_interval: ${updates}

@alexsobolev1076
Copy link

alexsobolev1076 commented Nov 9, 2024

There is a mistake in the code probably, adress should be 0x4, not 0x04

modbus_controller:

  • id: must_inverter
    address: 0x04
    modbus_id: modbus_inverter
    command_throttle: 200ms
    setup_priority: -10
    update_interval: ${updates}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment