Smartthings and two webhooks

When I first set up ST integration, I did so on an antiquated eeepc clamshell notebook which promptly died permanently two weeks later.

I’m now running on a debian laptop in a VM - however I still receive both the current and the previous webhook calls, causing errors in the logs.

I’ve seen there’s a script to remove all smartthings webhooks, but I want to specifically remove the one that isn’t working and retain the one that is.

Anyone know how i can stop the useless webhook while maintaining the working one?

Thanks

It sounds like two apps are running on the smarthings api- one configured to send webhooks to the old home assistant machine, and one to the new one.

I haven’t personally had to do this, but I’d imagine To “surgically” remove one smartapp without running the python script to blow out everything would involve installing and using the Smartthings cli. The Home-assistant integration actually creates a small app in the Smartthings API. This app is not visible in the Smartthings mobile app like the old Groovy ones were.

You can install the Smarrthings CLI (Command Line Interface Tool) available here. GitHub - SmartThingsCommunity/smartthings-cli: Command Line Interface (CLI) for the SmartThings APIs. Provides CRUD operations for platform artifacts as well as ability to control devices. There are versions for windows, MAC, and linux.

Run ‘smartthings apps’ to list the apps and ID’s. Two Homeassistant apps will probably show. The problem is I have no idea how you would differentiate which one is which. If you can figure out how to differentiate them run 'smartthings apps:delete [ID]’ replacing ID with the UUID or the number in the list.

You may have to run the python tool and just reinstall the integration over again. Unless you modified the entity names a lot they should just show back up when you reinstall it. If you changed entity names on anything or disabled them you’d have to change them again after reinstalling.

1 Like

Interesting - and nice tool!

I can get a field called hassInstanceId out of smartthings by using

./smartthings apps:settings

Do you know if there’s some way to trace that ID within home assistant?

Thanks

ok. For the benefit of those who come after (Hopefully you won’t repeat my mistake :slight_smile: )

  1. enable debug logging webhooks in configuration.yaml
logger:
  default: warning
  logs:
    homeassistant.components.webhook: debug
  1. your logs will show results like this: Note the APPID
2021-08-30 16:52:45 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook 0d9156cd45e6c28763df6xxx8aa51febd8f0425886548d8b893e2 from 52.213.77.15

2021-08-30 16:52:45 DEBUG (MainThread) [homeassistant.components.webhook] b'{"lifecycle":"EVENT","executionId":"j9q&3t","appId":"cabe07a6-aa'
  1. The appId in this sequence relates to the app to delete - not the app that’s working.

you can use the smartthings command line tool above to select apps:settings. This will provide which app ID relates to which app number

┌───┬────────────────┬──────────────────────────────────────┐
│ # │ Display Name   │ App Id                               │
├───┼────────────────┼──────────────────────────────────────┤
│ 1 │ Home Assistant │ 07d06256-2b7f-476f-xxxx-26572578799a │
│ 2 │ Home Assistant │ cabe07a6-aa46-43fc-xxxx-8d3aae5373fa │
└───┴────────────────┴──────────────────────────────────────┘
  1. use ./smartthings apps:delete to remove the matching app. (the working app does not display the app ID) in this case the app ID first 11 digits match between the logs and app 2 - so that’s the one to delete.

I’m off to reinstall my smartthings installation - hopefully with the above info things will go better :smiley:

2 Likes

Hello,
How have you manage to keep the webhook running?
I switch from home assistant OS from a raspberrypi to OS on a VM. Since i am not able to reconfigure the weebhook with my duck dns adresse.image