One same zaraportują zmianę stanu, ale to może zająć kilka godzin - to jest cena tego, że taki czujnik żyje na baterii rok albo dłużej.endrju_88 wrote: Sat Feb 01, 2025 7:50 am Cześć Wam. Czy jest szansa na zaradzenie problemowi jakim jest : gdy wyłączasz bramkę z prądu i ją załączasz to trzeba podejść do każdego czujnika temperatury i szpilka wcisnąć 1x micro switch aby prawidłowy pomiar powrócił i nie wyświetlał - - - .Jak ma się ich 2 szt. to nie problem , a co jak ich będzie z 20. Śledzę projekt i mocno kibicuję Twórcy i osobom udzielającym się w rozwój funkcjonalności. Dobra robota !!! Pozdrawiam
Dyskusja ogólna [bramka Zigbee]
Moderator: vajera
-
vajera
- Posts: 7293
- Joined: Wed Oct 31, 2018 7:58 am
- Location: Biedrusko
- Has thanked: 291 times
- Been thanked: 161 times
Bramka Zigbee <=> SUPLA
Więcej informacji tutaj:
https://forum.supla.org/viewforum.php?f=127
FAQ https://forum.supla.org/viewtopic.php?t=17277
Więcej informacji tutaj:
https://forum.supla.org/viewforum.php?f=127
FAQ https://forum.supla.org/viewtopic.php?t=17277
Jeśli tak, to ok. i nie ma tematu. Myślałem , że wogóle się nie połącząvajera wrote: Sat Feb 01, 2025 8:01 amOne same zaraportują zmianę stanu, ale to może zająć kilka godzin - to jest cena tego, że taki czujnik żyje na baterii rok albo dłużej.endrju_88 wrote: Sat Feb 01, 2025 7:50 am Cześć Wam. Czy jest szansa na zaradzenie problemowi jakim jest : gdy wyłączasz bramkę z prądu i ją załączasz to trzeba podejść do każdego czujnika temperatury i szpilka wcisnąć 1x micro switch aby prawidłowy pomiar powrócił i nie wyświetlał - - - .Jak ma się ich 2 szt. to nie problem , a co jak ich będzie z 20. Śledzę projekt i mocno kibicuję Twórcy i osobom udzielającym się w rozwój funkcjonalności. Dobra robota !!! Pozdrawiam
-
[email protected]
- Posts: 1586
- Joined: Mon Feb 06, 2023 8:56 am
- Has thanked: 18 times
- Been thanked: 26 times
@vajera masz dwa małe kwiatki w kodzie
z ZigbeeHandlers.cpp nie zwraca zawsze wartości , brakuje Ci za IFem return false;
W repozytorium masz plik "Z2S_device_database.h" a w includach masz "Z2S_Device_Database.h" - zwróć uwagę na małe/duże litery, może Arduino ma wywalone ale Platform.io nie przepuści
+ zrobiłem update z logami z przycisków 4x3 : viewtopic.php?p=196828#p196828
Wygląda na to, że tu będzie potrzebny debouncing bo dwa razy odbiera wiadomość i robi 2x toggle, widziałeś to może przy swoim włączniku?
A dla wszystkich chcących kompilować pod Platform.io jest wersja aktualna: https://github.com/rkalwak/ZigbeeToSupla
Dzięki @krycha88 za podpowiedź, aczkolwiek robiłem to samo 3 raz i za 3 poszło xD
Dodałem też logowanie do pliku, nie trzeba kombinować z kopiowaniem z konsoli
W konsoli są też kolorowe poziomy logowania
Odpowiedzialna za to flaga to:
-D CONFIG_ARDUHAL_LOG_COLORS=1
Code: Select all
static bool zb_raw_cmd_handler(uint8_t bufid)W repozytorium masz plik "Z2S_device_database.h" a w includach masz "Z2S_Device_Database.h" - zwróć uwagę na małe/duże litery, może Arduino ma wywalone ale Platform.io nie przepuści
+ zrobiłem update z logami z przycisków 4x3 : viewtopic.php?p=196828#p196828
Wygląda na to, że tu będzie potrzebny debouncing bo dwa razy odbiera wiadomość i robi 2x toggle, widziałeś to może przy swoim włączniku?
A dla wszystkich chcących kompilować pod Platform.io jest wersja aktualna: https://github.com/rkalwak/ZigbeeToSupla
Dzięki @krycha88 za podpowiedź, aczkolwiek robiłem to samo 3 raz i za 3 poszło xD
Dodałem też logowanie do pliku, nie trzeba kombinować z kopiowaniem z konsoli
W konsoli są też kolorowe poziomy logowania
Odpowiedzialna za to flaga to:
-D CONFIG_ARDUHAL_LOG_COLORS=1
No to ja mam szczęście
Wiem też, że siedzisz w tym nie od dziś, ale czasem jakaś prosta sprawa może umknąć (np. aktualizacja biblioteki), więc pozwoliłem sobie napisać w jakich warunkach u mnie działa. Pozdrawiam
Wiesz, że Supla obsługuje Zigbee? Wstąp do Klubu Promila: https://forum.supla.org/viewtopic.php?t=18018
Szukasz nowego GG? Jest tutaj: https://forum.supla.org/viewtopic.php?t=18036Dzięki wielkie. Jak znajdę czas przez weekend, to sobie protestuję[email protected] wrote: Sat Feb 01, 2025 9:26 am [...]
A dla wszystkich chcących kompilować pod Platform.io jest wersja aktualna: https://github.com/rkalwak/ZigbeeToSupla
Dzięki @krycha88 za podpowiedź, aczkolwiek robiłem to samo 3 raz i za 3 poszło xD
Dodałem też logowanie do pliku, nie trzeba kombinować z kopiowaniem z konsoli
W konsoli są też kolorowe poziomy logowania![]()
Odpowiedzialna za to flaga to:
-D CONFIG_ARDUHAL_LOG_COLORS=1
Wiesz, że Supla obsługuje Zigbee? Wstąp do Klubu Promila: https://forum.supla.org/viewtopic.php?t=18018
Szukasz nowego GG? Jest tutaj: https://forum.supla.org/viewtopic.php?t=18036Witam.
2 urządzenia od wczoraj nie raportują stanu baterii
2 urządzenia od wczoraj nie raportują stanu baterii
Code: Select all
11:51:24.254 -> [530081][I][ZigbeeEP.cpp:223] zbReadBasicCluster(): Peer Manufacturer is "_TZ3000_fllyghyj"
11:51:24.254 -> [530051][I][Z2S_Device_Scanner.ino:88] loop(): manufacturer _TZ3000_fllyghyj
11:51:24.370 -> [530198][I][ZigbeeHandlers.cpp:21] zb_action_handler(): Receive Zigbee action(0x1000) callback
11:51:24.370 -> [530199][V][ZigbeeHandlers.cpp:94] zb_cmd_read_attr_resp_handler(): Read attribute response: from address(0xb4ac) src endpoint(1) to dst endpoint(1) cluster(0x0)
11:51:24.370 -> [530199][V][ZigbeeHandlers.cpp:103] zb_cmd_read_attr_resp_handler(): Read attribute response: status(0), cluster(0x0), attribute(0x5), type(0x42), value(6)
11:51:24.370 -> [530200][I][ZigbeeEP.cpp:232] zbReadBasicCluster(): Peer Model is "TS0201"
11:51:24.370 -> [530082][I][Z2S_Device_Scanner.ino:89] loop(): model TS0201
11:51:24.370 -> [530201][I][ZigbeeGateway.cpp:207] zbPrintDeviceDiscovery(): short_addr_req 46252
Code: Select all
11:45:00.827 -> [146631][I][ZigbeeEP.cpp:223] zbReadBasicCluster(): Peer Manufacturer is "_TZ3000_1bwpjvlz"
11:45:00.827 -> [146554][I][Z2S_Device_Scanner.ino:88] loop(): manufacturer _TZ3000_1bwpjvlz
11:45:00.956 -> [146749][I][ZigbeeHandlers.cpp:21] zb_action_handler(): Receive Zigbee action(0x1000) callback
11:45:00.956 -> [146749][V][ZigbeeHandlers.cpp:94] zb_cmd_read_attr_resp_handler(): Read attribute response: from address(0xd24e) src endpoint(1) to dst endpoint(1) cluster(0x0)
11:45:00.956 -> [146750][V][ZigbeeHandlers.cpp:103] zb_cmd_read_attr_resp_handler(): Read attribute response: status(0), cluster(0x0), attribute(0x5), type(0x42), value(6)
11:45:00.956 -> [146751][I][ZigbeeEP.cpp:232] zbReadBasicCluster(): Peer Model is "TS0203"
11:45:00.956 -> [146633][I][Z2S_Device_Scanner.ino:89] loop(): model TS0203
11:45:00.956 -> [146752][I][ZigbeeGateway.cpp:207] zbPrintDeviceDiscovery(): short_addr_req 53838
You do not have the required permissions to view the files attached to this post.
U mnie czujnik otwarcia drzwi/okna raportuje raz na kilkanaście godzin (możliwe, ze raz na 24h). Wczoraj wieczorem sparowany, baterię zaraportował dzisiaj ok. godz. 10-11. Z kodu @vajera wynika, że jeśli kiedykolwiek zaraportuje, to się w końcu wyświetli.bokk wrote: Sat Feb 01, 2025 10:15 am Witam.
2 urządzenia od wczoraj nie raportują stanu baterii
[...]
Mam też taki czujnik zalania, który nie raportuje stanu baterii, a wysyła tylko sygnał o niskim stanie (jeśli taki wystąpi).
Może poczekaj jeszcze trochę. Ewentualnie naciśnij (krótko) przycisk parowania - czasem wymusza raportowanie wszystkiego co tam jest.
Wiesz, że Supla obsługuje Zigbee? Wstąp do Klubu Promila: https://forum.supla.org/viewtopic.php?t=18018
Szukasz nowego GG? Jest tutaj: https://forum.supla.org/viewtopic.php?t=18036-
LukiSpajder
- Posts: 1548
- Joined: Tue Aug 18, 2020 2:22 pm
- Has thanked: 25 times
- Been thanked: 34 times
@vajera - dodałeś wczoraj obsługę gniazdek i pomiaru ?
bo na pewno to moje nie działało wcześniej .
Sparowałem dziś gniazdo w związku z twoim pytanie czy te przyciski (czteroklawiszowe i te okrągłe ) maja rejestrować się w supli jako przyciski AT , chciałem zobaczyć czy gniazdko też raportuje oprócz naciśnięcia ,przytrzymanie czy podwójne klikniecie - ale nie tylko on/off .
A tu patrzę w cloudzie nowe urządzenie przekaźnik i licznik energii
i działa reakcja na przycisk błyskawiczna , sterowanie z apki błyskawiczne jakby to urządzenie działo jako wi -fi . Licznik pokazuje odczyt napięcia - wygląda prawidłowo , pomiar prądu pokazuje 319 A a powinno być 0,319 A przesunięcie . Moc -wygląda prawidłowo .
Dobra wracając do Przycisków (wyzwalaczy scen ) to jednak powinno się raportować tak jak mówi @klew jako przyciski AT i wtedy przypisać im odpowiednie zdarzenia . A przekaźnik to te gniazdka ,switche , przełączniki - opinia po dłuższych przemyśleniach
Jedynie w fazie testów to definiowanie ich jako przekaźniki jest bardzo pomocne w sprawdzaniu prawidłowego działania. I w takiej formie jakieś się rejestrują tzn. opis przycisku w rozróżnieniu na numer , naciśnijcie, dwuklik, przytrzymanie. Jedynie czy te przyciski już wszystkie się powinny połączyć bez problemu .
Decyzja należy do Ciebie - tak czy inaczej funkcjonalność przycisku będzie osiągnięta.
Logi z gniazdka :
Sparowałem dziś gniazdo w związku z twoim pytanie czy te przyciski (czteroklawiszowe i te okrągłe ) maja rejestrować się w supli jako przyciski AT , chciałem zobaczyć czy gniazdko też raportuje oprócz naciśnięcia ,przytrzymanie czy podwójne klikniecie - ale nie tylko on/off .
A tu patrzę w cloudzie nowe urządzenie przekaźnik i licznik energii
Dobra wracając do Przycisków (wyzwalaczy scen ) to jednak powinno się raportować tak jak mówi @klew jako przyciski AT i wtedy przypisać im odpowiednie zdarzenia . A przekaźnik to te gniazdka ,switche , przełączniki - opinia po dłuższych przemyśleniach
Jedynie w fazie testów to definiowanie ich jako przekaźniki jest bardzo pomocne w sprawdzaniu prawidłowego działania. I w takiej formie jakieś się rejestrują tzn. opis przycisku w rozróżnieniu na numer , naciśnijcie, dwuklik, przytrzymanie. Jedynie czy te przyciski już wszystkie się powinny połączyć bez problemu .
Decyzja należy do Ciebie - tak czy inaczej funkcjonalność przycisku będzie osiągnięta.
Logi z gniazdka :
Code: Select all
[632940][I][ZigbeeHandlers.cpp:82] zb_raw_cmd_handler(): ----------------------------raw command not processed---------------------------------------------------------------
Send: [53 55 50 4C 41 17 C8 00 00 00 28 00 00 00 10 00 00 00 E6 38 9E 67 00 00 00 00 B3 25 02 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
Recv: [53 55 50 4C 41 17 62 00 00 00 32 00 00 00 10 00 00 00 D6 2A 9E 67 00 00 00 00 D2 21 06 00 00 00 00 00 53 55 50 4C 41 ]
[663491][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[663492][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0x6)
[663492][I][ZigbeeGateway.cpp:518] zbAttributeReporting(): zbAttributeReporting on/off report OFF
[663493][I][Z2S_Devices_Table.cpp:257] Z2S_onOnOffReceive(): onOnOffReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[663493][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0xb54
Channel(19) value changed to 0
[663494][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0x6), attribute id (0x0), attribute data type (0x10)
Send: [53 55 50 4C 41 17 C9 00 00 00 67 00 00 00 0E 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
[664316][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[664316][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[664317][I][ZigbeeGateway.cpp:538] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS active power 12
[664318][I][Z2S_Devices_Table.cpp:311] Z2S_onRMSActivePowerReceive(): onRMSVoltageReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[664318][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[664319][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x50b), attribute data type (0x21)
[665326][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[665327][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[665327][I][ZigbeeGateway.cpp:532] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS current 21
[665328][I][Z2S_Devices_Table.cpp:293] Z2S_onRMSCurrentReceive(): onRMSCurrentReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[665328][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[665329][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x508), attribute data type (0x21)
[665397][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[665397][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0x6)
[665398][I][ZigbeeGateway.cpp:518] zbAttributeReporting(): zbAttributeReporting on/off report ON
[665398][I][Z2S_Devices_Table.cpp:257] Z2S_onOnOffReceive(): onOnOffReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[665399][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0xb54
Channel(19) value changed to 1
[665400][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0x6), attribute id (0x0), attribute data type (0x10)
Send: [53 55 50 4C 41 17 CA 00 00 00 67 00 00 00 0E 00 00 00 13 00 00 00 00 00 01 00 00 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
[665539][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[665539][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[665540][I][ZigbeeGateway.cpp:538] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS active power 0
[665540][I][Z2S_Devices_Table.cpp:311] Z2S_onRMSActivePowerReceive(): onRMSVoltageReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[665541][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[665542][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x50b), attribute data type (0x21)
[666336][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[666336][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[666337][I][ZigbeeGateway.cpp:538] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS active power 6
[666338][I][Z2S_Devices_Table.cpp:311] Z2S_onRMSActivePowerReceive(): onRMSVoltageReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[666338][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[666339][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x50b), attribute data type (0x21)
[667346][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[667347][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[667347][I][ZigbeeGateway.cpp:538] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS active power 12
[667348][I][Z2S_Devices_Table.cpp:311] Z2S_onRMSActivePowerReceive(): onRMSVoltageReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[667349][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[667350][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x50b), attribute data type (0x21)
Send: [53 55 50 4C 41 17 CB 00 00 00 67 00 00 00 0E 00 00 00 14 00 00 00 00 00 01 00 00 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
Send: [53 55 50 4C 41 17 CC 00 00 00 69 00 00 00 D4 00 00 00 14 0E CE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 05 00 00 00 01 00 00 00 00 00 AC 58 00 00 00 00 08 52 00 00 00 00 80 4F 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
[668402][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[668403][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[668404][I][ZigbeeGateway.cpp:538] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS active power 49
[668404][I][Z2S_Devices_Table.cpp:311] Z2S_onRMSActivePowerReceive(): onRMSVoltageReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[668405][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[668406][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x50b), attribute data type (0x21)
[669366][I][ZigbeeHandlers.cpp:34] zb_action_handler(): Receive Zigbee action(0x2000) callback
[669366][V][ZigbeeHandlers.cpp:126] zb_attribute_reporting_handler(): Received report from address(0x7d71) src endpoint(1) to dst endpoint(1) cluster(0xb04)
[669367][I][ZigbeeGateway.cpp:532] zbAttributeReporting(): zbAttributeReporting electrical measurement RMS current 396
[669368][I][Z2S_Devices_Table.cpp:293] Z2S_onRMSCurrentReceive(): onRMSCurrentReceive 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1
[669368][I][Z2S_Devices_Table.cpp:53] Z2S_findChannelNumberSlot(): Z2S_findChannelNumberSlot 0xa4:0xc1:0x38:0xd8:0xe2:0xc3:0x3d:0x77, endpoint 0x1, channel type 0x1388
[669369][I][ZigbeeGateway.cpp:570] zbAttributeReporting(): zbAttributeReporting from (0x3d77), endpoint (1), cluster (0xb04), attribute id (0x508), attribute data type (0x21)
Send: [53 55 50 4C 41 17 CD 00 00 00 67 00 00 00 0E 00 00 00 14 00 00 00 00 00 01 00 00 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
Send: [53 55 50 4C 41 17 CE 00 00 00 69 00 00 00 D4 00 00 00 14 0E CE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 10 00 00 05 00 00 00 01 00 00 00 00 00 AC 58 00 00 00 00 B0 9A 00 00 00 00 A0 C4 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
Send: [53 55 50 4C 41 ]
You do not have the required permissions to view the files attached to this post.
Kurczę nie mogę tego odnaleźć. Mógłby ktoś podesłać ten poprawiony plik. Chyba, że @Vajera poprawi o wrzuci na githuba[email protected] wrote: Sat Feb 01, 2025 7:17 amTam jest mały błąd , funkcja zwraca wynik , ale nie zawsze w definicji oraz brakuje zwrócenia domyślnie wartości i średnika za deklaracja , zajęło mi też chwilę zrozumienie o o mu chodzi
Code: Select all
virtual bool zbRawCmdHandler( esp_zb_zcl_addr_t source, uint8_t src_endpoint, uint8_t dst_endpoint, uint16_t cluster_id, uint8_t cmd_id, bool is_common_command, bool disable_default_response, bool is_manuf_specific, uint16_t manuf_specific, uint8_t buffer_size, uint8_t *buffer) { return false;};
-
[email protected]
- Posts: 1586
- Joined: Mon Feb 06, 2023 8:56 am
- Has thanked: 18 times
- Been thanked: 26 times
Sprawdziłem sobie i po zrobieniu tak jak poniżej, problem duplikatów nie występuje.[email protected] wrote: Sat Feb 01, 2025 9:26 am
Wygląda na to, że tu będzie potrzebny debouncing bo dwa razy odbiera wiadomość i robi 2x toggle, widziałeś to może przy swoim włączniku?
Chyba w tym tygodniu powieszę przycisk tam gdzie ma wisieć czyli w wiatrołapie i będzie otwierał bramy i zapalał światło w garażu.
Także @vajera wiedz, że zdalnie zadowalasz nawet czyjeś żony
Code: Select all
#ifndef SRC_SUPLA_CONTROL_VIRTUAL_RELAY_SCENE_SWITCH_H_
#define SRC_SUPLA_CONTROL_VIRTUAL_RELAY_SCENE_SWITCH_H_
#include "supla/control/virtual_relay.h"
namespace Supla
{
namespace Control
{
class VirtualRelaySceneSwitch : public VirtualRelay
{
public:
/// @brief Creates Virtual Relay channel with deboucing capabilities.
/// @param functions Supla channel functions.
/// @param debounceTimeMs Debounce time in milliseconds.
VirtualRelaySceneSwitch(_supla_int_t functions =
(0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER),
u_int16_t debounceTimeMs=100);
void turnOn(_supla_int_t duration = 0) override;
void turnOff(_supla_int_t duration = 0) override;
protected:
bool state = false;
unsigned long _lastChangeTime = 0;
u_int16_t _debounceTime = 0;
};
}; // namespace Control
}; // namespace Supla
#endif // SRC_SUPLA_CONTROL_VIRTUAL_RELAY_H_
#include "Z2S_virtual_relay_scene_switch.h"
#include <supla/log_wrapper.h>
Supla::Control::VirtualRelaySceneSwitch::VirtualRelaySceneSwitch(_supla_int_t functions, u_int16_t debounceTimeMs)
: Supla::Control::VirtualRelay(functions)
{
_lastChangeTime = millis();
_debounceTime = debounceTimeMs;
}
void Supla::Control::VirtualRelaySceneSwitch::turnOn(_supla_int_t duration)
{
unsigned long time = millis() - _lastChangeTime;
if ( time> _debounceTime)
{
VirtualRelay::turnOn(duration);
_lastChangeTime=millis();
log_i(
"Relay[%d] turn ON as following time passed (time %d ms)",
channel.getChannelNumber(),
time);
}
}
void Supla::Control::VirtualRelaySceneSwitch::turnOff(_supla_int_t duration)
{
unsigned long time = millis() - _lastChangeTime;
if (time > _debounceTime)
{
VirtualRelay::turnOff(duration);
_lastChangeTime=millis();
log_i(
"Relay[%d] turn OFF as following time passed (time %d ms)",
channel.getChannelNumber(),
time);
}
}
Code: Select all
case SUPLA_CHANNELTYPE_ACTIONTRIGGER: {
auto Supla_VirtualRelay = new Supla::Control::VirtualRelaySceneSwitch(SUPLA_CHANNELFNC_POWERSWITCH, 1000);
