core: Error setting up platform legacy bt_smarthub

The problem

Was working fine but then just stopped working sadly at the time I thought it was a router issue as I had just been sent a new one. A bit of digging has thrown up this in the debug log I run Home assistant on a windows machine with Hyper-V (you have no idea how much I’m looking forward to my Yellow)

Happy to provide any info needed but you may have to tell me how to get it.

What version of Home Assistant Core has the issue?

core-2022.2.9

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Device Tracker (BT-Smart Hub 2)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bt_smarthub/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Error setting up platform legacy bt_smarthub
11:11:19 am – (ERROR) Device Tracker

Logger: homeassistant.components.device_tracker
Source: components/bt_smarthub/device_tracker.py:97
Integration: Device Tracker (documentation, issues)
First occurred: 11:11:19 am (1 occurrences)
Last logged: 11:11:19 am

Error setting up platform legacy bt_smarthub
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 245, in async_setup_legacy
    scanner = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bt_smarthub/device_tracker.py", line 35, in get_scanner
    scanner = BTSmartHubScanner(smarthub_client)
  File "/usr/src/homeassistant/homeassistant/components/bt_smarthub/device_tracker.py", line 62, in __init__
    data = self.get_bt_smarthub_data()
  File "/usr/src/homeassistant/homeassistant/components/bt_smarthub/device_tracker.py", line 97, in get_bt_smarthub_data
    data = self.smarthub.get_devicelist(only_active_devices=True)
  File "/usr/local/lib/python3.9/site-packages/btsmarthub_devicelist/__init__.py", line 61, in get_devicelist
    devicelist = self.get_devicelist_smarthub_2(only_active_devices=only_active_devices)
  File "/usr/local/lib/python3.9/site-packages/btsmarthub_devicelist/__init__.py", line 286, in get_devicelist_smarthub_2
    devices = json.loads(cleaned_jscript_array)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 12663 (char 12662)

Additional information

This has been an issue since at least core-2021.11.3 but I think I posted it in the wrong place.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19 (4 by maintainers)

Most upvoted comments

I have merged @typhoon2099’s PR and updated PyPI - hopefully fixes all of your issues

I no longer use the smarthub integration I just added it to my config and did a restart and the error for me is still there. Maybe I missed something but I did add smarthub_model: 2 also and that didnt fix it. Others seem to think its fixed so I guess you can go off that as I say I gave up on the smart_hub sadly shortly before you got involved to help fix it. Thank you for getting involved and seeing this through.