Kodi Community Forum
Show periodically updated variable on home screen. - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Show periodically updated variable on home screen. (/showthread.php?tid=301454)



Show periodically updated variable on home screen. - aars - 2016-12-19

Hi all,

I've been trying to display the currently playing song of my MPD daemon on my home screen. I'm not new to programming, but I am new to Kodi and it's internals.

I was hoping it would be as easy as declaring a variable that is available to the skin/interface elements/xml, and updating that variable using external scripts (i've got some python scripts that output the exact string I need in a variable). I've ended up thinking I need a add-on or service to periodically run the external scripts and update the variable, but I'm getting nowhere.

All help is appreciated.

PS: I'm not looking for a plugin or add-on or service that already does this for me, or a MPD client or whatever. My main goal posting here is to understand what I need to do, not find something that already does this.

Thanks!


RE: Show periodically updated variable on home screen. - _Andy_ - 2016-12-20

Yes, you need a python service which updates the skin variables you need. If you like look at my very basic service which updates some variables of a hardware monitor.
https://github.com/Snecx/service.skinhelper.IP
You can get the variables in the screen with a info var. Something like this $INFO[Window(Home).Property(SkinHelperIP.wanip)
This should help you.


RE: Show periodically updated variable on home screen. - aars - 2016-12-22

@_Andy_ That does help! Thanks!


RE: Show periodically updated variable on home screen. - pcextreme - 2022-07-06

Hi _Andy_ !

Could You adopt this service to run on Python 3 ( Matrix and newer ) ?
I tried with python2to3 but there are errors starting after conversion.

I am trying to display some temperatures on my home screen on Kodi 19.4 from windows using Open Hardware Monitor with the skin mimic.lr ...

Kind regards : Zoltan.