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

Pushover now supports image attachments - would be grand to add this to mqttwarn #284

Closed
sumnerboy12 opened this issue Jan 24, 2018 · 8 comments

Comments

@sumnerboy12
Copy link
Collaborator

https://updates.pushover.net/post/170043375237/pushing-images-with-pushover-30

@jpmens
Copy link
Collaborator

jpmens commented Jan 25, 2018

Make it happen, Ben! :-)

@amotl
Copy link
Member

amotl commented Jan 25, 2018

Dear Ben and Jan-Piet,

we just created the basic mqttshot program for publishing messages containing text and a single image to the MQTT bus. It currently has these properties:

  • Use base64 for encoding the image, it feels safer than binary and can be used to encapsulate the image into a message container.
  • Use JSON as message container format, as one usually might want to send other data along.
  • The image acquisition from different sources is already quite flexible, you can choose from File, URL and STDIN.

Please consider this as a proposal about a convention of how to send basic messages containing images over MQTT. We will be happy if this can help anyone tackling the proposed implementation for mqttwarn/pushover.

Cheers,
Andreas.

@jpmens
Copy link
Collaborator

jpmens commented Jan 26, 2018

That looks very good, Andreas. I think for mqttwarn we'd need to be able to configure the JSON element containing the image data, but otherwise that's a fine job. FWIW, I fully agree with not sending binary images: base64-encoding fits the bill perfectly.

@powermik
Copy link

I use a similar approach for images over mqtt but prepend the base64 string with a datauri:
data:image/png;base64,000000000000...
so i can display the picture in a browser just using mqtt over websocket.

Please add at least a field with filetype for that use case

@psyciknz
Copy link
Contributor

psyciknz commented Apr 6, 2018

I think I have updated the pushover to support this. Works with json payloads, it can accept either an imageurl parameter which it will download the image and include it, or a base64 encoded image.

My development machine (with github) is out of action today, but I'll try to add the code in the next day or two.

regarding @amotl above, I use "image" as the binary base64 image, and "imageurl" for an image to be downloaded, as it looks like they use the same tag.

@psyciknz
Copy link
Contributor

psyciknz commented Apr 7, 2018

Is this in the right place? It doesn't show under your repo for pull requests: psyciknz#1

@jpmens
Copy link
Collaborator

jpmens commented Apr 8, 2018

The PR for this is being addressed in #304

@sumnerboy12
Copy link
Collaborator Author

Implemented via #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants