Creating cloud webhook issues and solutions

I’m experiencing problems with webhooks not being created. NabuCasa support has suggested that I delete the .storage/cloud file, restart and then let the file be recreated.

However, I’m not filled with confidence that this is either safe or the right way to go as there are lots of other entries in that file apart from the webhooks.

The other items all relate to sensors and scripts that are/are not exposed to Google Home.

Is there an alternate way to have the cloud webhooks be generated other than through the automation GUI?

EDIT: See this post below.

What advice do you have for me on this?

Make a note of what you’re exposing, etc, then do as they said :wink:

copy the file somewhere.

delete the file.

restart.

I’m assuming, therefore, that the file gets recreated on restart and will be empty.

Is this going to affect the Google Home integration other than all scripts and devices being exposed initially?

Rename the file by adding a new extension at the end (blub.cloud => blub.cloud.old). After that restart and see what happens.
If anything goes wrong, delete the newly created file and rename the old back. :slight_smile:

Hmm!

Not as straightforward as they led me to believe.

The cloud file was recreated with Google and Alexa enabled by default.

The webhooks still show up on the HA Cloud integrations page (not in the file though) and can’t be enabled: “Unexpected error: Hook is already enabled for the cloud.”

So I have to conclude that this is not the only only file where the the webhooks are configured.

EDIT:

Now, when using the automations GUI to create a webhook triggered automation, clicking the orange ‘save’ creates the automation but no webhook is generated either in the list or in the cloud file.

Any other ideas?

Further investigation shows that, of the webhooks that can’t be enabled due to the error mentioned above, the webhook URL has been changed from what it was before (consequently none of my webhook dependant automations now work!) so something is being generated and written somewhere.

The question is where? Clearly, it’s not the .storage/cloud file as I was led to believe.

You need to talk to Nabu Casa support about this. You pay for the service, have them help you understand how it works. This forum doesn’t get a lot of traffic from the developers, so going to the source is your best bet.

Thanks. I have linked them to this thread so let’s see what response I get.

They (Ashton) have been helpful so far, albeit with somewhat incorrect info.

Are you also removing the webhook automations which were the source for the webhooks?

Effectively, yes. They’re all commented out.

I have 29 webhooks showing in the original .storage/cloud file but only 9 showing in the frontend.

Creating a new ones using the GUI generates the code in automations.yaml but doesn’t create the webhook.

Can you fully reboot your device, then attempt to add a webhook trigger automation and then share the logs from developer tools > logs here?

Thank you for your help. Automation created.

Here’s the log:

2019-11-30 16:48:12 ERROR (MainThread) [haffmpeg.core] FFmpeg fails [Errno 2] No such file or directory: ‘ffmpeg’: ‘ffmpeg’
Traceback (most recent call last):
File “/Users/ashscott/.homeassistant/deps/lib/python/site-packages/haffmpeg/core.py”, line 136, in open
self._proc = await self._loop.run_in_executor(None, proc_func)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 775, in init
restore_signals, start_new_session)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘ffmpeg’: ‘ffmpeg’
2019-11-30 16:48:12 WARNING (MainThread) [haffmpeg.tools] Error starting FFmpeg.
2019-11-30 16:48:14 ERROR (MainThread) [homeassistant.components.sensor] systemmonitor: Error on device update!
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 450, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/components/systemmonitor/sensor.py”, line 138, in update
self._state = psutil.disk_usage(self.argument).percent
File “/Users/ashscott/.homeassistant/deps/lib/python/site-packages/psutil/init.py”, line 2120, in disk_usage
return _psplatform.disk_usage(path)
File “/Users/ashscott/.homeassistant/deps/lib/python/site-packages/psutil/_psposix.py”, line 125, in disk_usage
st = os.statvfs(path)
FileNotFoundError: [Errno 2] No such file or directory: ‘’
2019-11-30 16:48:18 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 399, in _async_add_entity
raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: device_tracker.ash_iphone. Platform mobile_app does not generate unique IDs
2019-11-30 16:48:28 WARNING (SyncWorker_15) [homeassistant.components.homekit] You have exceeded the device limit, which might cause issues. Consider using the filter option.
2019-11-30 16:49:07 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:10
2019-11-30 16:49:20 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.ring_front_door_last_ding is taking over 10 seconds
2019-11-30 16:49:49 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.ring_front_door_last_ding is taking over 10 seconds
2019-11-30 16:49:50 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:10
2019-11-30 16:50:11 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ring binary_sensor took longer than the scheduled update interval 0:00:10

Interestingly, because I’ve not seen this before and it clearly relates to his issue, I created three local webhooks this morning to test out the new Flic 2 hub and buttons that arrived.

The webooks are of the form: http://10.0.1.32:8123/api/webhook/shortcuts_call_service

The automations work fine when triggered by the Flic buttons. All good.

However, when I looked under Home Assistant Cloud in the frontend I saw this:

All three local webhooks are there but not enabled, yet the automations are still triggered by them.

Turning on the webhook then opens the popup displaying a cloud webhook URL!

So, it seems that my problem relates to the creation of the webhook using the automation GUI.

Are others experiencing this? Are webhooks not widely used/created this way so the bug has not been reported?

For others who may want to use webhooks, the docs on the NabuCasa don’t tell the whole story.

It’s not necessary to create an automation to add/create a cloud webhook.

Simply adding:

- platform: webhook
  webhook_id: your_webhook_name

as a trigger to an existing automation will also create the cloud webhook once automations have been reloaded.

I had this problem, which led me here. I was in the process of creating a new HA image and wanted to reuse some webhooks I had set up in the old image so I didn’t have to change them in the app that used them. I went through the creation process and then replaced the generated webhook with the one from the old image. It accepted it and then turned off the webhook. Turning it on gave the error message: “Unexpected error: Hook is already enabled for the cloud.”. Went back to the automation and changed the web hook name to another one I needed to set up. The old one disappeared from the Home Automation Cloud webhooks listing. Lesson learned: don’t change the generated webhook.

Update

As I added additional webhooks in the same manner the Home Automation cloud would switch from showing them and the toggle switch in a random manner or least in no pattern I could discern. When I tested them, they all worked. I suspect the issue is my with synchronization with the nabucasa cloud. I never did test the reused hook so maybe it was good too.