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
SmartThings integration does not report contact sensor updates: HTTP_UNPROCESSABLE_ENTITY #24568
Comments
This comment has been minimized.
This comment has been minimized.
Can you share the following:
|
OK that all looks good.
|
Notes:
|
That would be the cause of it not updating -- either the events are not being sent, or they are somewhere getting blocked before HA receives them. I'll test with a mock device later tonight to confirm if it's a broader ST issue for that capability (
That matches what is in the docs. Are you saying that it should be mapped the other way? (Closed -> On) |
I seems that SmartThings maps to open/close events while HASS maps to ON/OFF. |
Because it's a binary sensor (which is only |
When I inspect the binary sensor in lovelace, I see states like "open"/"close" depending on the state of the device when HASS started. |
Do you know where the code of the smartthings app is? |
I confirmed that the events are coming through fine for me and my contact sensors are updating as expected. I highly suspect your issue is that the messages are not reaching HA / getting blocked. I would invest your time/energy in confirming you're even receiving the HTTP messages through your router or reverse proxy. It has happened to others and it was always an issue with their network configuration.
Yes. The entity type is
There's already logging of push messages when in debug mode. The code for the integration is here: https://github.com/home-assistant/home-assistant/tree/dev/homeassistant/components/smartthings and it uses two libraries pysmartapp and pysmartthings. |
Why am I able to see live events from motion sensors, battery sensors and Accelerator sensors but not contact sensors? Could a network issue explain such behavior? |
When I open my main door, I can see 'accelerationSensor' and 'powerMeter' events in halog: Jun 18 21:42:06 hassbian hass[553]: 2019-06-18 21:42:06 DEBUG (MainThread) [homeassistant.components.smartthings] Push update received: {'location_id': 'f18f6a32-c896-464f-acb3-72e9787af412', 'device_id': '806d2a98-e8cd-439d-a68f-0493c9b8c341', 'component_id': 'main', 'capability': 'accelerationSensor', 'attribute': 'acceleration', 'value': 'inactive', 'data': None} But I dont see the contactSensor events |
Is there a groovy file that I could read? |
Found the problem, my hass fails to create a subcription for the contactSensor:
|
Well that's definitely the cause of it not receiving updates. This error is coming back from the SmartThings cloud API. Every time you restart HA, it will attempt to recreate this missing subscription -- does it continue to log this error after restarting? |
Yes. It logs the same error on every restart |
Hmm... That's unexpected here, there's no reason it should be failing with 422. I'll work on a patch that logs the body of the error response to see if that yields any more detail. |
I've opened #24659 which will log the full error body response when this fails. This will go out into the next beta and release with 0.95.0. While it won't fix the issue, it should give us the details to take the next steps. I'll let you know when the beta is released with this update. |
Thanks for much, this will help. |
Unfurtunately, after removing the SmartThings integration and adding it again this issue went away |
I am seeing this in my log:
Is it related? |
how to solved it? Logger: homeassistant.components.smartthings.smartapp Some device attributes may not receive push updates and there may be subscription creation failures under app '9eaeb8a8-e39f-4a82-8fdb-2a345abc0c84' because 44 subscriptions are required but there is a limit of 40 per app Logger: homeassistant.components.smartthings.smartapp Failed to create subscription for 'mediaPlayback' under app '9eaeb8a8-e39f-4a82-8fdb-2a345abc0c84': Unprocessable Entity (422): {"requestId": "9D9A5F7A-3D4D-4109-8558-6CD176238530", "error": {"code": "LimitError", "message": "subscription limit exceeded", "details": []}} |
Home Assistant release with the issue:
0.94.3
Last working Home Assistant release (if known):
Unknown
Operating environment (Hass.io/Docker/Windows/etc.):
Hasbian
Component/platform:
SmartThings
Description of problem:
Door contact sensors from smartthings are not reporting events
Traceback (if applicable):
Additional information:
Try to redo the smartthings integration, ended up in the same situation
Lights can be activated from HASS, and Lights also report event state change to HASS
The text was updated successfully, but these errors were encountered: