-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Owntracks webhooks iOS getting 400 response #18927
Comments
I'm seeing the exact same problem. |
I should add that when I go into Configuration -> Integration -> Owntracks: Owntracks it tells me that "This integration has no devices.". This is after running the Owntracks "Setting up a new integration". Not sure if this has something to do with it and I should be seeing a device here. |
I played around with it and I put my username at the end of the URL after the @ symbol. This seemed to work: https://my IP address:8123/api/webhook/my key@paul |
Same issue here. Dug into the Python, and might have some clues for the code owner. This is what is being supplied in header: This header is in response to some other data not being present: Sure enough, 'topic' is not in message: |
I hit this same issue. Looks like the OwnTracks component is expecting to find the X-Limit-U and X-Limit-D headers: https://github.com/home-assistant/home-assistant/blob/9aeb4892823ca95a2518dcabc915fc61582f96df/homeassistant/components/owntracks/__init__.py#L128 My Home Assistant install sits behind an nginx reverse proxy, so those headers weren't coming in. The nginx example config for the OwnTracks Recorder project has this pointer:
That's enough to work here, but then I just get device_tracker.matthew_matthew, since the OwnTracks HA component falls back to user for device name. The Recorder documentation expects this for their own stuff (this isn't integrated with Home Assistant, but it's how they're handling their own HTTP communication):
So I ended up mimicking that, with this in my nginx config:
And then appending ?u=matthew&d=myphonename to my webhook URL. This shows up fine. But the recent changes do seem to be missing some piping. I'm not very familiar with the configuration/integration internals, but I kind of expect I would generate a unique webhook per name/device pair I wanted to track, and simply paste that in along with the libsodium key. Failing that, changing away from basic authentication for username to the OwnTracks convention of username/device in the GET string is probably more resilient to reverse proxy setups. |
I think I'm having the same issues as this ticket. I added
Then That resulted in a 200 response code from the webhook (improvement!) however I'm still not seeing HomeAssistant see a device, going into the integration shows no device and I don't see any device being tracked. |
After a few tries i got it working with the help of the android app. How to get it to work? trackerID=UserID Works like a charm (but you only have 2 letters) PS: But none of the devices (IOS or Android) show up on integration or report the position to one another |
How did you get it to work just by having the same two letters in trackerID and UserID? Mine still just error 400 and in HA "Set a username in Connection -> Identification" |
During testing, iOS did report |
Could people report if setting tracker ID will result in the topic being set ? Note that making any changes won't flush the old messages that iOS has queued up, so you might not see results right away. |
OwnTracks 9.5.7, Release date 2017-06-17:
https://github.com/owntracks/ios/blob/master/CHANGELOG.md#owntracks-957 |
I do have tracker ID set on my OT app. |
I've got it set as well. Is there a way to dump/debug the payload? |
Nothing built in but you can add a print(message) inside handle_webhook |
@balloob I was able to intercept communications through nginx... turned off encryption and here's what i got:
|
@raccettura yeah, so you have a topic set, so yours works :) the integration tab does indeed not show any devices yet, that's for the future. You should see the device in |
In 0.84 I've made a change that we report to OwnTracks message processed correctly if it was incorrect. That will cause OwnTracks to drop it from their queue, giving room for new messages with |
84 beta 3 will include this fix. |
There's no new device in known_devices.yaml, and I don't see anything in MQTT, so I don't think it's working. MQTT is setup. I'm using it for temp/humidity via rtl433, so I know it's working. |
Okay @raccettura, looks like you are in the wrong issue. This is an OwnTracks issue about using it via HTTP and webhooks. |
Home Assistant release with the issue:
0.83.2
Last working Home Assistant release (if known):
0.82 (Pre integration setup)
Operating environment (Hass.io/Docker/Windows/etc.):
Docker on Ubuntu 18.04
Component/platform:
https://www.home-assistant.io/components/owntracks/
Description of problem:
Owntracks not reporting location for iOS devices. The follow error is reported in the owntracks app
error The operation couldn't be completed (HTTP Response error 400.) {}
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):owntracks:
Traceback (if applicable):
Additional information:
Currently being discussed by multiple users here https://community.home-assistant.io/t/owntracks-http-error-400/82202
I am also using Android and it is working perfectly.
The text was updated successfully, but these errors were encountered: