Service that does a request to a 3rd party device

Hi guys,
I’m trying to achieve the following, but cant estimate what would be the right way to do and I’m hoping for your suggestions.
Let me outline my scenario:
If a sensor changes its state I need to call <sth> to send a request to a 3rd party device. This reqest needs to be authenticated with a challenge and resonse logic, so there need to be a logic flow prior the actual request with its payload.

My thougs so far,

  • create a service which triggers this request via python script, but the “python scripts” cannot send requests itself, because you cannot import libraries (like ‘requests’).
  • AppDaemon, I tried to create this logic flow, but it looks like AppDaemon cannot create services which are callable from HA, it can only create “AppDaemon services”.

Hope for you help, thanks in advance :slight_smile:

Do you really need to be able to call the service from HA?

I would like to use this in an automation. That’s why I thougt a Service to call would be fit. Can I call AppDaemon services from an HA Automation?

Why not create your automations directly in AppDaemon?
No, you can’t call AppDaemon services from HA.

Interesting thought, thanks. Maybe a way to go.
Only disadvantage I see may be that it’s the 4th way of defining my automations (besides UI Automations, YAML Automations and NodeRED).

I only use AppDaemon for all my automations (I think I have 2-3 automations in HA because they are just too easy and not worth the effort to put it into a Python app. I just find it way easier and more powerful to code in Python, but probably that’s just me haha

Works like a charm :smiley:, thank you for the inspiration.

1 Like