Dynamic Sitemap?

I’m looking for a kind of dynamic sitemap.

I’ve got 1 computerscreen in my office, and one tablet on the wall in our house, doing most of the time nothing.
And I would like to show some different things on there. Call it a kind of dashboard.
To give an example:

  • Screen 1: Global view of groups/scenario’s (how many lights are on, is the alarm activated…)
  • Screen 2: 4 IP-camera views
  • Screen 3: A few graphs (fe electricity consumption, temperature…)

And let rotate/loop these screen every 5 seconds.
And in case of triggering a sensor, a popup… :stuck_out_tongue:

In the past, I created some static webpages, that refresh each x-time. But would of course like to use OH for this. 1 application for all… :wink:

Any suggestions/ideas?

Look into ‘visibility’

Isn’t that more for items?
Or can you also hide frames/groups?

Try it, frames or anything-you-like with a subsection { }.

I don’t know how clever all browsers are about refreshing in practice, though, when you have say an Item auto-incrementing and changing visibilities.

If you know web development, I believe you could do it in a week or something.
But currently that Hawk Eye feature is not there, as far as I know.

Interesting feature request by the way.

Seemed like an idea with uses, so I had a play

Item for “page” control

Number ScreenPage "control rolling view"

Rule to control “page”

rule "roll screenpage"
when
	System started or
	Time cron "0/15 * * * * ? *"  // every 15 secs
then
	if (ScreenPage.state == NULL) {
		ScreenPage.postUpdate(1)  // initialize
	} else {
		var page = (ScreenPage.state as Number) + 1 // increment
		if (page > 3) page = 1   //max
		ScreenPage.postUpdate(page)
	}
end

Sitemap fragment

	Frame label="Page One" visibility=[ScreenPage==1] {
			Text item=Blah
			Text item=Bleh valuecolor=[>2="red"]
	}
	Frame label="Page Two" visibility=[ScreenPage==2] {
			Text item=motionX valuecolor=[OPEN="red"]
			Text item=motionY
	}
	Frame label="Page Three" visibility=[ScreenPage==3] {
			Switch item=test_motion mappings=[ON="Detect"] visibility=[motion_U1gate!=ON]
			Switch item=test_motion mappings=[ON="Motion!"] visibility=[motion_U1gate==ON]
			Text item=prowler
			Text item=aggregate
			Text item=Offsite valuecolor=[>2="red"]
	}

Seems to work well in Win/Chrome browser, ClassicUI. Even with different number of lines in “pages”.
Untested with varying image insert sizes.

5 Likes

Nice, your code seems to work perfect. :+1:
Now I can starting to building some interesting screens/frames.

ps you don’t know if this could work for the HABPanel? I never worked with that (time issue). But I’ve seen some nice build-ups. You can put more things next to each-other (fe videosurveillance). Would be nicer to put more data on 1 screen…

Not sure if this is possible, but a nice extra feature would be that after a certain timeout (fe 30 secs no use), the screenpages start automatically.

This way, it’s a kind of screensaver for your device. :wink:

HabPanel has a setting where you specify an item. When the item changes, the dashboard will change.

from the docs:

When this item changes to a dashboard’s name, switch to it This allows controlling the currently displayed dashboard by an openHAB item (useful with rules and as a side-effect to commands)

Possible to an extent I think for sitemap based display. Maybe create another Switch Item to indicate “pageroll blocked”. Use expire binding for the timeout, update to OFF on expiry.
Put all controls on your sitemap - switches, sliders etc. - in some master Group.
Have a rule trigger on any command to a Group member. That’s the active user detection. This rule sends ON to the blocker Item.
The page-roller rule would be modified to do nothing if blocker is ON.

I do not think there is a way of feeding back to OH that a user is opening/closing subpages though, so that’s undetectable activity.
In practice though, if they’re looking at a subpage they are not looking at the page with the rolling frame, so dpepending on your layout it might all work out okay.