Witam, potrzebuje pomocy w wyciągnięciu danych temperatury w HA z modułów w temacie.
Wcześniej podłączyłem moduły do komputera za pomocą konwertera USB, ustawiłem nowe adresy slave, robiłem próby odczytu temperatury z czujników DS18B20 i sprawdzałem stany wejść w przypadku WP8026 - wszystko działało.
Próbuje zrobić odczyt w HA i nie mogę nawiązać połączenia/odczytu.
Wrzucam treść kodu z modbus.yaml
- name: modbus_hub
type: tcp
host: 192.168.18.200
port: 502
sensors:
- name: Temperatura 1
unit_of_measurement: °C
address: 0
slave: 3
input_type: input
device_class: temperature
- name: Temperatura 2
unit_of_measurement: °C
address: 1
slave: 3
input_type: input
device_class: temperature
- name: Temperatura 3
unit_of_measurement: °C
address: 2
slave: 3
input_type: input
device_class: temperature
Poradziłem sobie z odczytem temperatury z WP3066
Oto kod:
sensors:
- name: Temperatura 1
unit_of_measurement: °C
address: 0
slave: 3
input_type: input
device_class: temperature
scale: 0.1
precision: 1
- name: Temperatura 2
unit_of_measurement: °C
address: 1
slave: 3
input_type: input
device_class: temperature
scale: 0.1
precision: 1
- name: Temperatura 3
unit_of_measurement: °C
address: 2
slave: 3
input_type: input
device_class: temperature
scale: 0.1
precision: 1
- name: Temperatura 4
unit_of_measurement: °C
address: 3
slave: 3
input_type: input
device_class: temperature
scale: 0.1
precision: 1
Mam jednak nadal problem z czytaniem stanu wejść z WP8026, jest to moduł który ma 16 wejść cyfrowych, nie wiem jak napisać kod aby były dostępne encje.
Mój kod:
- name: Wejście 1
address: 0
slave: 5
input_type: input
- name: Wejście 2
address: 1
slave: 5
input_type: holding
- name: Wejście 3
address: 2
slave: 5
input_type: input
Próbowałem różnych konfiguracji ale encja pokazuje stan zawsze 0, bez względu na to jaki jest stan faktyczny wejścia
Nie używam, ale z dokumentacji czujnik binarny
binary_sensors:
- name: Wejscie
address: 1
device_class: none
input_type: coil
scan_interval: 15
slave: 5
slave_count: 0
unique_id: input1
Po kilku dniach prób udało mi się uruchomić cyfrowe wejścia.
Oto kod:
binary_sensors:
- name: wp8026
address: 0
input_type: discrete_input
scan_interval: 15
slave: 5
slave_count: 15
unique_id: digital_input
- name: Wejscie 1
address: 0
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 2
address: 1
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 3
address: 2
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 4
address: 3
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 5
address: 4
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 6
address: 5
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 7
address: 6
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 8
address: 7
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 9
address: 8
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 10
address: 9
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 11
address: 10
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 12
address: 11
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 13
address: 12
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 14
address: 13
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 15
address: 14
slave: 5
input_type: discrete_input
scan_interval: 1
- name: Wejscie 16
address: 15
slave: 5
input_type: discrete_input
scan_interval: 1
Stany wejść poszczególnych adresów są widzialnie w rejestrze encji
Potrzebowałbym jedynie wskazówki, w jaki sposób mogę się pozbyć "laga", w jaki sposób to zoptymalizować, ponieważ na wejścia cyfrowe będą podłączone łączniki dzwonkowe które będą zapalały światło. Chce uniknąć sytuacji gdzie szybkie kliknięcie nie zarejestruje zmiany stanu wejściowego. Stworzyłem sobie pomocnika który przekaźnikiem sterowalnym załącza mi wejście cyfrowe, widać że zmiana stanu wejściowego danego adresu potrafi nastąpić różnie. Czy możemy ustawić gdzieś w protokole na częstsze odświeżanie?
Trochę poczytałem i nie zejdę z interwałem skanu poniżej 1s. Dla przycisku który steruje oświetleniem to za dużo, bo nie zawsze zdąży być odnotowana zmiana stanu wejścia podczas naciśnięcia klawisza.
Przeglądając sieć trafiłem na wątek https://community.home-assistant.io/t/problem-with-scan-interval/139031/15?fbclid=IwY2xjawJX5aBleHRuA2FlbQIxMAABHbLZhVSH_IyjxWtEHibYJgNuFMIvInC7WMBRYS_60978NqVEUBEqS-zZlg_aem_8xaRDI9XA4AEpSKe9vizJw
Jest tam opisane w jaki sposób udało się zejść do 100ms, tworząc skrypt w pythonie który działa w jakimś kontenerze.
Ktoś pomoże to zaimplementować?



