Trigun wrote:Hi Jake,
if want more Kodi device to work like this, do I need more of these scripts?
or is there another solution to this?
also, if I select "Hide off level" the switch is still showing the off level, is there a way to only have the three options(Play, Pause, Stop)?
Thanks in advance!
Pfoo, you make it more challenging. I added myself a 'not requested wish' challenge to update the buttons automatically when the Kodi status changes. That worked.
But this is the next level. I usually google the commands together, so I will give you some suggestions for you to start with:
As you can read in my code, things get triggered by the 'devicechanged' command. You will need to tell the script WHICH Kodi device, or WHICH selector switch is updated. I think it will be possible to make it work in 1 script, but that might become complex and not easy to read afterwards anymore. The 'dirty' way of doing is by simply copy-pasting the LUA file, make some logic names in the file name, as long as the word 'device' is in there, meaning that the script will trigger on a devicechanged. In the 2nd LUA file, simply change the variables (kodi device xyz and selector switch xyz) to the new (virtual) hardware.
Regarding your 2nd question about the 'off stage', I don't have any intelligence about that. You can ask that in a more general topic within Domoticz as well, since it is not 1 to 1 Kodi related.