Natywne wsparcie dla MQTT

dogu18
Posts: 259
Joined: Thu Oct 11, 2018 8:35 pm

Post

Takie pytanie jak w ha zmienić żeby dimmer na Supli po mqtt dostawał tylko komendę jasność bez komendy włącz? Bo mam taki efekt że światło najpierw rozbłyska na 100% a potem spada do zadanej wartości. Urzywam integracji według opisu i mqtt Discovery na ha.
Pozdrawiam
Grzegorz Labudda
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

Nie da się. Bynajmniej kiedyś się nie dało. Ha zawsze wysyła ON. Jedyną rzecz jaką możesz zmienić to, to czy będzie wysyłał przed czy po wysłaniu poziomu jasności.
SUPLA.... Nareszcie w domu.
dogu18
Posts: 259
Joined: Thu Oct 11, 2018 8:35 pm

Post

pzygmunt wrote: Mon Feb 07, 2022 7:22 pm Nie da się. Bynajmniej kiedyś się nie dało. Ha zawsze wysyła ON. Jedyną rzecz jaką możesz zmienić to, to czy będzie wysyłał przed czy po wysłaniu poziomu jasności.
Zawsze to jakaś opcja. Jak tego dokonać?
Pozdrawiam
Grzegorz Labudda
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

SUPLA.... Nareszcie w domu.
dogu18
Posts: 259
Joined: Thu Oct 11, 2018 8:35 pm

Post

pzygmunt wrote: Mon Feb 07, 2022 7:31 pm https://www.home-assistant.io/integrations/light.mqtt/
on_command_type
No tak ale to trzeba dodać na nowo urządzenie w configuration.yaml przez auto Discovery chyba się nie da edytować topicu
Pozdrawiam
Grzegorz Labudda
karnasw
Posts: 215
Joined: Fri Oct 02, 2020 10:22 am

Post

Mam problem z połączeniem się przez TLS do supli na lokalnym brokerze MQTT (bezpośrednio na malinie bez dockerów).

Mam wygenerowane certyfikaty, ustawione hasło. Bez problemu łączę się z Home Assistant do MQTT wskazując certyfikat i wpisując hasło w ustawieniach brokera. mosquitto_sub i mosquitto_pub też działa.

Próba połączenia supla zwraca niestety

Code: Select all

1644329821: New connection from 172.24.0.4:39384 on port 8883.
1644329821: Client <unknown> disconnected: Protocol error.
W konfiguracji mosquitto mam ustawione, że certyfikat nie jest wymagany, ale to chyba nie to:

Code: Select all

per_listener_settings true
listener 8883
cafile /etc/mosquitto/ca_certificates/ca.crt
keyfile /etc/mosquitto/certs/server.key
certfile /etc/mosquitto/certs/server.crt
require_certificate false
#pid_file var/run/mosquitto/mosquitto.pid
#persistence true
#persistence_location /var/lib/mosquitto
#log_dest file /var/log/mosquitto.log
allow_anonymous false
password_file /etc/mosquitto/passwd
include_dir /etc/mosquitto/conf.d
Ustawienie Supla:

Code: Select all

# MQTT Broker settings (you have to run the broker yourself)
MQTT_BROKER_ENABLED=true
MQTT_BROKER_HOST=raspberrypi
MQTT_BROKER_PORT=8883
MQTT_BROKER_TLS=true
MQTT_BROKER_USERNAME=user
MQTT_BROKER_PASSWORD=pass
MQTT_BROKER_CLIENT_ID=supla
Są jeszcze jakieś zmienne MQTT w Supli, które mogę wykorzystać jak np. wersja TLS, certyfikat?
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

Sprawdź logi supla-server
SUPLA.... Nareszcie w domu.
karnasw
Posts: 215
Joined: Fri Oct 02, 2020 10:22 am

Post

Nie widzę nic powiązanego z MQTT.

Code: Select all

pi@raspberrypi:~ $ docker logs --tail=50 supla-server
INFO[1644331977.135263] Connection accepted: 192.168.162.150:54074 ClientSD: 16 Secure: 0
INFO[1644331977.138956] Device registration started. ClientSD: 16 Protocol Version: 12 ThreadID: 32 GUID: 95A1DDB1
INFO[1644331977.181142] Device registered. ID: 25, ClientSD: 16 Protocol Version: 12 ThreadID: 32 GUID: 95A1DDB1
INFO[1644331977.181345] Connection accepted: 192.168.162.162:60206 ClientSD: 21 Secure: 0
INFO[1644331977.181495] Device registered. ID: 27, ClientSD: 14 Protocol Version: 16 ThreadID: 31 GUID: 24DB5117
INFO[1644331977.185835] Device registration started. ClientSD: 21 Protocol Version: 16 ThreadID: 33 GUID: 97026443
INFO[1644331977.188403] Connection accepted: 192.168.162.163:50816 ClientSD: 17 Secure: 0
INFO[1644331977.191541] Device registration started. ClientSD: 17 Protocol Version: 16 ThreadID: 34 GUID: F1CB0374
INFO[1644331977.205614] Connection accepted: 192.168.162.161:57393 ClientSD: 27 Secure: 0
INFO[1644331977.206398] Connection accepted: 192.168.162.156:59163 ClientSD: 31 Secure: 0
INFO[1644331977.209448] Device registration started. ClientSD: 27 Protocol Version: 16 ThreadID: 35 GUID: EC218A73
INFO[1644331977.213912] Device registration started. ClientSD: 31 Protocol Version: 12 ThreadID: 36 GUID: 15B28E9D
INFO[1644331977.217941] Device registered. ID: 28, ClientSD: 21 Protocol Version: 16 ThreadID: 33 GUID: 97026443
INFO[1644331977.224051] Connection accepted: 192.168.162.151:51349 ClientSD: 35 Secure: 0
INFO[1644331977.230620] Device registered. ID: 30, ClientSD: 17 Protocol Version: 16 ThreadID: 34 GUID: F1CB0374
INFO[1644331977.239826] Device registration started. ClientSD: 35 Protocol Version: 12 ThreadID: 37 GUID: A107EC2E
INFO[1644331977.247259] Connection accepted: 192.168.162.157:64230 ClientSD: 39 Secure: 0
INFO[1644331977.248418] Connection accepted: 192.168.162.158:62181 ClientSD: 41 Secure: 0
INFO[1644331977.257496] Device registration started. ClientSD: 41 Protocol Version: 12 ThreadID: 39 GUID: 1E9D1EC9
INFO[1644331977.263164] Device registration started. ClientSD: 39 Protocol Version: 12 ThreadID: 38 GUID: 4E4F2FC2
INFO[1644331977.267779] Device registered. ID: 26, ClientSD: 27 Protocol Version: 16 ThreadID: 35 GUID: EC218A73
INFO[1644331977.289880] Connection accepted: 192.168.162.159:51076 ClientSD: 44 Secure: 0
INFO[1644331977.296143] Device registered. ID: 24, ClientSD: 31 Protocol Version: 12 ThreadID: 36 GUID: 15B28E9D
INFO[1644331977.299514] Device registration started. ClientSD: 44 Protocol Version: 16 ThreadID: 40 GUID: 23A8EEB2
INFO[1644331977.301877] Device registered. ID: 22, ClientSD: 41 Protocol Version: 12 ThreadID: 39 GUID: 1E9D1EC9
INFO[1644331977.324480] Device registered. ID: 15, ClientSD: 35 Protocol Version: 12 ThreadID: 37 GUID: A107EC2E
INFO[1644331977.340769] Device registered. ID: 29, ClientSD: 44 Protocol Version: 16 ThreadID: 40 GUID: 23A8EEB2
INFO[1644331977.356546] Device registered. ID: 23, ClientSD: 39 Protocol Version: 12 ThreadID: 38 GUID: 4E4F2FC2
2022-02-08 14:52:58,358 INFO success: supla-scheduler entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-02-08 14:52:58,358 INFO success: supla-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO[1644332020.208204] Connection accepted: 192.168.162.164:14486 ClientSD: 10 Secure: 1
INFO[1644332020.349410] Cipher: AES128-SHA, ClientSD: 10
INFO[1644332020.466262] Device registration started. ClientSD: 10 Protocol Version: 12 ThreadID: 54 GUID: CCF52A6D
INFO[1644332020.520484] Device registered. ID: 31, ClientSD: 10 Protocol Version: 12 ThreadID: 54 GUID: CCF52A6D
INFO[1644332025.465236] Connection accepted: 192.168.162.155:22506 ClientSD: 37 Secure: 1
INFO[1644332025.571488] Cipher: AES128-SHA, ClientSD: 37
INFO[1644332025.590915] Connection accepted: 192.168.162.152:26920 ClientSD: 50 Secure: 1
INFO[1644332025.682443] Device registration started. ClientSD: 37 Protocol Version: 16 ThreadID: 61 GUID: DDE8FA4D
INFO[1644332025.696824] Cipher: AES128-SHA, ClientSD: 50
INFO[1644332025.707127] Device registered. ID: 6, ClientSD: 37 Protocol Version: 16 ThreadID: 61 GUID: DDE8FA4D
INFO[1644332025.796221] Connection accepted: 192.168.162.154:2128 ClientSD: 53 Secure: 1
INFO[1644332025.809675] Device registration started. ClientSD: 50 Protocol Version: 16 ThreadID: 62 GUID: CC8C63FD
INFO[1644332025.831907] Device registered. ID: 4, ClientSD: 50 Protocol Version: 16 ThreadID: 62 GUID: CC8C63FD
INFO[1644332025.900131] Cipher: AES128-SHA, ClientSD: 53
INFO[1644332025.910107] Connection accepted: 192.168.162.153:34026 ClientSD: 56 Secure: 1
INFO[1644332026.10663] Device registration started. ClientSD: 53 Protocol Version: 16 ThreadID: 63 GUID: 6F404B47
INFO[1644332026.14427] Cipher: AES128-SHA, ClientSD: 56
INFO[1644332026.30820] Device registered. ID: 3, ClientSD: 53 Protocol Version: 16 ThreadID: 63 GUID: 6F404B47
INFO[1644332026.124759] Device registration started. ClientSD: 56 Protocol Version: 16 ThreadID: 64 GUID: 4C5045DD
INFO[1644332026.166563] Device registered. ID: 5, ClientSD: 56 Protocol Version: 16 ThreadID: 64 GUID: 4C5045DD

User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

Może nie próbuje się w ogóle łączyć z uwagi na niekompletny config ?
SUPLA.... Nareszcie w domu.
karnasw
Posts: 215
Joined: Fri Oct 02, 2020 10:22 am

Post

W jakim sensie niekompletny? Ten od mosquitto czy ten od supli?

Return to “MQTT”