#Hey @code-in-progress i assume im in the
1 messages ยท Page 1 of 1 (latest)
HAOS
Try find / -type f -name "[the name of the file you want to edit]"
https://i.imgur.com/DLKbarv.png shortened the results a bit with grep
lots of libraries use endpoints.py apparantly :P
Eh, maybe. What you need to find is the one that hosts core. What do you get if you do a docker ps -a?
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.
ran the command again with grep "8123" no hits unfortunately.
Ugh... duh, I'm an idiot today (and working too lol).
lol :p
The second container is it.
So, you'll want to do a docker exec -it [that container id] sh
THEN run the find commaand.
that looks more like it!
Yay!!! 
so uhm, does this docker image have a text editor built in
vi
But you could probably docker cp it out, edit and then cp it back?
hm i think that may be challenging from the proxmox node browser shell
lol well, this isn't easy for various reasons... can't say I disagree with them.
Same actually :P regardless it is always fun to tinker
well the file was edited, im gonna reboot for good measure
Ok. Sounds good. Let me know how it goes!
๐ค
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
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?
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
Time to get a newer TV ๐ But, yeah, I see what you mean.
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
Oh hell, mine is older than that! 2017 model. But, tbf, it's now a computer monitor, so it's always on hdmi-1.
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
๐
Sorry... had to step away for a few... NICE!
So, how are you going to persist that across updates?
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.
Yeah... well, set a reminder and it should be good I guess?
(That's if you update often, not everyone does)
Yeah exactly, i've documented the process so should be easily repeatable.
Thanks heaps for helping me get there !
No problem! Happy to help ๐
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
That's it? Seems pretty minimal.
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.
And that's on the rooted TV, right?
Yeah
Hmmmm, I might play around with this over the weekend (if you don't mind me borrowing your code ๐
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 } ] }
Huh... Yeah, def going to try this this weekend... Thanks for all the hard work!
Created a Gist for this, still have to test the init.d part but will update if changes are required. https://gist.github.com/Kuchiru/55e1b509a85cbece056dc7196d5c7385
I have some more progress, still testing but its possible to circumvent editing files completely.
Ok. Youโve got my interest. I donโt mind editing and injecting changes, but no file editing would be better.
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.
https://github.com/Kuchiru/lgtv this is the one with my changes, i have yet to test though as i should be working.