chris-kuhr
(Christoph Kuhr)
October 20, 2020, 10:48am
1
Hi *,
I want to integrate some Modbus devices (e.g. MPPT Controller) into HA.
I ordered a first test subject from waveshare (RS485 To ETH), but I cannot read any value from the device. The manuel mentions some modbus gateway mode which I cannot find in the web UI.
Maybe someone can help with the waveshare device?
Anyways, my actual question is, what modbus TCP gateway devices would you recommend for painless integration into HA?
Best
Ck
2 Likes
krakers
(krakers)
October 20, 2020, 1:51pm
2
I have this converter working with HA for some time. Indeed it was painful to set it up initially, but now works fine.
Mind itâs not Modbus TCP, but RTU over TCP. Itâs different thing. Share some screenshots and your HA config.
1 Like
chris-kuhr
(Christoph Kuhr)
October 20, 2020, 2:02pm
3
The RS485 To ETH config:
My HA config:
modbus:
name: ModbusTCPPV
type: rtuovertcp
host: 10.4.149.17
port: 8888
# Sensors
sensor:
- platform: modbus
registers:
- name: Sensor1_Modbus
hub: ModbusTCPPV
unit_of_measurement: V
slave: 255
register: 3303
I can send messages but do not receive any. See screenshot 3.
The Modbus integration docs suggest 255 for slave.
register 3303 is in hex notation. I suppose I need decimal notation?
Thanks!
krakers
(krakers)
October 20, 2020, 2:13pm
4
Yes, you need decimal notation.
For the slave number you should have it somewhere in slave documentation. In my case I can see it being called Modbus ID or Modbus address .
2 Likes
chris-kuhr
(Christoph Kuhr)
October 21, 2020, 4:10am
5
Now it is working! Thank you very much. I had the fear that this would also take for ever to set it up. But it works pretty well.
1 Like
I am trying a similar configuration with a temperature sensor, but I have a problem with the âregisterâ value. How can I find her? Where can I read it?
I am using a TTL / RS485 converter and a RS485 converter - Ethernet - Cortex M0 - Waveshare 16529.
For the value âregisterâ 40001 Home Assistant displays the value -1
kostas2911
(Kostas Injeyan)
January 17, 2022, 5:56pm
7
I have the same converter but cannot make it work.
Can you please share your configuration?
chris-kuhr
(Christoph Kuhr)
January 17, 2022, 6:32pm
8
Here is my modbus config in HA:
modbus:
- name: ModbusTCPPV
type: rtuovertcp
host: 10.4.149.17
port: 8888
sensors:
- name: Modbus_PV_Vin
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 12544
input_type: input
- name: Modbus_PV_Iin
unit_of_measurement: A
scale: 0.01
precision: 2
slave: 1
address: 12545
input_type: input
- name: Modbus_PV_Ipow_L
unit_of_measurement: W
scale: 0.01
precision: 2
slave: 1
address: 12546
input_type: input
- name: Modbus_PV_Ipow_H
unit_of_measurement: W
scale: 0.01
precision: 2
slave: 1
address: 12547
input_type: input
- name: Modbus_Load_V
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 12556
input_type: input
- name: Modbus_Load_I
unit_of_measurement: A
scale: 0.01
precision: 2
slave: 1
address: 12557
input_type: input
- name: Modbus_Loadpow_L
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 12558
input_type: input
- name: Modbus_Loadpow_H
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 12559
input_type: input
- name: Modbus_Batt_Temp
unit_of_measurement: "°C"
scale: 0.01
precision: 2
slave: 1
address: 12560
input_type: input
- name: Modbus_Dev_Temp
unit_of_measurement: "°C"
scale: 0.01
precision: 2
slave: 1
address: 12561
input_type: input
- name: Modbus_Batt_SOC
unit_of_measurement: "%"
slave: 1
#12570
address: 12570
input_type: input
- name: Modbus_Batt_real_V
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 12573
input_type: input
- name: Modbus_Batt_status
slave: 1
address: 12800
input_type: input
- name: Modbus_Charging_Eqpmnt_status
slave: 1
address: 12801
input_type: input
- name: Modbus_Discharging_Eqpmnt_status
slave: 1
address: 12802
input_type: input
- name: Modbus_Batt_Max_V_Today
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 13058
input_type: input
- name: Modbus_Batt_Min_V_Today
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 13059
input_type: input
#register: 3303
#holding
- name: Modbus_Consumed_E_Today_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13060
input_type: input
- name: Modbus_Consumed_E_Today_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13061
input_type: input
- name: Modbus_Consumed_E_Month_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13062
input_type: input
- name: Modbus_Consumed_E_Month_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13063
input_type: input
- name: Modbus_Consumed_E_Year_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13064
input_type: input
- name: Modbus_Consumed_E_Year_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13065
input_type: input
- name: Modbus_Consumed_E_Total_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13066
input_type: input
- name: Modbus_Consumed_E_Total_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13067
input_type: input
- name: Modbus_Generated_E_Today_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13068
input_type: input
- name: Modbus_Generated_E_Today_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13069
input_type: input
- name: Modbus_Generated_E_Month_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13070
input_type: input
- name: Modbus_Generated_E_Month_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13071
input_type: input
- name: Modbus_Generated_E_Year_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13072
input_type: input
- name: Modbus_Generated_E_Year_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13073
input_type: input
- name: Modbus_Generated_E_Total_L
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13074
input_type: input
- name: Modbus_Generated_E_Total_H
unit_of_measurement: kWh
scale: 0.01
precision: 2
slave: 1
address: 13075
input_type: input
- name: Modbus_Batt_V
unit_of_measurement: V
scale: 0.01
precision: 2
slave: 1
address: 13082
input_type: input
- name: Modbus_Batt_I_L
unit_of_measurement: A
scale: 0.01
precision: 2
slave: 1
address: 13083
input_type: input
- name: Modbus_Batt_I_H
unit_of_measurement: A
scale: 0.01
precision: 2
slave: 1
address: 13084
input_type: input
sensor:
- platform: min_max
name: min_pv_battery_level
type: min
entity_ids:
- sensor.Modbus_Batt_SOC
And here my gateway config:
Ignore the âRemote Server Addrâ. It is wrong since I receive a DHCP lease and this is the default static IP.
1 Like
This config worked for me:
Converter: RS485 TO ETH (B) - Waveshare Wiki
Slave: Rs485 4-20ma Soil Temperature Humidity Moisture Conductivity Ec Ph Sensor - Iot Accessories - AliExpress
Screenshot from VirCon:
(IP is bound with a static lease)
HA:
modbus:
- name: ModbusGW1
type: tcp
host: 0.0.0.0 <put your IP here
port: 502 <your port
sensors:
- name: garten_hecke_sens01_feucht
device_class: humidity
unit_of_measurement: "%"
scale: 0.1
precision: 1
slave: 1
address: 0
input_type: input
scan_interval: 600
- name: garten_hecke_sens01_temp
device_class: temperature
unit_of_measurement: "°C"
scale: 0.1
precision: 1
slave: 1
address: 1
input_type: input
scan_interval: 3600
- name: garten_hecke_sens01_ph
unit_of_measurement: "pH"
scale: 0.1
precision: 1
slave: 1
address: 3
input_type: input
scan_interval: 3600
Note I added scan_interval, else HA would poll values on a seconds basis, which is useless for my garden application.
Handy tool for checking your bus and whatâs on it at what adresses before getting HA into the picture: Download
I am planning to use this to water my garden based on soil humidity instead of some weather based calculations
1 Like
Mattie
(Mattias)
November 4, 2022, 9:12pm
10
Can you post a ink to the exact product you bought? Was it his one? RS485 to Ethernet Converter
I have a regulator with a RS485 (network like jack) wich I want to get data from. But I dont understand how to connect the one I linked. Do i still use the RS485 port to this gateway?
BerndF
(Bernd Fiedler)
July 2, 2023, 8:57am
12
hello Chris, which MPPT controller did you integrate into HA via Modbus TCP?
SRNE controllers?
BerndF
(Bernd Fiedler)
July 2, 2023, 10:05am
13
Hallo Kollege, ich mal deinen schöne Beispiel Code ĂŒbernommen und bekomme jetzt folgende Fehlermeldung:
âKonfiguration fehlerhaft!
Invalid config for [modbus]: expected int for dictionary value @ data[âmodbusâ][1][âsensorsâ][9][âslaveâ]. Got None string value is None for dictionary value @ data[âmodbusâ][1][âsensorsâ][9][âunit_of_measurementâ]. Got None. (See /config/configuration.yaml, line 370).â
Was mache ich falsch bzw was habe ich vergessen in Zeile 370 ?
chris-kuhr
(Christoph Kuhr)
July 2, 2023, 5:02pm
14
Hast Du schon âtype: rtuovertcpâ ausproviert?
chris-kuhr
(Christoph Kuhr)
July 2, 2023, 5:06pm
15
EPEver Tracer5415 and Tracer10420.
BerndF
(Bernd Fiedler)
July 10, 2023, 3:17pm
17
Hallo Kollege,ich möchte die Daten eines MPPT Laderegler âSRNE ML 4860â (gibt es auch / unter in diversen Varianten / Bezeichnungen) per Modbus TCP mittels WAVESHARE - Gateway ( RS485-TO-ETH) lesen.
Habe mal die Screenshots meiner Einstellung beigefĂŒgt. Vielleicht entdeckt ihr auf Anhieb fehlerhafte Einstellungen die zum Erfolg fĂŒhren könnten
Ich danke euch schon mal ganz ganz herzlich .