Menu główne

Czy ktoś posiada SLR-22?

Zaczęty przez admin, Październik 18, 2019, 16:56:37

Poprzedni wątek - Następny wątek

admin

Konsternacja wzrasta  ;D Robi się coraz ciekawiej... ???  Eh ten Zamel !^%@#*^!@%*@#% >:(!!! Mam pewną teorię: gdy mode = 0 to mode_val w notyfikacji z kontrolera ma wartość numeryczną, a gdy mode = 1 to mode_val to hex string.
Potwierdzimy, gdy zrobię zmiany w kodzie, ale to dopiero za godzinkę. Stay tuned ;)
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

admin

#16
OK, zrobiłem kilka istotnych zmian. Zdecydowałem, że będę składował informację o RGBW zawsze w jednolitej postaci niezależnie od Zamelowego bajzlu, więc będzie mniej konwersji i zamieszania.
Co jeszcze śmieszne i żenujące, to fakt, że Zamel chyba sam ma problem ze zrozumieniem własnego tworu, gdyż z twojego trace'a wynika, że w komendzie 37 mają dwa pola: mode_val i mode_val_string. I oba te pola trzymają w jednym przypadku string! ;D Nie dziwię się potem, że biedny programista od aplikacji ma problemy i aplikacja Exta Life miała i nadal ma mnóstwo takich małych niedociągnieć, a to coś się nie wyświetli, a to coś zniknie...Bajzel w modelu danych.

Podmień plik i zobacz czy działa. W razie czego wrzuć linie z loga tak jak poprzednio + linie ze słowem 'mode_val_hex'. Trzymam kciuki
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

SebiCo

#17
Błędy poniżej i nie działa już wizualizacja w HA


CytatFile "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/extalife/light.py", line 67, in update
    if mode_val_hex:
UnboundLocalError: local variable 'mode_val_hex' referenced before assignment


2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife.light] white value: {}
2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife.light] 'mode_val' value: 0F00EEFF
2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife.light] 'mode_val_hex' value: 0F00EEFF
2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 255, 'mode': 0}
2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 255, "mode": 0}}\x03'
2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}]
2019-12-08 20:46:07 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]



2019-12-08 20:46:07 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife.light] white value: {'hs_color': (360.0, 100.0)}
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife.light] 'mode_val' value: 0F00EEFF
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife.light] 'mode_val_hex' value: FF
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 0, 'mode': 0}
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 0, "mode": 0}}\x03'
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-08 20:46:15 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]



2019-12-08 20:46:15 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}
2019-12-08 20:46:15 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-08 20:46:15 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife.light] white value: {'hs_color': (120.0, 100.0)}
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife.light] 'mode_val' value: 0
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife.light] 'mode_val_hex' value: 0
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 0, 'mode': 0}
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 0, "mode": 0}}\x03'
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-08 20:46:19 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]








  •  

admin

Mały błąd w linii 67. Już załadowałem poprawkę. Możesz podmienić:

A czy oprócz tego, że nie działa wizualizacja w HA to włączanie i wyłączanie działa z HA działa? Można zmieniać kolory z HA?
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

admin

STOP!!! ściągnij plik jeszcze raz. Zrobiłem pomyłkę. Linia 67 byłą ok, brakowało jednej instrukcji na początku metody update()
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

admin

Wrzuciłem kolejną poprawkę - być może rozwiąże problem braku wizualizacji w HA. Chyba już dzisiaj za późno i za dużo błędów... :-\
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

SebiCo

#21
wizualizacja działa, sterowanie nie działa, błąd w logu jak niżej


File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 564, in async_request_call
    await coro
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/extalife/light.py", line 95, in turn_on
    w = int(mode_val_hex, 16) & 255    # default
TypeError: int() can't convert non-string with explicit base



2019-12-08 21:26:23 DEBUG (SyncWorker_8) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 59, 'mode_val': 0, 'mode': 0}
2019-12-08 21:26:23 DEBUG (SyncWorker_8) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 59, "mode_val": 0, "mode": 0}}\x03'
2019-12-08 21:26:23 DEBUG (SyncWorker_8) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 59, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-08 21:26:23 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 59, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-08 21:26:23 DEBUG (SyncWorker_8) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 59, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-08 21:26:23 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 59, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}
2019-12-08 21:26:23 DEBUG (SyncWorker_8) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 59, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-08 21:26:23 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 59, 'mode': 0, 'mode_val': 0}
2019-12-08 21:26:23 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-08 21:26:23 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.light] white value: {'brightness': 213}
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.light] 'mode_val' value: 0
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.light] 'mode_val_hex' value: 0
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 83, 'mode_val': 0, 'mode': 0}
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 83, "mode_val": 0, "mode": 0}}\x03'
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 83, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-08 21:26:24 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 83, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 83, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-08 21:26:24 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 83, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}
2019-12-08 21:26:24 DEBUG (SyncWorker_15) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 83, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
  •  

admin

Hmm, nie bardzo rozumiem co się dzieje. A co się zalogowało zaraz przed tym błędem w logu pod hasłem 'mode_val_hex' value:' ?? Bez tej informacji nie zgadnę co i gdzie nie działa.
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

SebiCo


[code]2019-12-08 21:25:52 DEBUG (SyncWorker_6) [custom_components.extalife.light] white value: {}
2019-12-08 21:25:52 DEBUG (SyncWorker_6) [custom_components.extalife.light] 'mode_val' value: 0F00EEFF
2019-12-08 21:25:52 DEBUG (SyncWorker_6) [custom_components.extalife.light] 'mode_val_hex' value: None
2019-12-08 21:25:59 DEBUG (SyncWorker_17) [custom_components.extalife.light] white value: {}
2019-12-08 21:25:59 DEBUG (SyncWorker_17) [custom_components.extalife.light] 'mode_val' value: 0F00EEFF
2019-12-08 21:25:59 DEBUG (SyncWorker_17) [custom_components.extalife.light] 'mode_val_hex' value: None
[/code]
  •  

admin

Nie zamierza to we właściwym kierunku... :-\ Zostawiam to już dzisiaj i jutro na świeżo spojrzę. Dzięki za szybkie reakcje u za cierpliwość  :)
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

SebiCo

Spoko, fajnie że masz ochotę się tym zajmować.
Jakby co to pisz.
  •  

admin

Wiesz co, nadal nie wiem gdzie leży przyczyna, że nie działa. Brak wartości dla tego pola nie ma dla mnie sensu i nie wiem skąd się bierze biorąc pod uwagę to, że wygląda że wartość bazowa z pola mode_val istnieje. Zmodyfikowałem więc kod i dodałem więcej logowania wartości mode_val_hex.
Linie z loga, które opisywałeś mogły wystąpić dla któregoś ROP/ROM zmapowango jako światło a nie SLR. Muszę mieć pewność, że to co znajdziesz w logu dotyczy tego SLR.
Ściągnij i podmień proszę najnowszą wersję pliku i szukaj w logu takich linii:
1. "Data update callback for entity:" oraz
2. "turn_on for entity:"
Teraz w tych liniach będzie widać które to dokładnie jest urządzenie Exta Life i jego nazwę Entity id w HA. To wykluczy potencjalnie nieistotne dla SLR linie z loga.
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

SebiCo

#27
Uwaga! ciemny test - nie mam teraz fizycznego dostępu do modułu.
wizualizacja działa. nazwa modułu -> sypialnia_rgbw

2019-12-09 12:22:35 DEBUG (SyncWorker_16) [custom_components.extalife.light] white value: {}
2019-12-09 12:22:35 DEBUG (SyncWorker_16) [custom_components.extalife.light] 'mode_val' value: FF0000FF
2019-12-09 12:22:35 DEBUG (SyncWorker_16) [custom_components.extalife.light] turn_on for entity: light.sypialnia_rgbw(10-1). mode_val_hex: None
2019-12-09 12:22:40 DEBUG (SyncWorker_7) [custom_components.extalife] Executing EFC-01 status polling....
2019-12-09 12:22:40 DEBUG (SyncWorker_7) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 37, "data": null}\x03'
2019-12-09 12:22:40 DEBUG (SyncWorker_7) [custom_components.extalife.pyextalife] resp_js: [{'command': 37, 'status': 'searching', 'data': {'devices': [{'id': 3, 'is_powered': False, 'is_paired': False, 'set_remove_sensor': False, 'device': 1, 'type': 10, 'serial': 655520, 'valid_software': True, 'response_time': 0, 'is_timeout': False, 'exta_free_device': False, 'state': [{'alias': 'sypialnia glowne', 'channel': 1, 'icon': 13, 'is_timeout': False, 'fav': None, 'power': 0, 'last_dir': None, 'value': None}]}]}, 'page': 0}]



2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.light] white value: {}
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.light] 'mode_val' value: FF0000FF
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.light] turn_on for entity: light.sypialnia_rgbw(10-1). mode_val_hex: FF0000FF
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 255, 'mode': 0}
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 255, "mode": 0}}\x03'
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}]
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:40 DEBUG (SyncWorker_6) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:40 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:40 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}]
2019-12-09 12:22:40 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:40 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}, 'status': 'notification'}
2019-12-09 12:22:40 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 255}
2019-12-09 12:22:40 DEBUG (SyncWorker_0) [custom_components.extalife.light] Data update callback for entity: light.sypialnia_rgbw(10-1). mode_val_hex: FF. mode_val: 255
2019-12-09 12:22:40 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:40 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.light] white value: {'hs_color': (240.0, 100.0)}
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.light] 'mode_val' value: 255
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.light] turn_on for entity: light.sypialnia_rgbw(10-1). mode_val_hex: FF
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 0, 'mode': 0}
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 0, "mode": 0}}\x03'
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:44 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:44 DEBUG (SyncWorker_1) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:44 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}
2019-12-09 12:22:44 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}
2019-12-09 12:22:44 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:44 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:44 DEBUG (SyncWorker_14) [custom_components.extalife.light] Data update callback for entity: light.sypialnia_rgbw(10-1). mode_val_hex: 0. mode_val: 0
2019-12-09 12:22:44 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:44 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.light] white value: {'hs_color': (360.0, 100.0)}
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.light] 'mode_val' value: 0
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.light] turn_on for entity: light.sypialnia_rgbw(10-1). mode_val_hex: 0
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 0, 'mode': 0}
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 0, "mode": 0}}\x03'
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:46 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:46 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}
2019-12-09 12:22:46 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:46 DEBUG (SyncWorker_12) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:46 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:46 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.light] white value: {'hs_color': (120.0, 100.0)}
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.light] 'mode_val' value: 0
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.light] turn_on for entity: light.sypialnia_rgbw(10-1). mode_val_hex: 0
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 0, 'mode': 0}
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 0, "mode": 0}}\x03'
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:47 DEBUG (SyncWorker_19) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:47 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:47 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:48 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:48 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}
2019-12-09 12:22:49 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.light] white value: {'hs_color': (270.0, 0.0)}
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.light] 'mode_val' value: 0
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.light] turn_on for entity: light.sypialnia_rgbw(10-1). mode_val_hex: 0
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife] Executing action TURN_ON on channel 10-1, params: {'value': 100, 'mode_val': 0, 'mode': 0}
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 20, "data": {"id": 10, "channel": 1, "state": 1, "value": 100, "mode_val": 0, "mode": 0}}\x03'
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:50 DEBUG (Thread-2) [custom_components.extalife.pyextalife] resp_js (intermediary): [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}]
2019-12-09 12:22:50 DEBUG (Thread-2) [custom_components.extalife] Received msg from Notification Listener thread: {'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] resp_js: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:50 DEBUG (SyncWorker_10) [custom_components.extalife.pyextalife] JSON response for command 20: [{'command': 20, 'data': {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}, 'status': 'notification'}, {'command': 20, 'status': 'success', 'data': None}]
2019-12-09 12:22:50 DEBUG (MainThread) [custom_components.extalife] State update notification callback for entity id: light.sypialnia_rgbw, data: {'id': 10, 'channel': 1, 'state': True, 'value': 100, 'mode': 0, 'mode_val': 0}
2019-12-09 12:22:50 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:22:50 DEBUG (MainThread) [custom_components.extalife.light] Supported flags: 145
2019-12-09 12:23:41 DEBUG (SyncWorker_3) [custom_components.extalife] Executing EFC-01 status polling....
2019-12-09 12:23:41 DEBUG (SyncWorker_3) [custom_components.extalife.pyextalife] TCP command to execute: b'{"command": 37, "data": null}\x03'
2019-12-09 12:23:41 DEBUG (SyncWorker_3) [custom_components.extalife.pyextalife] resp_js: [{'command': 37, 'status': 'searching', 'data': {'devices': [{'id': 3, 'is_powered': False, 'is_paired': False, 'set_remove_sensor': False, 'device': 1, 'type': 10, 'serial': 655520, 'valid_software': True, 'response_time': 0, 'is_timeout': False, 'exta_free_device': False, 'state': [{'alias': 'sypialnia glowne', 'channel': 1, 'icon': 13, 'is_timeout': False, 'fav': None, 'power': 0, 'last_dir': None, 'value': None}]}]}, 'page': 0}]


i pojawiła się błąd skryptu

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 564, in async_request_call
    await coro
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/extalife/light.py", line 96, in turn_on
    w = int(mode_val_hex, 16) & 255    # default
TypeError: int() can't convert non-string with explicit base
  •  

admin

Dzięki, bardzo dobrze przechwycone logi! :) Wygląda na to, że mode_val_hex pojawia się dopiero po wykonaniu status polling, czyli już chyba wiem co się dzieje. I chyba wycofam się z koncepcji dodatkowego pola, bo nie dość że mamy zamieszane wywołane przez Zamel z podwójnym formatem wartości dla tego pola, to jeszcze wprowadzenie pola z wartością kanoniczną jako hex string wprowadza więcej szkody niż pożytku, bo model danych staje się trudniejszy do ogarnięcia, a kod mniej spójny. Nie lubię wyjątków od reguły.
Będę musiał wykonać kilka poważniejszych zmian żeby ten Zamelowy nieład ogarnąć i jak będzie zrobione to dam znać i wrzucę plik do testów.
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •  

admin

No dobra, zmiany zrobione. Mam nadzieję, że będzie to cudowne panaceum na te wszystkie problemy ze sterowaniem SLR-22. Trzymam kciuki. A jak nie zadziała to wiesz co robić ;) Dzięki!
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant
  •