Eastron 630+usr-dr302

Hej koledzy
do tej pory pobieram dane z licznika poprzez konwerter USB/485, poniżej to co mi działa.
Chciałbym bardzo to samo robić za pomocą USR-DR302, ale wybitnie mi nie wychodzi :frowning:

Czy ktoś z Szanownych Kolegów ma jakieś pozytywne doświadczenia w tym temacie?

To mi nie działa:

# 
modbus:
- name: hub1
  type: tcp
  host: 192.168.1.10
  port: 502
  delay: 0
  message_wait_milliseconds: 30
  timeout: 5


- address: 0x0
  data_type: float32
  input_type: input
  name: Phase 1 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V

To mi działa

# Licznik SDM630
name: hub1
type: serial
baudrate: 9600
#port: /dev/serial/by-id/usb-FTDI_USB__-__Serial_Cable_AVTMOD03-if00-port0
port: /dev/ttyUSB0
#startbits: 1
bytesize: 8
method: rtu
parity: N
stopbits: 1

delay: 0
message_wait_milliseconds: 30
#retries: 3
timeout: 5
#timeout: 2
sensors:


- address: 0x0
  data_type: float32
  input_type: input
  name: Phase 1 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x2
  data_type: float32
  input_type: input
  name: Phase 2 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V

Tak… licznik bardzo miły a konwerter mało kapryśny… polecam :+1:

Kolego możesz wyartykułować czego czekujesz?

No ja jestem zaskoczony, bo oba te YAMLe, które powklejałeś są jakieś ubogie we wcięcia, ale nie linkujesz do żadnej dokumentacji, to nie mam z czym porównać, a szukać źródła skąd je wyczesałeś mi się nie chce…

ale porównując choćby z dokumentacją integracji modbus w HA

to tam sporo spacji brakuje… (biały znak - spacja jest elementem sterującym YAMLa!)
nie wiem - może próbujesz używać tabulatorów zamiast spacji?

Oczekiwał bym wsparcia w edycji pliku modbus.yaml, i w konfiguracji USR-DR302.
Chwilowo doszedłem do ściany i taka konfiguracja sypie błędami:

# Example yaml: full tcp-rtu connection
modbus:
- name: hub1
  type: rtuovertcp
  host: 192.168.1.10
  port: 502
  delay: 0
  message_wait_milliseconds: 30
  timeout: 5


- address: 0x0
  data_type: float32
  input_type: input
  name: Phase 1 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x2
  data_type: float32
  input_type: input
  name: Phase 2 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x4
  data_type: float32
  input_type: input
  name: Phase 3 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x06
  data_type: float32
  input_type: input
  name: Phase 1 current
  precision: 2
  slave: 1
  unit_of_measurement: A
  
- address: 0x08
  data_type: float32
  input_type: input
  name: Phase 2 current
  precision: 2
  slave: 1
  unit_of_measurement: A
  
- address: 0x0a
  data_type: float32
  input_type: input
  name: Phase 3 current
  precision: 2
  slave: 1
  unit_of_measurement: A






- address: 0x0c
  data_type: float32
  input_type: input
  name: Faza 1 power
  precision: 2
  slave: 1
  unit_of_measurement: W
#  device_class: energy
#  state_class: total_increasing

- address: 0x0e
  data_type: float32
  input_type: input
  name: Faza 2 power
  precision: 2
  slave: 1
  unit_of_measurement: W
#  device_class: energy
#  state_class: total_increasing
  
- address: 0x10
  data_type: float32
  input_type: input
  name: Faza 3 power
  precision: 2
  slave: 1
  unit_of_measurement: W
#  device_class: energy
#  state_class: total_increasing
  
- address: 0x34
  data_type: float32
  input_type: input
  name: Total system power.
  precision: 2
  slave: 1
  unit_of_measurement: W
  device_class: energy
  state_class: total_increasing
  
- address: 0x4a
  data_type: float32
  input_type: input
  name: Total Export kWh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x48
  data_type: float32
  input_type: input
  name: Total Import kWh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x156
  data_type: float32
  input_type: input
  name: Total kwh(3)
  precision: 2
  slave: 1
  unit_of_measurement: W
  device_class: energy
  state_class: total_increasing

- address: 0x15A
  data_type: float32
  input_type: input
  name: L1 import kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x15C
  data_type: float32
  input_type: input
  name: L2 import kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x15E
  data_type: float32
  input_type: input
  name: L3 import kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing

- address: 0x160
  data_type: float32
  input_type: input
  name: L1 export kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x162
  data_type: float32
  input_type: input
  name: L2 export kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x164
  data_type: float32
  input_type: input
  name: L3 export kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x46
  data_type: float32
  input_type: input
  name: Frequency of supply voltages
  precision: 2
  slave: 1
  unit_of_measurement: Hz
  device_class: energy
  #state_class: total_increasing

Tak samo masz ustawione w konwerterze?
A te tajemnicze błędy to składni czy komunikacji?
Zacznij od prawidłowych ustawień - Instrukcja od str.30
4.6. Modbus Gateway

Powinno sypać błędami, bo tam brakuje setek spacji, używaj znaczników kodu, w przeciwnym razie to co wklejasz jest nieczytelne dla innych.

próbowalem type: rtuovertcp itype: tcp

U mnie działa taka konfiguracja w pliku configuration.yaml HomeAssistant

modbus:
  - name: modbus_hub
    type: rtuovertcp
    host: 192.168.50.8
    port: 502
    sensors:
      - name: mod_bus_status_falownika
        unique_id: mod_bus_status_falownika
        scan_interval: 1
        address: 0
        slave: 1
        data_type: int16
        slave_count: 0
        precision: 0
        scale: 1

dzięki Darku, czyli na pewno musi być rtuovertcp (nie tcp)

U mnie działa
mój konwerter Konwerter
i taka konfiguracja działa, w samym konwerterze mam następującą konfigurację

Zależy co masz ustawione
modtcp

w zakładce serial port

jaki work mode TCT serwer czy TCP client?
czy podawać IP HA dla ustawiń client?

Takie są moje ustawienia i to działa



mam tak jak u Ciebie
ale wpisze:

modbus:
  - name: modbus_hub
    type: rtuovertcp
    host: 192.168.1.10
    port: 502

to już pokazuje błędy w narzędziach deweloperskich

Zadam banalne pytanie. IP i port masz właściwy ? a sensory dodajesz w configuration.yaml HomeAssistant ?


###### - ModBus - #########
modbus:
  - name: modbus_hub
    type: rtuovertcp
    host: 192.168.50.8
    port: 502
    sensors:
      - name: mod_bus_status_falownika
        unique_id: mod_bus_status_falownika
        scan_interval: 1
        address: 0
        slave: 1
        data_type: int16
        slave_count: 0
        precision: 0
        scale: 1

Cześć

Aktualnie działa poprawnie mi na konwerterze USB/RS485.
Jak próbuje zastosować rekomendowany na stronie HA kod dla rtuovertcp to narzędzia deweloperskie od razu pokazują błąd (natomiast edytor waliduje kod na zielono)

Kolego, bardzo chciałbym Ci podziękować, już kiedyś bardzo mi pomogłeś :grinning:
problemem okazał się jednak sprzęt, z desperacji kupiłem inny (Waveshare) i wystartowało wszystko od palca.
Jeżeli chodzi o wcięcia to nie wiem jak cytować kod, tak żeby potem kogoś go mógł użyć,
poniżej gotowy kod do użycia

name: USR-DR302
type: rtuovertcp
host: 192.168.1.10
port: 502

delay: 0
message_wait_milliseconds: 30
#retries: 3
timeout: 5
#timeout: 2
sensors:


- address: 0x0
  data_type: float32
  input_type: input
  name: Phase 1 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x2
  data_type: float32
  input_type: input
  name: Phase 2 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x4
  data_type: float32
  input_type: input
  name: Phase 3 line to neutral volts
  precision: 2
  slave: 1
  unit_of_measurement: V
  
- address: 0x06
  data_type: float32
  input_type: input
  name: Phase 1 current
  precision: 2
  slave: 1
  unit_of_measurement: A
  
- address: 0x08
  data_type: float32
  input_type: input
  name: Phase 2 current
  precision: 2
  slave: 1
  unit_of_measurement: A
  
- address: 0x0a
  data_type: float32
  input_type: input
  name: Phase 3 current
  precision: 2
  slave: 1
  unit_of_measurement: A






- address: 0x0c
  data_type: float32
  input_type: input
  name: Faza 1 power
  precision: 2
  slave: 1
  unit_of_measurement: W
#  device_class: energy
#  state_class: total_increasing

- address: 0x0e
  data_type: float32
  input_type: input
  name: Faza 2 power
  precision: 2
  slave: 1
  unit_of_measurement: W
#  device_class: energy
#  state_class: total_increasing
  
- address: 0x10
  data_type: float32
  input_type: input
  name: Faza 3 power
  precision: 2
  slave: 1
  unit_of_measurement: W
#  device_class: energy
#  state_class: total_increasing
  
- address: 0x34
  data_type: float32
  input_type: input
  name: Total system power.
  precision: 2
  slave: 1
  unit_of_measurement: W
  device_class: energy
  state_class: total_increasing
  
- address: 0x4a
  data_type: float32
  input_type: input
  name: Total Export kWh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x48
  data_type: float32
  input_type: input
  name: Total Import kWh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x156
  data_type: float32
  input_type: input
  name: Total kwh(3)
  precision: 2
  slave: 1
  unit_of_measurement: W
  device_class: energy
  state_class: total_increasing

- address: 0x15A
  data_type: float32
  input_type: input
  name: L1 import kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x15C
  data_type: float32
  input_type: input
  name: L2 import kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x15E
  data_type: float32
  input_type: input
  name: L3 import kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing

- address: 0x160
  data_type: float32
  input_type: input
  name: L1 export kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x162
  data_type: float32
  input_type: input
  name: L2 export kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x164
  data_type: float32
  input_type: input
  name: L3 export kwh
  precision: 2
  slave: 1
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
  
- address: 0x46
  data_type: float32
  input_type: input
  name: Frequency of supply voltages
  precision: 2
  slave: 1
  unit_of_measurement: Hz
  device_class: energy
  #state_class: total_increasing

@Dominik_Lewiński… Totalny stek…niekonsekwencji w tym co pisałeś i co rzekomo poprawiło sprawę.