Best way to design & distribute?

Hey All,

What is the best way to design and distribute HABPanel from a PC to Android / iOS devices?

Ideally I am looking at keeping a central collection of layouts which can then be copied down to the required devices, I am using OH 1.8.

Using Chrome in developer mode, then selecting device mode enable me to setup a browser to emulate the screen which is great, but then how best to push / copy to a mobile device?


You dont have to “push” it to a device. Just create panel with all needed dashboards on your PC and use the central storage instead of the local one. Then on your device select the central storage as well and select the right panel. Every time you make changes to that panel on your PC again, refreshing on the device is enough to pick up the changes.
here a screenshot what I mean with selecting the different storages in case you havn’t found it:

1 Like

Sadly I am not running OH2 so local storage is my only option.

The advanced option for local panel edit could work, what would be the best way to remote control Android devices so that I can copy / paste the new panel configuration?

In this case I believe cut&paste is your best option

There’s no easy solution for 1.8, but the newer versions have an import/export feature from a file (slightly better than copy-pasting) under the “Edit the local panel configuration” link.

1 Like

The copy / paste is workable for me, just need to find a reliable method to remote control the Android units.

Maybe VNC or possibly TeamViewer.

I’m wondering if we can have a third type of storage, that is just sourcing the JSON Data from a URL.

So http://my-central-storage/dashboards/livingroom.json could contain the same data I would paste into the import field of the local storage.

Of course, the URI must be saved in the local storage.
EDIT: passing this as GET parameter would work out as well:
http://openhab:8080/static/habpanel/web/?config=http://my-central-storage/dashboards/livingroom.json (probably needs urlencoding though)

It can be polled regularily and reload on changes.

Not exacly on the same subject but :

Openhab2 release an update last week if i’m right…

Could I make it or I will lose my habpanel setup ?

That would be a great idea, gets my vote :slight_smile:

You won’t lose your setup, if you don’t remove it in OpenHAB2. Please post a different subject for this.

Did anything come of this? It would be really nice to remotely load configs.

To follow up on this I’m using the following command to reinitialise panel configs after reinstalling:

# u0027 is a: " ' " character

panelsRegistry=$(jq --compact-output . /etc/openhab2/other-configs/habpanel-config.json | sed "s/'/\\\\u0027/g" )

openhab-cli console -b -u openhab -p habopen << _EOF_
config:property-set -p org.openhab.habpanel lockEditing false
config:property-set -p org.openhab.habpanel initialPanelConfig F17
config:property-set -p org.openhab.habpanel panelsRegistry '${panelsRegistry}'

which is called from here:

Can you Please elaborate it.

I lost my happanel after attempting to edit in the json file available in paperui advanconfiguration for habpanel…
any ways to restore?
i spent days design it so your response will be valued a lot
Ps- i have the json file .

the jq command squishes the json panel config into a single line (needed for feeding into the openhab-cli command. The sed substitutes any ' characters (that would interfere with the shell) with the equivalent UTF8 character code.

You might want to check that you are setting your Panel config in the config:property-set -p org.openhab.habpanel initialPanelConfig F17 line. Mine is called F17 but your’s might be different.

Good luck!

Thanx @imaginator !

Your way worked out!

@Likan_Pasupalak just to update you, I ran into problems with shell escaping. For example the apostrophe in “Who’s at home” (network binding) would cause issues. I’ve now switched to the following setup script: