Page 1 of 1
Read Kodi status
Posted: Friday 15 September 2017 11:09
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%"
Re: Read Kodi status
Posted: Friday 15 September 2017 13:07
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
Re: Read Kodi status
Posted: Monday 25 September 2017 10:07
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.
Re: Read Kodi status
Posted: Tuesday 03 October 2017 16:31
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.