Witam Was serdecznie,
Zabrałem się za przenoszenie czego można na kable.
Zakupiłem kartę 8 przekaźników sterowanych Modbusem - wymaga parity N
Posiadam licznik energii DDM18SD oraz RS485 → Zamel RXM-01 - wymagają parity E
Jak to ustawić na jednym urządzeniu?
Jeśli robię tak:
zawartość coniguration.yaml:
modbus:
#- type: tcp
# host: 192.168.0.254
# port: 502
- name: "parityN"
type: serial
method: rtu
port: /dev/ttyUSB1
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N # Dla Zamela i licznika ma być E, dla Relaya N
timeout: 1
retry_on_empty: true
# message_wait_milliseconds: 5
switches:
- name: 01 Grzejnik Sypialnia # ON 02 06 0001 0100 D9A9 OFF 02 06 0001 0200 D959
unique_id: relay1
slave: 2 # 02
write_type: holding # 06
address: 1 # 0001
command_on: 256 # 0100
command_off: 512 # 0200
verify: # 02 03 0001 0001 D5 CA
# input_type: holding # 03 Nie trzeba podawać jak ten sam typ co write_type
# address: 1 # 0001 Nie trzeba podawać jak ten sam co wyżej
state_on: 1
state_off: 0
- name: 02 Grzejnik Łazienka
unique_id: relay2
slave: 2
write_type: holding #06
address: 2
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: 03 Grzejnik Salon
unique_id: relay3
slave: 2
address: 3
write_type: holding
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: 04 Grzejnik Kuchnia
unique_id: relay4
slave: 2
address: 4
write_type: holding
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: 05 Głośniki sypialnia
unique_id: relay5
slave: 2
address: 5
write_type: holding
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: 06 Girlanda
unique_id: relay6
slave: 2
address: 6
write_type: holding
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: 07 Przekaźnik
unique_id: relay7
slave: 2
address: 7
write_type: holding
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: 08 Karmnik
unique_id: relay8
slave: 2
address: 8
write_type: holding
command_on: 256
command_off: 512
verify:
state_on: 1
state_off: 0
- name: "parityE"
type: serial
method: rtu
port: /dev/ttyUSB1
baudrate: 9600
stopbits: 1
bytesize: 8
parity: E # Dla Zamela i licznika ma być E, dla Relaya N
timeout: 1
switches:
- name: Zamel1 # Wciśnięty 01 05 0000 FF00 8C3A puszczony 01 05 0000 0000 CDCA
slave: 1 # 01
write_type: coil # 05
address: 0 # 0000
command_on: 65280 # FF00
command_off: 0 # 0000
- name: Zamel2 # OFF 01 05 0001 FF00 DDFA
slave: 1
address: 1
write_type: coil
command_on: 65280 # FF00
command_off: 0 # 0000
# Licznik energii DDM18SD w szafie
sensors:
- name: Szafa Licznik Napięcie
unit_of_measurement: V
device_class: power
slave: 16
address: 0
input_type: input
count: 2
precision: 2
data_type: float32
- name: Szafa Licznik Natężenie
unit_of_measurement: A
device_class: power
slave: 16
address: 8
input_type: input
count: 2
precision: 2
data_type: float32
- name: Szafa Licznik Chwilowe
unit_of_measurement: W
device_class: power
slave: 16
address: 18
input_type: input
count: 2
precision: 2
data_type: float32
- name: Szafa Licznik Całkowite
unit_of_measurement: kWh
device_class: power
slave: 16
address: 256
input_type: input
count: 2
precision: 2
data_type: float32
To wywala w logach “Modbus parityE contains duplicate host/port /dev/ttyUSB1, not loaded!”
Jeśli zrobię tylko jednego huba Modbus z parity E lub N to działają odpowiednio urządzenia z parity E albo z N (dość logiczne ).
Jak to ugryźć?