Use TVOverlay to show Domoticz notifications on your Android TV

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Post Reply
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Use TVOverlay to show Domoticz notifications on your Android TV

Post by waltervl »

I came across the app TVOverlay that can show notifications including pictures on a Google or Android TV or google TV mediaplayer, see page https://github.com/gugutab/TvOverlay and this video https://www.youtube.com/watch?v=mdsY084-pr8

As it has a Rest API and MQTT interface it can also show notifications coming from Domoticz!
I did the option with a dzvents script using the Rest API to send a notification including a screenshot of my Domoticz Camera when I have motion on my driveway. You probably also can do this with MQTT but I did not investigate this as I do not use MQTT....

So the procedure is:
1 Install and setup TvOverlay on your AndroidTv, Chromecast or Andoid TV mediaplayer via PlayStore, see https://github.com/gugutab/TvOverlay?ta ... how-to-use
2. Make note of the IP of the TV as you need it in the dzvents OpenURL.
3. Make note of the camera IDX you want a screenshot off to be shown in the notification on your TV
4. Copy below code snippet in a dzvents script session. This example is triggered on my your motion sensor. Change the camera IDX, TV-IP and Domoticz IP and Port to your needs.

Have fun!

Code: Select all

return {
    on = {
        devices = {
            443 -- Motion driveway sensor
        }
    },
	logging = {
		level = domoticz.LOG_INFO, -- Can be domoticz.LOG_INFO, domoticz.LOG_MODULE_EXEC_INFO, domoticz.LOG_DEBUG or domoticz.LOG_ERROR
		marker = 'TVOverlay',
	},
    execute = function(domoticz, device)
       if device.state == 'On'  then
           domoticz.openURL({
                url = 'http://TV-IP:5001/notify',
                method = 'POST',
                callback = 'TVOverlayNotify',
                postData = {
                    title = 'Motion on Driveway',
                    image = 'http://Domoticz-IP:PORT/camsnapshot.jpg?idx=1',
                    duration = '20'
                }
            })
       end
     end
}
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest