LG WebOS better integration

I’ve got a question about the toast functions:
The plain txt version works perfectly for me, but the ‘Gallery image’ one doesn’t display anything?

image
Ring image does get send to Telegram.
Also with a test with standard Homey image does work for Telegram but nothing can be seen om my tv?
Any specific size requirements or format needed for the toast function?

i do the same thing, i grab the ring image and send it to the tv using that action. for me it works (if the grabbing works)

@Ollem @Kaoh, I have no Ring so sadly I cannot test this (I do accept donated Ring devices :wink:)

So maybe you both have different Ring devices/versions? The only requirement (and I don’t have much information about this) is mime-types. However, the mime-type is retrieved from the image you put into it.

This is the code used for notification with a gallery image

            const imageStream = await droptoken.getStream();
            icon = await new Promise((resolve) => {
              imageStream.setEncoding('binary');
              const type = imageStream.contentType;
              const prefix = `data:${type};base64,`;
              let body = '';

              imageStream.on('data', (chunk) => {
                body += chunk;
              });

              imageStream.on('end', () => {
                const base64 = Buffer.from(body, 'binary').toString('base64');
                const data = prefix + base64;
                return resolve(data);
              });
            });

I am more than willing to help you out, but it’s obviously hard when not having the same setup and no access to logging :frowning:. I am still waiting for Athom to decide what to do with my app.

It might help, might be useless… depending on your skill level, you could run the app on Homey with logging available. Instead of running homey app install use homey app run and keep the terminal/cmd window open. Here the logging will show up so you can debug it. If something goes wrong, an error should be visible here. If you do try this, send me a PM so we can debug it there and not spam the forum :slight_smile:

EDIT: When finished reinstall the app using homey app install

interesting, the ring app still use the deprecated getbuffer method. ill use your example in the ring app to see if that works, if so it should match in all cases. will be tonight though, busy day ahead of me today.

This is the debug message when I try to ‘toast’ an image:

[err] [ManagerDrivers] [webos_plus] [0] Error: timeout
at Timeout._onTimeout (/drivers/webos_plus/lgtv2/lgtv2.js:222:18)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)

Each time same error message.

@Ollem The error message is pretty clear. At line 222 a timeout error is thrown as it takes longer than 15 seconds to get an answer from the tv when making the request.

This might happen if to much data is is being send which causes the tv to process it for longer than 15 seconds, which then results in the said timeout. Do you have any insight in the file you are sending to the tv? Resolution, file size, etc…?

I have the same issue overhere. File size is only 55kb.

@Peter_de_Vos @Ollem, could one of you create a ticket on my GitHub so everyone can track things in there instead of spamming here.

done!

1 Like

Thanks :+1:

@Kaoh, @Wingleader @Everyone else in this group,

I complete rewrote the app due to chaotic code. Mostly, v1.* was not really intended for real public use as I did not expect people using it and some feature requests required me to add/change some parts. Code will almost always get a bit messy when time passes but this should help me keep it much more structured and clean :slight_smile:

I did change one mayor part, on/off state checking, therefore, I am currently releasing a ‘release candidate’ instead of a public release. Everyone who is willing can install the v2.0.0-rc1. This is actually really the same as a full release, but just in case I missed something and stuff breaks you won’t get to yell at me :wink: let me know what you think!

All flows and devices should be intact!

PS: I drastically increased logs for debug purposes, don’t be intimidated.

3 Likes

Hey Max, will have a look at this version in the weekend and also give some examples about the texts that are used. I will make a screenshot for you from my tv so you can see the number of inputs. I think you are right about the caching issue.

I completely removed the caching of inputs and channels now. Downside is the must(!) be turned on when making flows using channels or apps/inputs. The placeholder said it needed to be on before, but that was only true for the first time. After that I would use the cache only. Maybe I need to create a fallback to cache instead.

I downloaded your ‘rewrite’ branch and it installs as v2.0.0
However, it crashes immediately.
with ‘app run’ debug shows:

[log] [WebosPlus] WebOS Plus is running…
module.js:550
throw err;
^

Error: Cannot find module ‘node-wol’
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at Module.require (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/index.js:1:253)
at require (internal/module.js:11:18)
at Object. (/drivers/webos_plus/device.js:22:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions…js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)

— INFO: com.maxvandelaar.webos-plus has been killed —

@Ollem check this ticket: https://github.com/MaxvandeLaar/homey-webos-plus/issues/4

I gave it a try and here are my findings:
I have weir on/off behavior. When turning the TV on it often shutdown almost immediately. When power off it never detects the power off state.

The power on event is almost direct in my case, but it does turn off again.
The power off event is never received in my case, so no feedback on the timing.

I created tickets for those power cycle issues

To everyone here… Obviously Athom again rejected my app from the store and they even considered copying my features, however they decided that my extra features where to complex for most users :joy: So sorry if I confuse anyone here with better and more features so you can do decent automations.

The fact that they have direct insights in my code and can copy whenever and whatever the like (even though license restricts this, however I will never know if they do) I will most likely take my code offline from Github and only publish releases there. I will research if I can obfuscate my code to prevent easy copying. Sorry for this message… I am really disappointed in Athom again. If they’d just let me take over their app… So if anyone has some connections @ Athom please make it clear to them that they are destroying their developer community

7 Likes

That is really ridiculous. What’s so hard in just admitting that the app isn’t that good? There is even someone willing to take over… If they would be so active and commited, ok, but they aren’t since the app is not working well.

In my opinion: it’s not even about the features. It’s about a working app.

p.s. I have an appointment with them soon and I’m gonna ask about it. Not that it will change something, but I’m curious about why they chose this path.

@Martijn_C, exactly, if they were actually committed to maintaining their own apps or let open source it(!) so they can collaborate with the development community. But now they shut us out and demotivate me to actually contribute to the Homey. Since they are willing to steal features and work I feel they do not sincerely appreciate work (saying it won’t make it true Athom :wink:)

The thing is, the community on this specific topic so very friendly, understanding and more than willing to have a decent app. This is the ONLY reason I won’t drop this app and it makes me go to extreem lengths to still publish my app while preventing Athom copying work. If they ever change their minds, they are free to contact me…

4 Likes

Some times u get a cake for that!
Some times ur not!
But it’s a shame they scare away community developers like this. Here comes the ikke ikke ikke part again!

3 Likes