Hi all,
I’m migrating from Domoticz to Home Assistant, so I’m trying to replicate all the functionalities.
I have a secutiry IP Camera that can call an URL (alarm server function) on motion detection trigger. I use this to turn on a light in Domoticz just setting a custom variable to 1 calling the Domoticz URL with the right parameters and then a LUA script read the variable and switch on the light.
I cannot replicate this in HA because the API is more complex and is a real REST API with token as authentication, but in the IP camera I cannot use headers, Json content, etc… I can only call a simple URL posting variables and authenticate with http simple auth username and password.
Is there any known workaround for this? Any idea?
I was thinking to use a local script in HA that can be called by URL like py, java, php, but I don’t have enought experience about HA http environment, what’s available, where the files are, etc…I use Hassio on rpi4.
Thanks for any suggestion on this topic, Mauro
I’ve just tried what’s suggested by Fabio, but webhook needs a POST of the URL, whlile i can only send a standard GET and I also suspect that https is not supported by mi IP camera.
So I’m back to the intial question about how to solve this problem, I need to trigger a event by a simple URL GET.
Hi Fabio, this is the webhook in automations.yaml
I’ve tested it with postman and it works only calling the URL https://myaddress:8123/api/webhook/testcam with POST not with GET (calling it in the browser does not work for example)
Maybe there is a different way to do it I’ve missed, but i’ve found many similar questions in the community and all says that it needs a POST not GET.
I’ll be more than happy to know your case and solution.
id: ‘1576104714229’
alias: switch on light by IP Camera
description: ‘’
trigger:
no, calling it from browser is not going to work
try it first from a SSH terminal , like curl -x …
i am using the webhook from nabucasa
if dont have a nabucasa, you can make a .php script, i call that one from my Synology cameras… works better and internal
If you are new to HA, I would suggest adding node-red to your environment. I think, things are much easier with NR… such as automation or creation of web endpoint.
It is just one node to create the web endpoint, working with GET and no authentication if you want to.
I have started with HA solely and soon migrated everything to NR.
Hope this helps,
GV