smartthings icon indicating copy to clipboard operation
smartthings copied to clipboard

So Far - Like this (want to LOVE IT)

Open bearhntr opened this issue 2 years ago • 6 comments

So far way better than the first one I got in HA. No problems installing yours after removing the other one. I do however have some issues/questions.

  1. The other one when configuring it, would launch the IDE and make me sign in and click on an ALLOW screen to allow all devices to talk. It would also make an entry in the IDE called 'Home Assistant' -- not seeing that with yours.

  2. I LOVE that yours does pull back the Manufacturer and Model Information, albeit not sure they are completely accurate:

image

  1. Seeing all sorts of errors in the logs - which I do not understand:
This error originated from a custom integration.

Logger: custom_components.smartthings.smartapp
Source: custom_components/smartthings/smartapp.py:376
Integration: SmartThings
First occurred: 09:25:55 (1 occurrences)
Last logged: 09:25:55

Some device attributes may not receive push updates and there may be subscription creation failures under app 'd94a6276-373b-44ee-a774-4591f6bd3fd0' because 62 subscriptions are required but there is a limit of 40 per app
This error originated from a custom integration.

Logger: custom_components.smartthings.smartapp
Source: custom_components/smartthings/smartapp.py:330
Integration: SmartThings
First occurred: 09:25:55 (12 occurrences)
Last logged: 09:25:59

Failed to create subscription for 'custom.dryerDryLevel' under app 'd94a6276-373b-44ee-a774-4591f6bd3fd0': Unprocessable Entity (422): {"requestId": "4FE5ED58-C593-4109-9DCC-29C4C355AA9C", "error": {"code": "LimitError", "message": "subscription limit exceeded", "details": []}}
Failed to create subscription for 'samsungce.deviceIdentification' under app 'd94a6276-373b-44ee-a774-4591f6bd3fd0': Unprocessable Entity (422): {"requestId": "C00A73A0-F205-4EFE-9422-3EB456EBBFD9", "error": {"code": "LimitError", "message": "subscription limit exceeded", "details": []}}
Failed to create subscription for 'custom.launchapp' under app 'd94a6276-373b-44ee-a774-4591f6bd3fd0': Unprocessable Entity (422): {"requestId": "50D5AE4D-A705-461A-A548-094C9060EB83", "error": {"code": "LimitError", "message": "subscription limit exceeded", "details": []}}
Failed to create subscription for 'custom.washerWaterTemperature' under app 'd94a6276-373b-44ee-a774-4591f6bd3fd0': Unprocessable Entity (422): {"requestId": "90B655CD-313D-4576-AE9A-8A873E623DD6", "error": {"code": "LimitError", "message": "subscription limit exceeded", "details": []}}
Failed to create subscription for 'samsungvd.mediaInputSource' under app 'd94a6276-373b-44ee-a774-4591f6bd3fd0': Unprocessable Entity (422): {"requestId": "B919697C-400E-43E9-8CEF-5DCC65953EB9", "error": {"code": "LimitError", "message": "subscription limit exceeded", "details": []}}
This error originated from a custom integration.

Logger: homeassistant.core
Source: custom_components/smartthings/switch.py:224
Integration: SmartThings
First occurred: 09:33:42 (1 occurrences)
Last logged: 09:33:42

Error executing service: <ServiceCall switch.turn_off (c:01GHBTJHC8A1ZB6KZGAM3CX5SC): entity_id=['switch.samsung_tv_switch']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 207, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/config/custom_components/smartthings/switch.py", line 224, in async_turn_off
    await getattr(self._device, self._off_command)(set_status=True)
  File "/usr/local/lib/python3.10/site-packages/pysmartthings/device.py", line 1013, in switch_off
    result = await self.command(component_id, Capability.switch, Command.off)
  File "/usr/local/lib/python3.10/site-packages/pysmartthings/device.py", line 825, in command
    response = await self._api.post_device_command(
  File "/usr/local/lib/python3.10/site-packages/pysmartthings/api.py", line 147, in post_device_command
    return await self.post(API_DEVICE_COMMAND.format(device_id=device_id), data)
  File "/usr/local/lib/python3.10/site-packages/pysmartthings/api.py", line 395, in post
    return await self.request("post", self._api_base + resource, data=data)
  File "/usr/local/lib/python3.10/site-packages/pysmartthings/api.py", line 376, in request
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 409, message='Conflict', url=URL('https://api.smartthings.com/v1/devices/8afdcf72-f409-44bb-bbf3-b1f18a29d026/commands')

I have 3 more Smart Devices that are going to be installed (SAMSUNG Smart Range/Oven, Dishwasher and Microwave) -- as soon as I get my new floors. I have them already...still in the boxes in the garage.

Am I gonna have problems?

bearhntr avatar Nov 08 '22 16:11 bearhntr

  1. If you used the same api key its the same one in the mobile app.
  2. Yes this is a known issue and a shortcoming of my coding. The problem is complex. I have removed the subscription check since I have added a lot of capabilities and this was just a temporary thing. Though it does not remove the issue even if fixed. This is a problem of the smartthings api and can be circumvented by using OCF, but this is a upcoming feature and at the moment I simply don't have enough time to code this. It is on my mind, but the project takes a lot of time so be patient.

The current smartthings library in use is a can of worms and has many other issues too.

At the moment you can bypass this issue by dividing your devices into multiple accounts and adding the different accounts to HA.

https://github.com/veista/smartthings/issues/14

veista avatar Nov 15 '22 23:11 veista

I am no programmer - but if there is anything that you wish me to try....more than willing.

The default SmartThings integration does all sorts of checks and balances and stuff --- but when the items come into HA, the MFG and MODEL, etc. do not show. Yours does that - but I was seeing all those errors.

Not sure what you mean by multiple accounts - can you elaborate on this?

bearhntr avatar Nov 15 '22 23:11 bearhntr

Make another smartthings/samsung account. Add some devices there, create api key, add a second smartthings integration to HA.

veista avatar Nov 16 '22 07:11 veista

Make another smartthings/samsung account. Add some devices there, create api key, add a second smartthings integration to HA.

Thank You for the suggestion - so honestly....given that I have a v3 HUB, TV, Soundbar, Washer, Dryer, Fridge, Stove, Microwave and Dishwasher all Samsung SmartThings capable - what do you recommend to break them out?

Would I be better using the 'other' Integration? The one which apparently adds some sort of app or tool to the Samsung IDE.

Today, I just deleted ALL DEVICES from SmartThings IDE and the app on my phone - reset the HUB and I want to set it all back up to get this working properly in HA.

Sill not sure what you mean by this remark : "This is a problem of the smartthings api and can be circumvented by using OCF, but this is a upcoming feature and at the moment I simply don't have enough time to code this. It is on my mind, but the project takes a lot of time so be patient."

bearhntr avatar Nov 16 '22 18:11 bearhntr

Hi all. Those who write integrations do so in our spare time and because we are passionate about HA and do this to the best of our ability. A big thank you to Taneli Veistinen "veista" all for the time he spends on improving smartthings.

PerSterin avatar Nov 18 '22 08:11 PerSterin

@PerSterin and @veista

I can agree with all the statements, I am sure that it is a lot of work - I wish I was more 'programming' savvy, I would love to write some of these. All I can offer is a willingness to test and document my findings. I have been a beta-tester for a great number of things in my life (namely Microsoft Windows 3.0, 3.1, 3.11, 95, 98, Me, XP, v7 and v8) --- as well as numerous others.

I was also a technical writer for IBM back in the 90's for their PS/1 and Aptiva line.

I just want to offer to help and test where needed.

bearhntr avatar Nov 19 '22 16:11 bearhntr