Skip to content
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

HTTP request control for Ultimate 2 Gang #66

Open
Caddyrdn opened this issue Dec 16, 2024 · 5 comments
Open

HTTP request control for Ultimate 2 Gang #66

Caddyrdn opened this issue Dec 16, 2024 · 5 comments

Comments

@Caddyrdn
Copy link

Is it possible to implement HTTP request control? I would like to enable switching on via the IP address.

But I don't know how to implement it.

@barth11
Copy link

barth11 commented Dec 16, 2024

You can use HA webhook to trigger and automation. Different payloads can trigger different actions so you don't have to split it into many automations.
https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger

@Caddyrdn
Copy link
Author

Thanks
Can you help me how to use it? ESPhome is completely new to me.

@barth11
Copy link

barth11 commented Dec 19, 2024

I used toggle as an action. Replace it with desired action.

description: ""
triggers:
  - trigger: webhook
    allowed_methods:
      - POST
      - PUT
    local_only: true
    webhook_id: "<generated_webhook>"
conditions: []
actions:
  - type: toggle
    device_id: <your_device_id>
    entity_id: <your_entity_id>
    domain: switch
mode: single

Use the link to send POST request.

http://homeassistant.local:8123/api/webhook/<generated_webhook>

@barth11
Copy link

barth11 commented Dec 27, 2024

@Caddyrdn the repo owner just published a video where you can see it in more detail :)
https://www.youtube.com/watch?v=ZqbDUMQevvs
you can translate CC to english if needed.

@Caddyrdn
Copy link
Author

Thank you.

I got it working. It's a feature in Home Assistant, I didn't realize that.
Is there also a way to implement it in the tx_ultimate_local.yaml? I would like to control it in a similar way to Tasmota.
curl -s http://xxx.xxx.xxx.xxx/cm~3fcmnd~3dPower%20off
curl -s http://xxx.xxx.xxx.xxx/cm~3fcmnd~3dPower%20on
I want to control it directly via CUXD without Home Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants