-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Wait for s3_signed_url
and access URL
#44
Comments
This component has had contributions from people with far more experience of async than I have. I defer to them for comment |
Thanks @robmarkcole. I probably shouldn't have used the word async. I think my question is more home assistant related. Is it possible to call an action that returns data? Is so, this would solve my issue. If not, I will need to figure out how to pass context along with the handled event. If the code above worked I would have the state available in the automation. If a new automation needs to handle the event, I'll need some way to pass in the context. Not sure if that makes more sense. |
This is what I'm currently doing as a workaround for this issue. I'd be open to better solutions. From what I can tell, home assistant services can't really return data. This means that the result of the pre-sign operation needs to be handled by listening for an event. Because the event does not fire in the same automation, I'm having to handle it in a separate automation, and thus, I need some context data along with the output URL. Hope this may be useful to others. |
I use the generate signed url service and name the key something related to the automation. So for my doorbell camera it's "snapshot_doorbell.jpg" Then when I get the s3_signed_url trigger I use this condition to make sure its for the right automation: |
Thanks @nukefrenzy. So it sounds like also have a separate automation to handle the response (good to know I'm not alone). Good idea to use the key name to identify the automation. I generally need more detail like the camera as well as the label, sub-label, zone, confidence, etc., which would be a cumbersome to do based on the s3 key. @nukefrenzy Is your HASS install private by chance? And have you run into this trying to use a pre-signed URL as the notification image? home-assistant/companion.home-assistant#1125 I still have not heard a definitive word on why this doesn't work for me. Also see https://community.home-assistant.io/t/ios-notifications-with-public-images-on-a-private-server/782914 |
Yes, I have a second automation to handle the response because I don't know how long it will take. I generally don't want an automation to sit around waiting. You can also then make the response automation more general and handle all of your camera notifications by looking at the response and tailoring the notification to it. Also, I think in your original example, your automation has already triggered, so you aren't going to get a second trigger with the response URL in it after the automation is already running. For your second question, I assume we're both going this route because our HASS is not exposed to the internet, not because we want the added complexity of using Amazon S3, ha. The below code works for me. It shows the thumbnail on the notification, I long press to see it even bigger, and when I tap on it it takes me to the actual url so I can zoom in. I also tried the default code from your forum post and it worked for me so there's something up with your config.
Try adding that URL path with the image link in it to see if tapping your notification brings you to the picture on Amazon S3 or not. If that doesn't work then there's more wrong with your HA than just images in notifications. |
Got it, thanks @nukefrenzy! Did you have to do anything special with config or did it just work out of the box? Doh, I just realized I'm running Home Assistant |
@jritsema No, I don't remember having to do anything in particular. I run HA OS directly on a Dell machine so I have access to the internet without having to jump through any hoops. Do you have docker, virtual machine, or some more complicated setup that may interfere? Do you have adblocking or a VPN on your network or phone that may interfere? Good luck! |
@nukefrenzy I'm running HASS in a container, but it should have |
Hello. Thank you for this useful component.
I'm curious why the
put
action is synchronous and thesignurl
action is asynchronous? Meaning thatsignurl
generates an event that has to be listened to.I'm trying to create an automation that uploads an image to s3, generates a signed url, and then accesses the output URL, all in the same automation. Something like:
It seems that wait_for_trigger never fires. Does anyone have any tips on how to get this to work?
The text was updated successfully, but these errors were encountered: