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

unknown error #23

Open
Methers27 opened this issue Jan 30, 2022 · 8 comments
Open

unknown error #23

Methers27 opened this issue Jan 30, 2022 · 8 comments

Comments

@Methers27
Copy link

Methers27 commented Jan 30, 2022

Hi, trying to set up this integration for a soundbar that works with smart things, but keep returning this error in the log. I have installed the integration via HACS, and I have entered the following in my configuration.yaml (with the correct values for ID/api key)

media_player:
-  platform: smartthings_soundbar
   name: Soundbar
   api_key: ****
   device_id: ****
   max_volume: 30

The integration has never appeared in the UI, but if i go to info under configuration, I can see it as an active integration. This is the error I keep receiving:

Update for media_player.soundbar fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 487, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 691, in async_device_update
    raise exc
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/smartthings_soundbar/media_player.py", line 76, in update
    SoundbarApi.device_update(self)
  File "/config/custom_components/smartthings_soundbar/api.py", line 34, in device_update
    data = resp.json()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.9/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@PiotrMachowski
Copy link
Owner

Can you try to run this script?

Do you have SmartThings integration set up?

@Methers27
Copy link
Author

thanks for the quick reply, where should I be running the script? (sorry for the very basic question)

I don't have smartthings set up, should I have done this?

@PiotrMachowski
Copy link
Owner

You can run it anywhere you have installed python

You don't have to, but it would help with troubleshooting

@Methers27
Copy link
Author

I got the below error running in pyscript:

Exception in </config/pyscript/smartthings.py> line 15: device = (await api.devices(device_ids=[DEVICE_ID]))[0] ^ TypeError: 'NoneType' object is not subscriptable

@Methers27
Copy link
Author

I now get this error from the smartthings_soundbar script, it still does not appear in integrations

Update for media_player.soundbar fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 487, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 691, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/smartthings_soundbar/media_player.py", line 76, in update
SoundbarApi.device_update(self)
File "/config/custom_components/smartthings_soundbar/api.py", line 39, in device_update
device_source = data['main']['inputSource']['value']
KeyError: 'inputSource'

@PiotrMachowski
Copy link
Owner

Something might be wrong with status of your device in SmartThings. What info do you get here? https://graph-eu01-euwest1.api.smartthings.com/device/list

@Methers27
Copy link
Author

shows my device with status 'online'

@Methers27
Copy link
Author

Screenshot_20220130-183944_Chrome

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