Documentation MediaPlayer  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Documentation MediaPlayer

Post by OedzesG »

Goodmorning all..

Is there some documentation for MediaPlayer avalible?

tryd:

.updateText
.setText
.setStatus

but nothing seems to work...

i would like to set the status and text..

thnx in advance..
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Documentation MediaPlayer

Post by waaren »

OedzesG wrote: Sunday 08 March 2020 11:48 Is there some documentation for MediaPlayer available ? I would like to set the status and text..
What is the Hardware, name, deviceType and subType in domoticz ? (look at the devices tab from the GUI)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Documentation MediaPlayer

Post by OedzesG »

name deviceType and subType

Light/Switch / Switch
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Documentation MediaPlayer

Post by waaren »

OedzesG wrote: Sunday 08 March 2020 14:06 Switch
You can use the switchOn / switchOff and update methods (see below)

Code: Select all

return 
{
	on = 
	{
		devices = 
		{
            'media player',
		},
	},
	
	logging = 
	{
	    level = domoticz.LOG_DEBUG,
	    marker = mediaplayer,
	},
	
	execute = function(dz, item)
		item.switchOn().silent()
		item.update(item.nValue,'songtext : ' .. dz.time.rawTime).silent()
	end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Documentation MediaPlayer

Post by OedzesG »

update methods (see below)
thx waaren,

text is working..

but for example kodi show Video when a movie is playing...
kodi test.PNG
kodi test.PNG (17.18 KiB) Viewed 1304 times

How do i ad some value over there?
plex test.PNG
plex test.PNG (16.83 KiB) Viewed 1304 times
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Documentation MediaPlayer

Post by OedzesG »

Find it out!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Documentation MediaPlayer  [Solved]

Post by waaren »

OedzesG wrote: Sunday 08 March 2020 23:04Find it out!

Code: Select all

        local mediaPlayerStates =
    	{ 	
    		Off = 0,
    		On = 1,
    		Paused = 2,
    		Stopped = 3,
    		Video = 4,
    		Audio = 5,
    		Photo = 6,
    		Playing = 7,
    		Disconnected = 8, 
    		Sleeping = 9, 
    		Unknown = 10,
    	} 
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest