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

Unable to show devices on SmartThings Integration #30244

Closed
snipiba opened this issue Dec 27, 2019 · 9 comments · Fixed by #30302
Closed

Unable to show devices on SmartThings Integration #30244

snipiba opened this issue Dec 27, 2019 · 9 comments · Fixed by #30302

Comments

@snipiba
Copy link

snipiba commented Dec 27, 2019

I tried many times to integrate SmartThings under hassio (hassos), but under logs i found some errors like this... some ideas?

Error setting up entry Domov for smartthings
ValueError: 'OCF' is not a valid DeviceType
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 192, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 116, in async_setup_entry
    devices = await api.devices(location_ids=[installed_app.location_id])
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 77, in devices
    return [DeviceEntity(self._service, entity) for entity in resp]
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 77, in <listcomp>
    return [DeviceEntity(self._service, entity) for entity in resp]
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/device.py", line 651, in __init__
    self.apply_data(data)
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/device.py", line 94, in apply_data
    self._type = DeviceType(data['type'])
  File "/usr/local/lib/python3.7/enum.py", line 310, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.7/enum.py", line 564, in __new__
    raise exc
  File "/usr/local/lib/python3.7/enum.py", line 548, in __new__
    result = cls._missing_(value)
  File "/usr/local/lib/python3.7/enum.py", line 577, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'OCF' is not a valid DeviceType
@probot-home-assistant
Copy link

Hey there @andrewsayre, mind taking a look at this issue as its been labeled with a integration (smartthings) you are listed as a codeowner for? Thanks!

@craigeyboyz
Copy link

I'd had a similar issue after adding a new Samsung TV to Smartthings when I updated HA (I'm running on Docker) I got the same issue. I just logged into the Samsung Graph API and remove the TV and it worked ok again. I suspect it was the DeviceType (which was set to undefined on the API) I haven't tried readding as yet

@snipiba
Copy link
Author

snipiba commented Dec 30, 2019

I'd had a similar issue after adding a new Samsung TV to Smartthings when I updated HA (I'm running on Docker) I got the same issue. I just logged into the Samsung Graph API and remove the TV and it worked ok again. I suspect it was the DeviceType (which was set to undefined on the API) I haven't tried readding as yet

hmm. sounds familiar... i added new SamsungTV to smart things app too. when tv was removed, other devices are again listed.

@andrewsayre
Copy link
Member

It looks like the API changed in how it represents OCF devices. I'll update the library and submit a PR today to address this. Sorry for the delay folks!

@jhenkens
Copy link
Contributor

Hit this today with DeviceType “HUB”. Updated to 0.104.3 and it went away. Thanks @andrewsayre

@rodders99
Copy link

Hit this today with DeviceType “HUB”. Updated to 0.104.3 and it went away. Thanks @andrewsayre

Same here, sorted the problem quickly.

@oneofthemany
Copy link

oneofthemany commented Feb 12, 2020

I am having the same issue and I am running 0.105.3:

2020-02-12 11:42:39 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for smartthings
ValueError: 'HUB' is not a valid DeviceType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 190, in async_setup
hass, self
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/smartthings/init.py", line 116, in async_setup_entry
devices = await api.devices(location_ids=[installed_app.location_id])
File "/srv/homeassistant/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 77, in devices
return [DeviceEntity(self._service, entity) for entity in resp]
File "/srv/homeassistant/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 77, in
return [DeviceEntity(self._service, entity) for entity in resp]
File "/srv/homeassistant/lib/python3.7/site-packages/pysmartthings/device.py", line 651, in init
self.apply_data(data)
File "/srv/homeassistant/lib/python3.7/site-packages/pysmartthings/device.py", line 94, in apply_data
self._type = DeviceType(data['type'])
File "/usr/lib/python3.7/enum.py", line 310, in call
return cls.new(cls, value)
File "/usr/lib/python3.7/enum.py", line 564, in new
raise exc
File "/usr/lib/python3.7/enum.py", line 548, in new
result = cls.missing(value)
File "/usr/lib/python3.7/enum.py", line 577, in missing
raise ValueError("%r is not a valid %s" % (value, cls.name))
ValueError: 'HUB' is not a valid DeviceType

I have removed the integrations, applied a new token, even ran the hass_smarthings_remove command etc and still nothing is showing up in HA

@oneofthemany
Copy link

^^^
bump

@oneofthemany
Copy link

it would appear that the normal command was not not updating home assistant:
pip3 install --upgrade homeassistant
I have it all working now but had to issue the following:
sudo hassbian-config upgrade homeassistant

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

Successfully merging a pull request may close this issue.

7 participants