#Hey @code-in-progress i assume im in the

1 messages ยท Page 1 of 1 (latest)

lean plume
#

This is fine. Yeah, that's not right. Are you running Container or HAOS?

hidden sable
#

HAOS

lean plume
#

Try find / -type f -name "[the name of the file you want to edit]"

hidden sable
lean plume
#

Eh, maybe. What you need to find is the one that hosts core. What do you get if you do a docker ps -a?

hidden sable
#

i used the official HAOS qcow2 image from home assistant by the way

lean plume
#

Hmmm... This is where me NOT running HAOS kinda sucks. There's no container running port 8123? I see observer (4567) there, but I don't see Core.

hidden sable
#

ran the command again with grep "8123" no hits unfortunately.

lean plume
#

Ugh... duh, I'm an idiot today (and working too lol).

hidden sable
#

lol :p

lean plume
#

The second container is it.

#

So, you'll want to do a docker exec -it [that container id] sh

#

THEN run the find commaand.

hidden sable
#

that looks more like it!

lean plume
#

Yay!!! ablobbouncefast

hidden sable
#

so uhm, does this docker image have a text editor built in

lean plume
#

vi

hidden sable
#

right!

#

gave up after nano and vim :P

lean plume
#

But you could probably docker cp it out, edit and then cp it back?

hidden sable
#

hm i think that may be challenging from the proxmox node browser shell

lean plume
#

lol well, this isn't easy for various reasons... can't say I disagree with them.

hidden sable
#

Same actually :P regardless it is always fun to tinker

#

well the file was edited, im gonna reboot for good measure

lean plume
#

Ok. Sounds good. Let me know how it goes!

hidden sable
#

๐Ÿคž

hidden sable
#

Well, Home assistant started, tv is broadcasting however i think i may need to adjust the handling of the mediaplayer state

#

i'm gonna look into that

#

Its probably a oneliner as well

lean plume
#

Ok, good... so, at least progress? Is this something you could submit as a PR? Eh, maybe not if the TV is that old, right?

hidden sable
#

Well, adding a custom endpoint to the TV's API is something that isnt for the faint of heart, i basically published an internal api by adjusting the permissions in the internal OS of the TV. something like this could hardly make it to the main branch as it would break the media state integration for tvs that support this out of the box

lean plume
#

Time to get a newer TV ๐Ÿ˜‰ But, yeah, I see what you mean.

hidden sable
#

Haha, yeah i would love one, this is one is from 2019 (LG OLED C9) but as you probably know these are on the expensive end and if it works fine .. no need to replace, this hobby is expensive enough as it is :D

lean plume
#

Oh hell, mine is older than that! 2017 model. But, tbf, it's now a computer monitor, so it's always on hdmi-1.

hidden sable
#

yeah mine is basically the same, i run plex and a pc on it, thats about it.

#

There are some subtle differences in the object its sending through so i have to find and make adjustments here and there, so far on to file number 3 :p

#

i think i can do this change with a custom component

#

Well, i did it

#

it works, im getting play, pause and idle states now

#

๐ŸŽ‰

lean plume
#

Sorry... had to step away for a few... NICE!

#

So, how are you going to persist that across updates?

hidden sable
#

Haha, that is a very good question, the media_player changes i can do via a custom component but the aiowebos library is a different story.

#

Its very simple edits here and there so its not too bad to re-do every now and then.

lean plume
#

Yeah... well, set a reminder and it should be good I guess?

#

(That's if you update often, not everyone does)

hidden sable
#

Yeah exactly, i've documented the process so should be easily repeatable.

#

Thanks heaps for helping me get there !

lean plume
#

No problem! Happy to help ๐Ÿ™‚

hidden sable
#

these are the edits:

aiowebos edits
endpoints.py change:
com.webos.media -> com.webos.service.acb

webos_client.py change:
foregroundAppInfo -> acbs

lg webos component:
media_player.py change
foregroundAppInfo -> acbs
playState -> playStateNow
lean plume
#

That's it? Seems pretty minimal.

hidden sable
#

yep

#

This doesn't factor in the edits made on the TV though.

#

Which are these:

# Create config overrides directory
mkdir -p /home/root/extra-interfaces

# Create config override/addition manifest file
echo '{"service": "com.webos.service.acb","methods": [{"path": "/getForegroundAppInfo","description": "get foreground lol","requiredPermissions": ["LAUNCH"]}]}' > /home/root/extra-interfaces/com.webos.service.acb.interface

# Enable config override...
mount -t overlay overlay -olowerdir=/usr/palm/services/com.webos.service.secondscreen.gateway/interfaces:/home/root/extra-interfaces /usr/palm/services/com.webos.service.secondscreen.gateway/interfaces

# Restart ssap service (it is restarted automatically when killed) - the name changes randomly because of [reasons]
pkill -9 -f ss.apiadapter ; pkill -9 -f ss.gateway
#

the override does not persist yet so i'll have to add the 3rd command to init.d which is tomorrow.

#

most of the work was being a detective and finding the correct places to edit.

lean plume
#

And that's on the rooted TV, right?

hidden sable
#

Yeah

lean plume
#

Hmmmm, I might play around with this over the weekend (if you don't mind me borrowing your code ๐Ÿ™‚

hidden sable
#

i dont mind at all!

#

this is the command in the tv ssh to see if you have the endpoint at all: luna-send -n 1 luna://com.webos.service.acb/getForegroundAppInfo '{"subscribe":"false"}'

#

you'll get something like this as response:
{ "returnValue": true, "appId": "cdp-30", "windowType": "_WEBOS_WINDOW_TYPE_CARD", "acbs": [ { "pipelineId": "_Ft70RTmNvefyJe", "playerType": "video", "playStateNow": "playing", "playStateNext": "playing", "isFullScreen": true, "positionX": 0, "positionY": 0, "width": 1920, "height": 1080 } ] }

lean plume
#

Huh... Yeah, def going to try this this weekend... Thanks for all the hard work!

hidden sable
hidden sable
#

I have some more progress, still testing but its possible to circumvent editing files completely.

lean plume
#

Ok. Youโ€™ve got my interest. I donโ€™t mind editing and injecting changes, but no file editing would be better.

hidden sable
#

Turns out Rale (the author of the media state changes) created a testing repository specifically for the media state changes for HACS. i repurposed that repository for my changes with minimal modifications so you would only need to add the repo to hacs, install and add the tv IP (accept prompt on tv). after that it should work.

#

its basically a ready to go template complete with the adjusted library as dependency.

hidden sable
#

Well it works.

#

no issues