openhab / org.openhab.ui.habpanel

OUTDATED repo - HABPanel has moved to the openhab-webui repo!
https://github.com/openhab/openhab-webui
Eclipse Public License 1.0
97 stars 93 forks source link

Ability to fetch sitemaps as dashboards dynamically #25

Closed kubawolanin closed 7 years ago

kubawolanin commented 7 years ago

It would be great to be able to construct the sitemaps as in Project Rotini and then have HABpanel recognize them as valid dashboards.

Obviously, that would require following strict semantics of the widget, like:

Frame label="TV {widget:button,icon:tv}" {
  Switch item=TV mappings=[
    ON="Turn on"
  ]
}

What do you think? 😄 I've seen @kaikreuzer comment somewhere that openHAB is leaning towards flow without need of creating sitemaps (or maybe I'm wrong), so I don't know if it'd be applicable in the future.

ghys commented 7 years ago

Having HABPanel using "new-gen" sitemaps as dashboards has been discussed as the project was just starting, there's been an interesting discussion then.

The gap is frankly not that huge, though it would need (and I'm thinking out loud here):

  1. HABPanel supporting multiple levels of dashboards: probably implemented as a widget being able to link to - and define - a "sub-dashboard"
  2. a way in openHAB's sitemaps to define arbitrary key-values specific for the target UI at each level, for each widget in the sitemap (a little bit like vendor-specific CSS properties e.g. -webkit-whatever) and with the ability of being posted back to the server - link to ESH
  3. a clever way to persist the sitemaps on disk, in the configuration, with their additional properties... maybe vanilla JSON?

More discussion here

kubawolanin commented 7 years ago

Hey @ghys,

Ad. 1, Rotini resolves this issue by introducing "pages" to the sitemaps. It simply takes Text widget as a group. Not sure if it's the best possible option, but it works! 😄

Ad. 3. That'd be awesome! Vanilla JSON would be great. I imagine initial HABpanel instance with example dashboards ready for you to just point the right openHAB items - and you're ready to go.

Cheers, K

ghys commented 7 years ago

31 implements the ability to read openHAB's sitemaps.

It's not ready to be merged yet though.

ghys commented 7 years ago

This feature is abandoned as discussed in #31.