Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON result was not a dictionary #19

Open
freefelt opened this issue Jul 28, 2021 · 1 comment
Open

JSON result was not a dictionary #19

freefelt opened this issue Jul 28, 2021 · 1 comment

Comments

@freefelt
Copy link
Contributor

Приходят такие ворнинги. В описании ничего конкретного нет, но я методом тыка проверил. Если выключить lumi, то они пропадают, если включить, то тут же появляются снова.

@Anton-Ka
Copy link

Я тоже получаю большое количество варнингов.
I get a lot of warnings too

Logger: homeassistant.components.mqtt.mixins
Source: components/mqtt/mixins.py:240
Integration: MQTT (documentation, issues)
First occurred: 18 октября 2021 г., 22:08:58 (846 occurrences)
Last logged: 09:19:43

JSON result was not a dictionary

После включения логгирования выяснилось, что проблема связана с кнопкой шлюза - Home Assistant получает значение числа вместо ожидаемого.
Кусок лога с этой проблемой:
After enabling logging, it turned out that the problem is related to the gateway button - Home Assistant receives the value of the number instead of the expected one.
A piece of the log with this problem:

2021-10-31 12:30:22 DEBUG (Thread-5) [paho.mqtt.client] Received PUBLISH (d0, q0, r0, m0), 'lumi/light', ...  (15 bytes)
2021-10-31 12:30:22 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on lumi/light: b'{"state":"OFF"}'
2021-10-31 12:30:22 DEBUG (Thread-5) [paho.mqtt.client] Received PUBLISH (d0, q0, r0, m0), 'lumi/button/action', ...  (1 bytes)
2021-10-31 12:30:22 DEBUG (Thread-5) [paho.mqtt.client] Received PUBLISH (d0, q0, r0, m0), 'lumi/button/action', ...  (1 bytes)
2021-10-31 12:30:22 DEBUG (Thread-5) [paho.mqtt.client] Received PUBLISH (d0, q0, r0, m0), 'homeassistant/light/lumi_light/config', ...  (272 bytes)
2021-10-31 12:30:22 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on lumi/button/action: b'0'
2021-10-31 12:30:22 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-10-31 12:30:22 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on lumi/button/action: b'0'
2021-10-31 12:30:22 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2021-10-31 12:30:22 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/light/lumi_light/config: b'{"name":"Lumi Light","uniq_id":"lumi_light","schema":"json","rgb":true,"brightness":true,"stat_t":"lumi/light","cmd_t":"lumi/light/set","device":{"identifiers":["xiaomi_gateway"],"name":"Xiaomi_Gateway","sw_version":"1.0","model":"Xiaomi Gateway","manufacturer":"Xiaomi"}}'
2021-10-31 12:30:22 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process discovery payload {'name': 'Lumi Light', 'unique_id': 'lumi_light', 'schema': 'json', 'rgb': True, 'brightness': True, 'state_topic': 'lumi/light', 'command_topic': 'lumi/light/set', 'device': {'identifiers': ['xiaomi_gateway'], 'name': 'Xiaomi_Gateway', 'sw_version': '1.0', 'model': 'Xiaomi Gateway', 'manufacturer': 'Xiaomi'}, 'platform': 'mqtt'}
2021-10-31 12:30:22 INFO (MainThread) [homeassistant.components.mqtt.discovery]

Тут видно, что b'0 'не является сообщением JSON, что и вызывает появление ошибки.
Here you can see that b'0 'is not a JSON message, which causes the error to appear.

Сейчас, т.к. кнопка не используется, отключил объект кнопки в Home assistant и на данный момент предупреждения больше не появлялось.
Now, since the button is not used, I disabled the button object in the Home assistant and at this point the warning no longer appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants