# LG TV notification using node-red-contrib-lgtv

**URL:** <https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652>\
**Category:** General\
**Tags:** node-red-contrib-lgtv\
**Created:** [12 August 2021 11:02 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652 "2021-08-12T11:02:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErnieP](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@ErnieP](https://discourse.nodered.org/u/ErnieP)\
**Post date:** [12 August 2021 11:02 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/1 "2021-08-12T11:02:46Z")

</div>

Hi All, I only recently started using Node Red (about a week ago) version 1.3.5 and have found ideal for needs. I installed it on a Raspberry Pi and so far everything wanted to use it for has worked, very impressed. I have a LG smart TV and noticed the Node Red has a LG set of nodes called “node-red-contrib-lgtv” so I installed them and tried sending a notification to my TV using the toast node which again worked first time, the only issue is that the notification only stayed on the screen 5 seconds, so easy to miss.

I noticed in some other ‘Home Automation’ software namely. ‘Home Assistant’ that it seem to have an option for a persistent notification, which I assume means that the notification stay on the screen until manually cancelled.

Does the Node Red LG interface have a method of creating a persistent notification?

Thanks in advance for any help you can give.

Ernie

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 August 2021 13:46 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/2 "2021-08-12T13:46:30Z")

</div>

This is a question that would be best posed to the node’s author on it’s GitHub page [GitHub - hobbyquaker/node-red-contrib-lgtv: Node-RED Nodes to control LG webOS Smart TVs](https://github.com/hobbyquaker/node-red-contrib-lgtv)

---

<div class="post-metadata">

**Author:** ![ErnieP](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@ErnieP](https://discourse.nodered.org/u/ErnieP)\
**Post date:** [12 August 2021 16:19 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/3 "2021-08-12T16:19:43Z")

</div>

Hi, Thanks for your feedback, I'll give your suggestion a try.

Ernie

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [12 August 2021 16:20 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/4 "2021-08-12T16:20:21Z")

</div>

I've had a brief look at the code for this node (I use it too but don't really use the notifications) There's not a lot exposed in the toast node, the only option is you can set msg.url which will make the notification clickable to open a url,  
There does seem to be more options in the underlying API that it uses, for example setting modal to true/false but to expose these would require a change to the node.[com.webos.notification | webOS Open Source Edition](https://www.webosose.org/docs/reference/ls2-api/com-webos-notification/)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 August 2021 16:41 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/5 "2021-08-12T16:41:55Z")

</div>

Have you tried sending multiple notifications in a row. As the system toast notification should display them one after another. This would atleast extend the display time.

reading [https://webostv.developer.lge.com/design/webos-tv-system-ui/notifications/](https://webostv.developer.lge.com/design/webos-tv-system-ui/notifications/) there is an alert notification, I don't use the node, just wondering if it is exposed there.

---

<div class="post-metadata">

**Author:** ![ErnieP](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@ErnieP](https://discourse.nodered.org/u/ErnieP)\
**Post date:** [12 August 2021 16:48 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/6 "2021-08-12T16:48:17Z")

</div>

Hi, thanks for your feedback, I have only been using Node Red for just over a week now so not sure how to go about setting the msg.url as you suggest and what would I set it too?

Ernie

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [13 August 2021 13:42 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/7 "2021-08-13T13:42:24Z")

</div>

Hi Ernie,

I've had another look at this and its possible to do what I think you want using the generic request node rather than the toast, The LGTV has 2 types of notifications toasts which by their nature appear in the top corner and go after 5 seconds or alerts which are more prominant and require user action, they appear in the middle of the screen. There are also a lot more things you can set in an alert like title and labels & actions on the buttons. The full details of the API are here [com.webos.notification | webOS Open Source Edition](https://www.webosose.org/docs/reference/ls2-api/com-webos-notification/)

I've put together a basic flow that demonstrates a peristent alert with a titel and a dismiss button give this a try:

```auto
[{"id":"ac4eab3a772da4ec","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c378ce8e087b2b73","type":"inject","z":"ac4eab3a772da4ec","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ssap://system.notifications/createAlert","payload":"{\"title\":\"Test Message\",\"message\":\"Just Testing\",\"isSysReq\":true,\"buttons\":[{\"label\":\"Dismiss\"}]}","payloadType":"json","x":260,"y":560,"wires":[["2951202b6c79041b"]]},{"id":"2951202b6c79041b","type":"lgtv-request","z":"ac4eab3a772da4ec","tv":"d4a4b73e2368cd49","name":"","x":620,"y":560,"wires":[["248e4f554e6abfa7"]]},{"id":"248e4f554e6abfa7","type":"debug","z":"ac4eab3a772da4ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":560,"wires":[]},{"id":"d4a4b73e2368cd49","type":"lgtv-config","host":"192.168.1.174"}]

```

---

<div class="post-metadata">

**Author:** ![ErnieP](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@ErnieP](https://discourse.nodered.org/u/ErnieP)\
**Post date:** [13 August 2021 16:21 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/8 "2021-08-13T16:21:07Z")

</div>

Hi Sam,

```
That’s fantastic, just what I was after. I would not have known where to start, but now I see what you have done I think I understand it.

Thank you for spend the time to work it out I really appreciate your effort. I am sure it will be useful for several projects. 

Thanks again.

```

Ernie

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 October 2021 16:21 UTC](https://discourse.nodered.org/t/lg-tv-notification-using-node-red-contrib-lgtv/49652/9 "2021-10-12T16:21:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
