Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95513

Localtuya JSON decoding errors for some lightbulbs (running 1.0.9 firmware)

$
0
0

@dooz127 wrote:

I’ve tried a couple of different localtuya repositories from github and managed to get my tuya plugs and 1/3 light bulbs integrated with hass using this repository:

And this config:

switch:
  - platform: localtuya
    host: HOST_IP
    local_key: LOCAL_KEY
    device_id: DEVICE_ID
    name: driveway_light_1

But the other two bulbs throw the JSON decoding errors below. The one bulb that is currently working is configured as a switch in hass. I’ve also tried using the localtuya repository from:

and configuring the two non-working bulbs as lights but still no dice.

2019-12-02 08:52:35 DEBUG (SyncWorker_1) [custom_components.localtuya.switch] update: 1
2019-12-02 08:52:35 DEBUG (SyncWorker_1) [custom_components.localtuya.pytuya] status() entry
2019-12-02 08:52:35 DEBUG (SyncWorker_1) [custom_components.localtuya.pytuya] json_payload=b'{"gwId":"DEVICE_ID","devId":"DEVICE_ID"}'
2019-12-02 08:52:35 DEBUG (SyncWorker_1) [custom_components.localtuya.pytuya] status received data=b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00,\x00\x00\x00\x01u\x82\xf2\x01\xc2\xa0\x11H\x03\x06\xf9`%\x03\xa5\xa7\x7f\xb4\x16\xa0\x7f.\xe7\x1d\x90\x04\xba\x91\xc7\xaf\xa5\x91\xb9\xaf\xac\xe8\x00\x00\xaaU'
2019-12-02 08:52:35 DEBUG (SyncWorker_1) [custom_components.localtuya.pytuya] result=b'u\x82\xf2\x01\xc2\xa0\x11H\x03\x06\xf9`%\x03\xa5\xa7\x7f\xb4\x16\xa0\x7f.\xe7\x1d\x90\x04\xba\x91\xc7\xaf\xa5\x91'
2019-12-02 08:52:35 DEBUG (SyncWorker_1) [custom_components.localtuya.pytuya] decrypted result=''
2019-12-02 08:52:35 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.front_door_light fails
Traceback (most recent call last):
  File "/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/localtuya/switch.py", line 142, in update
    status = self._device.status(self._switch_id)
  File "/config/custom_components/localtuya/switch.py", line 98, in status
    self._cached_status = self.__get_status(switchid)
  File "/config/custom_components/localtuya/switch.py", line 75, in __get_status
    status = self._device.status()['dps'][switchid]
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 311, in status
    result = json.loads(result)
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The TuyaSmart iOS app says the firmware for the plugs is 1.0.1 and the bulbs is 1.0.9. I assume they are all hitting the 3.3 API. Anyone have tips on things I can try to get these other bulbs to work?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>