Read Kodi status

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

Moderator: leecollings

Post Reply
Toyman
Posts: 23
Joined: Wednesday 31 August 2016 16:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Read Kodi status

Post by Toyman »

Sorry, I couldn't find it in the docs.
Is there a way to get Kodi status in dzVents? I can see functions to send to commends (eg KodiPlay()), but no way to get the status or "attribute"
I'd like to create a simple script like "if Kodi is paused, increase room light level to 100%"
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Read Kodi status

Post by zak45 »

Toyman wrote: Friday 15 September 2017 11:09 Sorry, I couldn't find it in the docs.
Is there a way to get Kodi status in dzVents? I can see functions to send to commends (eg KodiPlay()), but no way to get the status or "attribute"
I'd like to create a simple script like "if Kodi is paused, increase room light level to 100%"
the best for that is :
http://kodi.wiki/view/Add-on:Kodi_Callbacks
TimmermanTim
Posts: 4
Joined: Friday 19 February 2016 9:45
Target OS: Linux
Domoticz version:
Location: Northern Holland
Contact:

Re: Read Kodi status

Post by TimmermanTim »

I'm experimenting with this as well and came up with this test script:

Code: Select all

return {

	active = true, -- set to false to disable this script

	on = {
		devices = {
			-- scripts is executed if the device that was updated matches with one of these triggers
			'Kodi Woonkamer' -- device name
		},
	},
	
	execute = function(domoticz, device)
		
		local lamp = domoticz.devices('Lamp Bank')

		if (device.state == 'Paused') then
		    lamp.switchOff()
		end
	end
}
So, device.state == 'Paused' is what you are looking for.

I am using the default Kodi device in Domoticz. I am not using a Kodi plugin for this.

These are the states if I'm correct:
On When the device is turned on (network connection established) or returns to an idle state.
Off When the device is turned off or network connectivity is lost.
Video When the device starts streaming Live TV, TV Shows or Movies.
Audio When the device starts streaming Music.
Photo When the device starts showing an image.
Paused When the device is streaming media and is paused.
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Read Kodi status

Post by poudenes »

I want same. When you add Kodi server you can see if Kodi is on, play, paused. Would be nice to use those status indicators.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Post Reply

Who is online

Users browsing this forum: Jeakes and 1 guest