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

BUG: {cam_name} doesn't appear to be formatted for webhooks #1378

Open
traviswparker opened this issue Oct 30, 2024 · 0 comments
Open

BUG: {cam_name} doesn't appear to be formatted for webhooks #1378

traviswparker opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@traviswparker
Copy link

traviswparker commented Oct 30, 2024

Describe the bug

The {cam_name} format isn't being parsed when sending a motion webhook. I'm seeing this in the logs for motion events:

[WyzeBridge] [MOTION] Motion detected on porch at  17:04:35
[WEBHOOKS] 500 Server Error: Internal Server Error for url: http://localhost:8555/motion?%7Bcam_name%7D
[WyzeBridge] ☁️ Pulling "porch" thumbnail to /img/porch.jpg

Back in 2.8.3, get_http_webhooks(url.format(cam_name=uri, img=str(img)), msg, img) handled the cam_name format. In 2.9.x+ there doesn't appear to be a url.format(cam_name=...) call anywhere so this is going unhandled.

adding url = url.format(cam_name=camera, img=str(img)) to webhooks.send_webhook seems to fix it, but that might not be the optimal solution.

Affected Bridge Version

2.9.x to main

Bridge type

Docker Run/Compose

Affected Camera(s)

all

Affected Camera Firmware

all

docker-compose or config (if applicable)

wyze-bridge:
      image: mrlt8/wyze-bridge
      restart: unless-stopped
      network_mode: "host"
      environment:
        ENABLE_AUDIO: true
        WB_AUTH: false
        WYZE_PASSWORD: 
        API_ID: 
        MOTION_WEBHOOKS: 'http://localhost:8555/motion?{cam_name}'
        MOTION_API: true
        WYZE_EMAIL: 
        API_KEY:
@traviswparker traviswparker added the bug Something isn't working label Oct 30, 2024
traviswparker added a commit to traviswparker/docker-wyze-bridge that referenced this issue Oct 31, 2024
The formatting of the {cam_name} and {img} tokens in webhooks URLs worked in 2.8.x but has not worked in newer versions. See mrlt8#1378

This patch adds formatting of those tokens in send_webhooks
traviswparker added a commit to traviswparker/docker-wyze-bridge that referenced this issue Oct 31, 2024
See mrlt8#1378
formatting of {params} in webhooks URLs have been missing since 2.9.x. This patch adds it back to send_webhooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant