Comments (4)
EDIT: !!! Only for v1.0.0 ignore this if you are running v1.1.0 !!
Hi @johngrinders,
Glad to head everything is working out great for you. I do admit, this feature is sadly not as straightforward as I would have liked and I'll make sure the README will include some general examples. I made a quick example flow (the flow labels are in Dutch but you'll probably work it out π) https://homey.app/f/UKYLO1 (Sadly the UI of the flow sharing isn't that great)
So to walk you through it a bit...
The first text field is obviously the message field. The second and third field are both required for the icon.
The second field tells the TV what type of image you are sending to it. So if you have an example.png
image, the field should be png
etc. for jpg...
The third field is a base64 representation of the image. To convert an image to base64 you can use any image to base64 convertor online (I use https://www.base64-image.de) and copy the string. The string will look something like this:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIqADAAQAAAABAAAAIgAAAAACeqFUAAADpklEQVRYCcVYS24UQQztniRK4CgsWLCOhITIWZJbhHCK5C7AAoltJOAsiImmZwY/v3r1cfWkAwviKO362X5+5aruZBxMbm9vb6CfS66urq7Hu7u7691u9+HNl0/PguP+3fthHMePx4j++uvn4dW3eSDjMA57+4GG7O0XLWhKGAndvJjmnYPJEPx8ezE4EHTWZ2lldOTR5AV+CAoaYtkM+72NmXaJ9hjWGFc0z+mIdgXIKed7BtrA5ANrC7i23cTpOwLFPAaQACEQQ7VOQDhcnsyYmWNU2UNT2pRBDKYyQamdlycrqRaIwXk4W/kcqV/5FmhxrceBc9CQfn0LLKNKSOJWdkB+a2t8z2sGmF2bUbUtToEhyhSkdiJsidG+Rs6Q34zAoZLEtNoJy3JNRZ9Kgnoba+RBpybahb72vzAUkDpDqTB63F2NbRog1tHWhLhdNzLgW+JYmCGL2eqoIA0+WkamY/Ydz3SEYpWjUBMYVtJwqaDQM9LXROsvEDYgNsSBbA2VGIkZxwusK5KM8gAyxsnP6L87NdtTUQabuTbHmJG5S0t0+UPLsibQB6sHawy3MQd3dY1sjJ59Lla5UYYIoDG0wk2rqfnlxTTNx61Z2W7gRmKN2HOTji8Rm70cV9mg2dUAxuxXy9UmP7B4XE6MBFxhqUbKqVm6OeMedww9HrebXdVbgyNUTo1Rb/zp+KkNDUHmBOPd3MbYU4T2hcHTFogxkvwoSHGsANJtuCVGYKXgsFQbGvKyPr4o1ocTBooLaWlzsgyu5hkryyMQhi/Pace4uUbWCUhZolaERkMdcc7iK25eyLAOOQC2p267MbspnxpcaHQVDeev8MM11MFxpDWjbSIT5jMQbM2L9H1h53Ycy7sCZu5LEWzOzzY05rr1YOcwA3ErJwMB8a3BNVu+0FrEGQUJo1V9QvyGsuF0qri+YiDM854Co3TVvvQMSHnXtAyIDeHoGUJQm9XxdoaqrbN48oHQasvf9IuAyIh9s+oe4fDTn9yaKrAB0ticF81BQ5q3b701EXF0FvdYp0eagQ7XmKoH2oE03yOokfzSi6FD35HWNWDzQu9LGUDAgnXXDZ8B1fdIoDZSGRnp5iOuGNqL15CnmsJlCmGN2DPXSJdxyj4Z0kxZo6e2NFccfAb/4eMZx1eOxDM0BOMaQ19tzWPs36U7vmv9ORHjRBx/y8ACxqZGLn6c579BlxmIyCLyhchh+uL7uYf0/cD/SML8f+1eXl7e/AGKkeCEuESxxwAAAABJRU5ErkJggg==
Now it's important to strip everything before (and including) the first comma (data:image/*;base64,
). So the example string will look like this:
iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIqADAAQAAAABAAAAIgAAAAACeqFUAAADpklEQVRYCcVYS24UQQztniRK4CgsWLCOhITIWZJbhHCK5C7AAoltJOAsiImmZwY/v3r1cfWkAwviKO362X5+5aruZBxMbm9vb6CfS66urq7Hu7u7691u9+HNl0/PguP+3fthHMePx4j++uvn4dW3eSDjMA57+4GG7O0XLWhKGAndv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GKkeCEuESxxwAAAABJRU5ErkJggg==
Or if you are on MacOS (no clue for other OS) just run base64 /path/to/image.png
and you will get the base64 string without the data:image/*;base64,
part.
I hope this makes a bit more sense for you, let me know if it works for you.
EDIT: !!! Only for v1.0.0 ignore this if you are running v1.1.0 !!
from homey-webos-plus.
So when writing the explanation above, I really started to dislike how it works. Therefor, I decided to rewrite it a bit resulting in a new version of the app. It now allows for urls to image as well.
- The icon extension is no longer required
- You can use e.g.
https://i.picsum.photos/id/882/200/300.jpg
as image and still use base64 if preferred. Removed thedata:image/*;base64,
is also no longer needed.
from homey-webos-plus.
Installed version 1.1.0, everything works perfectly. There is a proposal to make it possible to add an image from the Gallery application, as for example this can be implemented in sending a push message with an image. There is another question regarding image size. as I understand it, in a message it is displayed with dimensions of about 300 ns and 300 pixels, and you canβt do it again?
from homey-webos-plus.
Hi @johngrinders, I was definitely not aware of any Gallery app (I will look into this), can you please create a new issue for both questions as they don't seem to relate to the current one. Furthermore, I do not understand what you want to achieve or mean with the second question.
from homey-webos-plus.
Related Issues (20)
- Sending toastmessage with gallery image not displayed on TV HOT 51
- Speaker track undefined
- Power on issue HOT 7
- Power off issue HOT 22
- WebOS Plus v1.3.1 crashing HOT 2
- TV marked as Off when screensaver is running HOT 7
- App crash HOT 12
- TV started sending on/off signals randomly HOT 2
- Change input by variable HOT 1
- "App or input select" shows last fav website regardless of choice
- Screensaver State ? HOT 2
- App crashes right after authorized on TV
- Green download button is working but WebOS Plus app is not installed on Homey HOT 1
- SDK 3 HOT 9
- Many flow.conditions[*].titleFormatted is missing HOT 1
- App origin is unknown HOT 2
- TV turns on HOT 4
- Error occurred during npm prune
- Image on LG C2 TV HOT 3
- No cards after installation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homey-webos-plus.