WebOS LG TV Notifications/Control

Has anyone looked at having a driver for LG's WebOS TVs? Particularly sending notifications. They have an open AP, the is an NPM package and a Home-Assistant integation


4 Likes

And a smartthings app but it still needs the node package.

As an update, I have this working with Node-red now.

1 Like

I'm interested in this anyone have any luck?

I installed @asj driver and app and can send notifications to my TV. Would love to be able to modify the icon it sends with these though.

@joetlawson icons are sent from the client, Home assistant uses a local file to load the data from, converts it to base64 then sends in the request.

Sadly we don't have access to files/file system. So either we have to fetch an icon from a remote system, or people will have to cut & paste in a base64 string. Not hard, but hardly user friendly.

Anyways, up for thoughts, but sending icons seems to be a bit of a pain for hubitat.

Python code to do it is here:

1 Like

@asj Thank you again for all your help. So I run a windows server 24/7 if I wanted to use this python code to send the icons how would I go about it sir?

Ok, @joetlawson 'cause something it's fun to do crazy things, I've upadated the driver to send notifications with a custom command, "notificationIcon"

It takes 2 strings, first one is the text and the 2nd if the icon name. Read the comment at the top of the code to see where I get the icons from, and what they're called.

I fetch the icons from the web, and then cache them in the state object. This feels terrible, but you know where else can I stash 2k of data? There's a clearIcons function as well to erase all cached icons.

Also asyncHttpGet doesn't allow me to read binary data, so I have to uses httpGet, but since we only fetch icons when they're new...well maybe this isn't terrible. Surely not much worse than storing icons in state...

Let me know if this works for you. Works for me, and has successfully annoyed my partner tonight by popping up all sorts of dumb icons on the TV while she was watching TV.

This is awesome got it installed. Not sure if I'm just missing it or what but not seeing anything referencing icon names. I looked at the original python code is that what you are referencing?

In the LG Webos Driver for the Hubitat. What I said was hard a post back. :slight_smile: not sure it’s “good” but it works and it’s kind of cool.

Edit:
You can also send a notification with this format: [icon-name]Message and will go fetch the icon is required, and then display the icon. This should make it easier to integrate with hubitat notification tools

1 Like

Great stuff man, I just got myself a 55E9 I'll be testing this tonight.

Thanks for the contribution

@asj I'm not sure I'm doing it right. I tried one of your examples and I'm not getting an icon on the message. Am I doing something wrong?

@joetlawson Huh, can you:

  1. Try it from the device itself. There's 2 commands, both deviceNotification and notificationIcon which takes both the message and icon name.

  2. And turn on info logs (bottom of the driver) and what do logs say when you click the command?

See below sir.

dev:9702019-12-06 03:07:21.433 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_asj_LG_WebOS_TV_902.notificationIcon() is applicable for argument types: (java.lang.String) values: [[status/battery-low]] Possible solutions: notificationIcon(java.lang.String, java.lang.String) (notificationIcon)

Looks like the driver saw the string:[status/battery-low]

which is just the icon name. What did you send?

It should be: [status/battery-low]My Battery is Low

Did you try from the driver itself?

Yeah see below for how I formatted it.

Then in the test I have this.

This is the logs from those test in the driver and running the rule.

Thanks for all your help by the way!

Ah I see the problem with the command you tried, try this:

59456CBB-FE1C-40CD-BF62-6FEF596ABF45

Not sure why the notification didn't work though, this is what I have tested:

Ok, I used a different file...but worked for me.

When using the driver directly as you have it I get this. But I do not see a message on the TV. I will keep trying and validate all is good such as IP etc but I did set a static IP.

dev:9702019-12-07 07:14:38.350 am debugsendWebosCommand sending json: {"id":"command_11","type":"request","uri":"ssap://system.notifications/createToast","payload":{"message":"My Battery is Low","iconData":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAOwSURBVHja7VdLSyRXFL7nPurRre2rfYxvESJuskhkggMh0Z+QVTA/IIgE/ANuzSquspilDmSbH+EuxM0IIggiHRXnEbXtru7qenTdfGfS+yC5M1lkDnzUrbpd93z1nXPPPa2tteK/NC0eaevr689XVlaeLi0tmYGBAaOU8q6urm4ODg6+Pjo6yt47gfv7+++Pj48FKzc6OiqklOLy8nJheXm5iukb5wR2d3efXFxc+LVaLek9ahRFIeI4ZjIiz3Nxe3sr7u7uhtfW1izu5cbGhtnc3Ky5IMAOfpmZmfl9bm6uobWmIAh+8jyPwjCUgFpdXX0GNQoQ+hFEX8HaSZJ8jle/dEIAznSn02lA6hbGqlQqqb6+PgPnmse+7xPmNOb6FhYWRqvVanJ2dmachQBJVlxfX7/6EzY4OKjgQPMVMJVKRSMcywLWhbVarTewpjHmiTMCWKyLr2s/PDzUEev8/Py8y6QmJyf19PS0wq64ge+82Ww2Dg8PX+7v77/d2dn5zCkBxD0mohakztI0zdlOT0+7Jycn+fb29gNyI0UoGkRUx1QTocmcESAiCxIJru0UhoTL2+12DukzJlIulztQJIUKydDQUAtKRHiWvbc6kGVZwZIjJBmyPUV4Mnx9CoLx1NRUhO0YIUHzRxBwZ1wfoE4XihUfjAAU+QMqJIhOxDXg8ZXQsX0k8JHA/4MADiK5uLhoxsbG+FYB8oMRmJiY0PPz82p8fLzAWBGRx20Drkr0zFrrjgAW4wpHSikJp2Z2dlbCsRgZGSnQknUxF/ARgYLE5TjA84S7IpcECFAMSO6jH5BwQmhKLJ+UaMte4/Rr46iOAerv7zdM2BkBLCYBBachGhAFxxqHj4RTixJc4MtD1H+BrolwH6JHYDWkSwKEBfU33331g+eHqhSE3BeS8YwwhkSu6hVLlKlynH/6dKp1c/vFC5yW7hTgxaSUBpHQUkgpLL0DWUnCSkuCjC0QqQK5YhEV7QUcLqc5gAT0heXtRkrCiDSAoZBQSGBgddEFhy4prbQP0m5DAAIazv++t+8GiggKkOQbAkceYwiZlOEkdKsAYF7+VvsV2453gT88HPqVimcIuSBkuYr5KK6n0fV56/Xd2yhyugvQZt/X6/VPkOEt/j3aMBNFkYcdYfiPCSzADojRosVo30fQknXwB6XjjMDe3t63uIRAAPiAB5jeuwRYoAtkQAKw85+3trZ8KJP8KwK98sogQAK6R6TUIyV7juMekRRgswwi+sey/BfNIu/efs1vMAAAAABJRU5ErkJggg==","iconExtension":"png"}}

dev:9702019-12-07 07:14:38.336 am debugSending: {"id":"command_11","type":"request","uri":"ssap://system.notifications/createToast","payload":{"message":"My Battery is Low","iconData":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzA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0m5DAAIazv++t+8GiggKkOQbAkceYwiZlOEkdKsAYF7+VvsV2453gT88HPqVimcIuSBkuYr5KK6n0fV56/Xd2yhyugvQZt/X6/VPkOEt/j3aMBNFkYcdYfiPCSzADojRosVo30fQknXwB6XjjMDe3t63uIRAAPiAB5jeuwRYoAtkQAKw85+3trZ8KJP8KwK98sogQAK6R6TUIyV7juMekRRgswwi+sey/BfNIu/efs1vMAAAAABJRU5ErkJggg==","iconExtension":"png"}} storing callback: command_11

dev:9702019-12-07 07:14:38.323 am infonotificationIcon(): icon size: 1436 sending notifcation: My Battery is Low name: status/battery-low icon: iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAOwSURBVHja7VdLSyRXFL7nPurRre2rfYxvESJuskhkggMh0Z+QVTA/IIgE/ANuzSquspilDmSbH+EuxM0IIggiHRXnEbXtru7qenTdfGfS+yC5M1lkDnzUrbpd93z1nXPPPa2tteK/NC0eaevr689XVlaeLi0tmYGBAaOU8q6urm4ODg6+Pjo6yt47gfv7+++Pj48FKzc6OiqklOLy8nJheXm5iukb5wR2d3efXFxc+LVaLek9ahRFIeI4ZjIiz3Nxe3sr7u7uhtfW1izu5cbGhtnc3Ky5IMAOfpmZmfl9bm6uobWmIAh+8jyPwjCUgFpdXX0GNQoQ+hFEX8HaSZJ8jle/dEIAznSn02lA6hbGqlQqqb6+PgPnmse+7xPmNOb6FhYWRqvVanJ2dmachQBJVlxfX7/6EzY4OKjgQPMVMJVKRSMcywLWhbVarTewpjHmiTMCWKyLr2s/PDzUEev8/Py8y6QmJyf19PS0wq64ge+82Ww2Dg8PX+7v77/d2dn5zCkBxD0mohakztI0zdlOT0+7Jycn+fb29gNyI0UoGkRUx1QTocmcESAiCxIJru0UhoTL2+12DukzJlIulztQJIUKydDQUAtKRHiWvbc6kGVZwZIjJBmyPUV4Mnx9CoLx1NRUhO0YIUHzRxBwZ1wfoE4XihUfjAAU+QMqJIhOxDXg8ZXQsX0k8JHA/4MADiK5uLhoxsbG+FYB8oMRmJiY0PPz82p8fLzAWBGRx20Drkr0zFrrjgAW4wpHSikJp2Z2dlbCsRgZGSnQknUxF/ARgYLE5TjA84S7IpcECFAMSO6jH5BwQmhKLJ+UaMte4/Rr46iOAerv7zdM2BkBLCYBBachGhAFxxqHj4RTixJc4MtD1H+BrolwH6JHYDWkSwKEBfU33331g+eHqhSE3BeS8YwwhkSu6hVLlKlynH/6dKp1c/vFC5yW7hTgxaSUBpHQUkgpLL0DWUnCSkuCjC0QqQK5YhEV7QUcLqc5gAT0heXtRkrCiDSAoZBQSGBgddEFhy4prbQP0m5DAAIazv++t+8GiggKkOQbAkceYwiZlOEkdKsAYF7+VvsV2453gT88HPqVimcIuSBkuYr5KK6n0fV56/Xd2yhyugvQZt/X6/VPkOEt/j3aMBNFkYcdYfiPCSzADojRosVo30fQknXwB6XjjMDe3t63uIRAAPiAB5jeuwRYoAtkQAKw85+3trZ8KJP8KwK98sogQAK6R6TUIyV7juMekRRgswwi+sey/BfNIu/efs1vMAAAAABJRU5ErkJggg==

@joetlawson Huh, ok everything looks good now so I'm stumped, especially since it works from Home Assistant for you. Are you sending .png files there or something else like .jpg?

Can you post what your driver says here?

I'm curious what it reports for the OS version you're running.

Oh i don't use it in home assistant just was referencing that it was being used on there, See below sir.

{deviceType=tv, deviceOS=webOS, protocolVersion=1, pairingTypes=[PIN, PROMPT, COMBINED], deviceOSVersion=4.1.0, deviceOSReleaseVersion=4.7.0, deviceUUID=c5116e9c-640e-ea25-16ea-d5f37c761e5d} * lastChannelDesc :

  • webSocket : open
  • televisionModel : 75SM8670AUA