Sitemap configuration for Kodi

I have created a basic sitemap that shows me what’s playing on both my Sonos speakers and Kodi machines. Using the visibility tag to only show where something is playing.

Here’s what I have for Sonos, this works perfectly.

		Frame label="Kitchen" visibility=[Kitchen_Sonos_Status==PLAYING] {
			Text item=Kitchen_CurrentTrack
		}

However with Kodi there are more items to display and this is where I need a little help.

		Frame label="Kitchen" visibility=[Kitchen_control=="PLAY"] {
			Text item=Kitchen_showtitle visibility=[Kitchen_showtitle!=null]
			Text item=Kitchen_title 
			Switch item=Kitchen_mute 
		}

When watching a TV Show Kitchen_showtitle is displayed, but this is not the case when watching a Move. Only Kitchen_title is used for a Movie. I thought the above would work, however that’s not the case. I’ve also tried !="".

Any suggestions?

A Movie does not have a showtitle and therefor will be empty.

see: https://www.openhab.org/addons/bindings/kodi/

That’s my point, my sitemap does not work in the way it should do. My visibility tag is looking to see if Kitchen_showtitle is not null. So clearly something isn’t right.

NULL not null. Also, make sure that the Item truly is set to NULL. The more correct state would be UNDEF. NULL means uninitialized and UNDEF means undefined. NULL means the Item has never received a state since OH started up. UNDEF means it had a state at some point but we don’t know what state it is in right now.

2 Likes

UNDEF worked, thanks for the pointer. I would never have thought of using that.