LG TV notification using node-red-contrib-lgtv

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

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

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

Ernie

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

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/ there is an alert notification, I don't use the node, just wondering if it is exposed there.

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

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

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

[{"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"}]

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

1 Like

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