Call Home Assistant Service from LG webOS

I’m not really sure about this, but I’d like to throw in a few ideas and assumptions.

First you would probably have to know the name of the service, because it is not always [appname].service. It could also be called [appname].foo for example. Maybe there are even more services.

In the terminal you would probably start the service like this:
luna-send -n 1 -f luna://com.webos.service.applicationManager/launch '{"id":"org.webosbrew.piccap.ServiceName"}'

Do you have a chance to try this out?
If that works, you would have to think about how to call this command in Home Assistant.
Maybe by using the command_line platform like here: LG webOS change picture setting mode with scripts - #20 by an1uk

Perhaps the service cannot be started on its own, but only provides certain functions for the app.
Then you would probably have to call the function directly:
luna-send -n 1 -f luna://com.webosbrew.piccap.ServiceName/ServiceFunction '{\"anyParameter\":\"anyValue\"}'

Maybe it’s much simpler and your code actually works anyway, except that the ID is wrong. Try to find out what the service is really called.

Maybe you can do something with one of my ideas.
Note again: I pieced together a lot of the things from online searches, which means they don’t necessarily have to be correct.

2 Likes