Page 1 of 1

Documentation MediaPlayer

Posted: Sunday 08 March 2020 11:48
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..

Re: Documentation MediaPlayer

Posted: Sunday 08 March 2020 12:58
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)

Re: Documentation MediaPlayer

Posted: Sunday 08 March 2020 14:06
by OedzesG
name deviceType and subType

Light/Switch / Switch

Re: Documentation MediaPlayer

Posted: Sunday 08 March 2020 14:52
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
}

Re: Documentation MediaPlayer

Posted: Sunday 08 March 2020 16:26
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 1310 times

How do i ad some value over there?
plex test.PNG
plex test.PNG (16.83 KiB) Viewed 1310 times

Re: Documentation MediaPlayer

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

Re: Documentation MediaPlayer  [Solved]

Posted: Monday 09 March 2020 0:55
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,
    	}