LG webOS Notifications w/icon: Problems

I can now show only message without icon…

Seems like this issue https://github.com/home-assistant/core/issues/31213 is again exist

No, it’s not bug. Messages on TV works OK. I think WebOS not support custom icons now.

Anybody else having this same issue

Is it possible to control how long the notifications stay on screen or even have it persist till a click?

Not that I know of.

Maybe not what you all are looking for, but in case you want to display a message on your LG TV that doesn’t disappear like a toast you might consider using an alert.

service: webostv.command
data:
  entity_id: media_player.lg_webos_tv
  command: system.notifications/createAlert
  payload:
    message: This is an alert.
    buttons:
      - label: OK
11 Likes

I found this topic because I also cannot send the icon in notification as the others. I playing little bit and found it is possible to have an icon if you send alert instead of toast notification (thanks for the hint @lgespee ), but sorry guys, this would be possible on rooted TV, because you need to have your icon locally on TV. Yes, I am aware that most of the people didn’t rooted their TV’s, I rooted my because of Hyperion-NG screen capturing and because of YT without ads :crazy_face:

This is just addition to previous post, below path of the icon is local path on the TV, transferred via SFTP. My TV is rooted, but it shouldn’t be mandatory.

service: webostv.command
data:
  entity_id: media_player.lg_tv
  command: system.notifications/createAlert
  payload:
    message: It is working on rooted TV!
    buttons:
      - label: not OK
    iconUrl: "/home/root/gas-mask-100x100.png"

How could you achieve this on non rooted TV? Simply put your icons on USB stick or external HDD/SSD. I noticed that firstly mounted external USB storage will always appear in /tmp/usb/sda/sda1/ on TV. The next one will appear in /tmp/usb/sdb/sdb1/ , etc. So in this case, iconUrl would be something like:

iconUrl: "/tmp/usb/sdb/sdb1/gas-mask-icon-80x80.png"

And it is working. I believe this should work on non rooted TV as well.

Regarding Toast notifications and icons, as per LG documentation, icons should be 80x80 and in .png format, but I had no success to display it in toast, even if I resized it to 80x80 in .png and trensferred it to TV.

EDIT: Oh, maybe I forgot important part to mention. My TV is OLED55C11LB, software version: 3.21.20, webos version: 6.2.0-35 (kisscurl-kavir).

7 Likes

I just wanted to thank you for posting this. I was able to get the image to display on a non-rooted LG TV from a usb. I liked the alert much more than the toast. I couldn’t have got it working without your instructions. Thanks again! :slight_smile:

2 Likes

No problem, and thank you for these nice words :slightly_smiling_face:

1 Like

Wow, thanks @stiw47 for this info!
Do you have info, which parameters to use to get the buttons “actionable”?

For example I can show a stream on TV at the moment, but how to attach this to the button? Which documentation to “translate”?

My current “command with payload” is working nicely:

    command: system.launcher/open
    payload:
      target: http://192.168.1.127:8081

I wonder if some WIFI-enabled SD card works as image pool to load images (from door camera for example): Image from camera could be loaded to SD and then displayed on TV for some time

Hehe, you’re welcome.

I like your idea, but didn’t dig such a deep. Maybe will look into it when I catch some free time. This and this are some useful links I am aware of.

I don’t think so this is possible (but, on the other hand, cannot be sure ATM). I mean, I would be able to do this by transferring photo from WiFi SD card to TV via SSH, then handle it locally on TV, but as I said before, I rooted my TV, so I’m SSH’ing into it. Off topic: I even edited Custom Screensaver app for WebOS (root needed for app to work), so I can set custom images from HA UI.

Example:

shell_command:
  lg_screensaver_among_us_instagram: "scp -i key/id_ed25519 -o 'StrictHostKeyChecking=no' lg-screensaver/among-us-instagram.qml [email protected]:/media/developer/apps/usr/palm/applications/org.webosbrew.custom-screensaver/assets/screensaver-main.qml"
  lg_screensaver_among_us3: "scp -i key/id_ed25519 -o 'StrictHostKeyChecking=no' lg-screensaver/among-us3.qml [email protected]:/media/developer/apps/usr/palm/applications/org.webosbrew.custom-screensaver/assets/screensaver-main.qml"
and so on........
1 Like

I found it, thanks to this post.

service: webostv.command
data:
  entity_id: media_player.lg_tv
  command: system.notifications/createAlert
  payload:
    message: It is working!
    buttons:
     - label: "Launch Jellyfin"
       onclick: "luna://com.webos.service.applicationmanager/launch"
       params:
         id: "org.jellyfin.webos"
     - label: "Launch Retroarch"
       onclick: "luna://com.webos.service.applicationmanager/launch"
       params:
         id: "com.retroarch"
    iconUrl: /home/root/gas-mask-100x100.png

Maybe not right topic to ask, but I would like to know in short: How HA WebOS integration is communicating with TV. I mean, I would like to be able to send webostv.command from Postman or with Curl, if they communicating this way. Wouldn’t like to make off topic here, but if somebody could point me on some documentation with endpoints (I didn’t find anything) or simply answer short if they communicate differently and if this is not possible. Thx

2 Likes

iconUrl in view? screenshot ?

Scroll few posts above.

Posting this for others that might need it.

I recently bought a new TV that’s running a newer version of webOS after my old LG TV started having issues (new TV webOS version is 03.30.71, the menu is now on the far left of the screen and notifications show up in the middle near the bottom of the screen instead of top right corner). I really loved the notifications that was available on my previous TV, when the WiFi worked that is, but the new one doesn’t seem to be working the same for me at least. I can’t get notify.lg_webos_smart_tv service call to work, might be due to the new version of webOS or the fact my old TV that I had previously connected to HA maybe has some lingering settings hidden somewhere, not sure, but webostv.command works great. Thanks to @stiw47 info above I was able to get images to show up as well on a non-rooted TV using a USB thumb drive.

service: webostv.command
data:
  command: system.notifications/createAlert
  payload:
    message: Testing with icon
    buttons:
      - label: DISMISS
    iconUrl: /tmp/usb/sda/sda1/test_icon_80x80.png
  entity_id: media_player.lg_webos_smart_tv

One thing I didn’t like is having to click on the remote “enter” button to get the notification to go away and since the automatically temporary “system.notifications/createToast” alert doesn’t allow icons, I did some testing using the service call for remote control buttons and now have my notifications with icons pop up using the above service call then wait 5-8 seconds inside the automation and then perform the following service call to dismiss the notification for me. Might help someone else in the future maybe.

service: webostv.button
data:
  button: ENTER
  entity_id: media_player.lg_webos_smart_tv
2 Likes

@stiw47 nice find with the icon, thanks for sharing it.
A question, the icon does not work on my TV, does it have to be a WebOS 6? My TV is on WebOS 5 (5.4.3-35 to be exact)

Tried both /tmp/usb/sda/sda1/some.png and /tmp/usb/sdb/sdb1/some.png with a 80x80 PNG image, but it only shows the alert.
Since it is Linux based, I don’t think the USB device path is different on WebOS5, so the path should be correct right?

Unfortunately, this is something I cannot tell. Vendor implementations of TV OSs very often knows to be ridiculous funny. Also, it is not mandatory that they keep same mount path from version to version. First thing funny for me was that they mounting removable device to /tmp directory. On Linux, /tmp is usually used for temporary stuff, because it being wiped on each reboot. We are usually using directory /media/<username> for mounting removable devices and other partitions. Ok, you can mount anything where ever you want, but this is just some good practice. So according that they choose /tmp for removable storage device mount on my TV, I really cannot imagine how creative they were with yours :joy:

If you don’t want to root your TV, you can try to enable Developer Mode. This is official, by LG, and you can turn it off when ever you want. It will anyway auto turn off after certain amount of hours. Developer Mode allows you to install applications manyally. LG webos app extension is .ipk. All manually installed apps being auto deinstalled once when dev mode is turned off. But what is more interesting for your question, if I remember correct, you can enable telnet from dev mode. Telnet supports ls command (and more commands which you would usually use from ssh), so you can explore your file system, and maybe find where and with what name is usb mounted.

1 Like

@stiw47 thanks for your time and explanation!
I enabled the Dev Mode and reach the TV with WebOS Dev Manager, from there I could browse to the USB, and the path is same as you mentioned.

EDIT: While I was there, I uploaded the png file to the root of the TV and that didn’t work either…

I think WebOs 5 does not support images in alerts and notifications, if anyone else with WebOs 5 manage to do so, please share with us.

2 Likes

Any News with actual WebOs ?