-
|
I'm sure the issue is on my end but I have tried tons of different methods to get this to work but they all fail with a 401 error in the serial logs. Any idea what I could be doing wrong. I do have my HA instance behind a Cloudflare tunnel but curl seems to work fine for calling services. Tio Serial Stream: I (01:29:23.947) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:7128631 Bytes, Inter:135931 Bytes, Dram:135931 Bytes HA Logs: And because I was starting to go crazy I also tried using curl with my Long Lived Access Token and that appears to work fine and turn on my input boolean.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
|
Can you provide your curl command with verbose output with the creds removed? Also, I assume the machine you're running curl on has the WARP client connected to the tunnel? The ESP BOX doesn't have that so for an equivalent test you will need to make sure you have WARP disconnected on the machine you're running curl from. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the fast response. I am not running WARP client just using the Cloudflare tunnel for protecting my HA instance. Verbose Curl Output: `Note: Unnecessary use of -X or --request, POST is already inferred.
|
Beta Was this translation helpful? Give feedback.
-
|
Your example curl is returning 403. Why is that? I'm also struggling to understand this config (and purpose)... Is your HA instance not local? We've never tested the Willow http client against Cloudflare because frankly we never considered this use case. Theoretically it should "just work" but I have a lot of experience with CF and CF tunnels and I can think of any number of settings/config options that could potentially be problematic. Can you post a de-authenticated successful curl with |
Beta Was this translation helpful? Give feedback.
-
|
So might have been a few things. My ip was banned in HA from too many failed auth requests and also apparently I need to add -v at the end of my curl command. So the reason for the Coudflare tunnel is for secure-ish remote access but doing this also prevents local http requests from what I can tell so I have to use my URL that matches my cert. Thanks again for the help though! Here is an explanation of the Cloudflare tunnel: https://everythingsmarthome.co.uk/free-remote-access-for-home-assistant-with-cloudlfare/ When running: curl -X POST -H "Authorization: Bearer 111111111111111" -H "Content-Type: application/json" -d '{"entity_id":"input_boolean.test"}' "https://ha.mysite.com:8443/api/services/input_boolean/turn_on" -v --http1.1 --tlsv1.2 I get:
|
Beta Was this translation helpful? Give feedback.
-
|
I've had good experience with http://pagekite.net/ in the past, might be worth a look. |
Beta Was this translation helpful? Give feedback.
You are correct Willow is in my home. It looks like the way I originally configured my Cloudflare tunnel made it where the only way to communicate with it was through the Cloudflare tunnel. I had no local access. I have reconfigured it using the new method below and everything works as expected! Thanks again for battling with me through this weird issue. Got a Tesla P4 on the way to try out WIS!
The 2 methods are below for anyone running into issues. I have included the old method if you need to reverse your steps to get back to square 1.
New Method
Old Method