Best way to design & distribute?

ios
android
habpanel
Tags: #<Tag:0x00007f15daf0a810> #<Tag:0x00007f15daf0a6a8> #<Tag:0x00007f15daf0a428>

(Wez) #1

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?

Thanks


(ingo_e_sigmund) #2

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:


Tutorial: Saving habpanel configurations, possible backup uses
(Wez) #3

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?


(ingo_e_sigmund) #4

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


(Yannick Schaus) #5

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.


(Wez) #6

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.


(SiLeX) #7

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.


Restore Habpanel settings from files
(Dominic Bonneau) #8

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 ?


(Wez) #9

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


(SiLeX) #10

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


(Simon Tennant) #11

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


(Simon Tennant) #12

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

#!/bin/bash
# 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}'
_EOF_

which is called from here: https://github.com/imaginator/system/blob/master/salt/openhab/init.sls#L142-L150


(Likan Pasupalak) #13

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 .


(Simon Tennant) #14

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!


(Likan Pasupalak) #15

Thanx @imaginator !

Your way worked out!