skrashevich / hassio-addons

15 stars 17 forks source link

Photos not being sent (error 500) #13

Open Frankster-NL opened 12 months ago

Frankster-NL commented 12 months ago

Am running the addon, but I consistently do note get photos in my notification. All images show "Failed to load attachment Response status code was unacceptable: 500."

I do suspect that this is related to the error in the log "error: IpDeniedError: Access denied to IP address: ::ffff:192.168.1.10" (in there the mentioned IP address is the IP address of the homeassistant server)

Relevant automation:

service: notify.mobile_app_franks_iphone
data:
  message: |-
    {% if trigger.to_state.attributes.match is defined %}
      {{trigger.to_state.attributes.friendly_name}} is near the {{trigger.to_state.state}} @ {{trigger.to_state.attributes.match.confidence}}% by {{trigger.to_state.attributes.match.detector}}:{{trigger.to_state.attributes.match.type}} taking {{trigger.to_state.attributes.attempts}} attempt(s) @ {{trigger.to_state.attributes.duration}} sec
    {% elif trigger.to_state.attributes.unknown is defined %}
      unknown is near the {{trigger.to_state.state}} @ {{trigger.to_state.attributes.unknown.confidence}}% by {{trigger.to_state.attributes.unknown.detector}}:{{trigger.to_state.attributes.unknown.type}} taking {{trigger.to_state.attributes.attempts}} attempt(s) @ {{trigger.to_state.attributes.duration}} sec
    {% endif %}
  data:
    attachment:
      url: |-
        {% if trigger.to_state.attributes.match is defined %}
          http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.token}}
        {% elif trigger.to_state.attributes.unknown is defined %}
           http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.unknown.filename}}?box=true&token={{trigger.to_state.attributes.token}}
        {% endif %}
    actions:
      - action: URI
        title: View Image
        uri: |-
          {% if trigger.to_state.attributes.match is defined %}
            http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.token}}
          {% elif trigger.to_state.attributes.unknown is defined %}
             http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.unknown.filename}}?box=true&token={{trigger.to_state.attributes.token}}
          {% endif %}