HPEx - HabPanel Extension

The items are created using the REST API. If you want them to be truly persistent, go to REST API, and delete those item configs, and just add them through an .items file. Make sure the config is a JSON.stringified string

@luckymallari I have a couple of feature suggestions

  1. Could the screensaver go on after x seconds in combination with another switch? I have a fixed panel for mornings and another for kids chores in the afternoon but would like to Rotate through panels in times other than this. Having a switch item in the config, I could then turn this in and off with cron rules
  2. Could you prioritise theatre mode? Looks like if screensaver is running theatre mode doesn’t kick in
  3. Any way to return from screensaver to a specific panel?

Love your work

Been busy. Will work on this soon

Question, I keep losing the settings for HPEx on my raspberri pi. I do not fully understand how the panel settings sync to the server. Would anyone have details on how/when does the settings get sync-ed to the server?

Been running mine for over a year now; here’s how I got it setup on 3 different panels. Two are vertical and one is horizontally mounted.

Items:

	// Vertical Tablets
	Switch	Bedroom_Mode_Switch				"Upstairs Bedroom Mode [MAP(screen_dark_bright.map):%s]"			(HomeState, Group_HabPanel_Dashboard)		[ "Switchable" ]
	String	habpanelEx_Bedroom_V			"[%s]"																(HomeState, Group_HabPanel_Dashboard)

	Switch	Theater_Mode_Switch				"Basement Theater Mode [MAP(screen_dark_bright.map):%s]"			(HomeState, Group_HabPanel_Dashboard)		[ "Switchable" ]
	String	habpanelEx_Basement_V			"[%s]"																(HomeState, Group_HabPanel_Dashboard)

	// Horizontal Tablet
	Switch	LivingRoom_Mode_Switch			"Livingroom Mode [MAP(screen_dark_bright.map):%s]"					(HomeState, Group_HabPanel_Dashboard)		[ "Switchable" ]
	String	habpanelEx_Livingroom_H			"[%s]"																(HomeState, Group_HabPanel_Dashboard)

Rules:

In Startup

	// Setting Screen Saver Item Values 

	habpanelExConfig.postUpdate('{"config_item":"habpanelExConfig","initComplete":true,"isShowInDrawer":true,"screensaver":{"isEnabled":false,"timeoutSeconds":300,"dashboardList":"","durationSeconds":300,"isFullScreen":true},"theaterMode":{"isEnabled":true,"isOn":false,"color":"rgba(0,0,0,0.90)","triggeringItem":null},"panelConfigItem":"habpanelExConfig"}') 
	habpanelEx_Bedroom_V.postUpdate('{"config_item":"habpanelExConfig","initComplete":true,"isShowInDrawer":true,"screensaver":{"isEnabled":true,"timeoutSeconds":300,"dashboardList":"Basement-Vertical,Garage-Vertical,MainFloor-Vertical,Cameras-Vertical,Covid19-Vertical","durationSeconds":120,"isFullScreen":true},"theaterMode":{"isEnabled":true,"isOn":false,"color":"rgba(0,0,0,0.90)","triggeringItem":"Bedroom_Mode_Switch"},"panelConfigItem":"habpanelEx_Bedroom_V"}')		
	habpanelEx_Basement_V.postUpdate('{"config_item":"habpanelExConfig","initComplete":true,"isShowInDrawer":true,"screensaver":{"isEnabled":true,"timeoutSeconds":310,"dashboardList":"Basement-Vertical,Garage-Vertical,MainFloor-Vertical,Cameras-Vertical,Covid19-Vertical","durationSeconds":130,"isFullScreen":true},"theaterMode":{"isEnabled":true,"isOn":false,"color":"rgba(0,0,0,0.90)","triggeringItem":"Theater_Mode_Switch"},"panelConfigItem":"habpanelEx_Basement_V"}')		
	habpanelEx_Livingroom_H.postUpdate('{"config_item":"habpanelExConfig","initComplete":true,"isShowInDrawer":true,"screensaver":{"isEnabled":true,"timeoutSeconds":320,"dashboardList":"Our House,Cameras,Up Stairs,Basement,Loft,Garage,RainViewer,Stocks,Covid19","durationSeconds":140,"isFullScreen":true},"theaterMode":{"isEnabled":true,"isOn":false,"color":"rgba(0,0,0,0.90)","triggeringItem":"LivingRoom_Mode_Switch"},"panelConfigItem":"habpanelEx_Livingroom_H"}')

In Events:

			// Turn Tablet Bright in Basement
			Theater_Mode_Switch.postUpdate(OFF)
				Thread::sleep(1500)  
			Theater_Mode_Switch.postUpdate(OFF)


			// Turn Tablet Dim in Basement
			Theater_Mode_Switch.postUpdate(ON)
				Thread::sleep(1500)  
			Theater_Mode_Switch.postUpdate(ON)

The OH server really has nothing to do with the HabPanelEx plug-in. It’s strictly at the client side that is driven by item values. You have to go to the tablet (client) and configure HabPanelEx which it will get cached in the browser settings after you set it up.

Best, Jay

1 Like

Wow nice did not think you could push these from the server - that is exactly what I was looking for
 I’m not familiar with startup where do you write these rules?

You have to create a rule that is triggered by the event ‘System started’ This is done in a .rules file. OH has lot to offer and it can get complex and overwhelming very quickly. If you are new to OH I would suggest you take some time to read through the tutorials and examples. There is a ton of good info there and you can learn a lot by following and building off others example.

rule "Onstartup"
when
    System started
then  
...
    
end

I’ve written bunch of rules but did not come across the “system started” event. And there is something else you might be able to confirm with the habpanelExConfig:

  • most elements in the panel seem to be persisted on the server but I guess this specific one is only cached on the client (and loaded from server habpanelExConfig string item)?
  • could I just persist that value to the database instead of having it in “system started” rule to make sure it doesn’t get reset after rebooting my server?

Thanks

Erik

I don’t think persistence alone will work, although I haven’t explicitly tested it. In my setup I do have it persisted, but I don’t think my iPads retain their settings through a restart without the startup event initialization. However it has been some time, over a year ago, since I implemented my setup. It is certainly something you could try and report back if it works. BTW I wasn’t trying to insult you or belittle your expertise. It’s just that Tutorials and Examples is an often overlooked resource, even by experienced users. If I offended you I apologize.

1 Like

Correct. If you clear the cache in the browser on the client, you’ll have to reload it manually at the client again within HabPanelEx panel config.

Best, Jay

no offence taken at all, I really appreciate all the help and feedback here and there is always more to learn from tutorials and examples :slight_smile:

Anyway, going to try setting up a persistence on this value and see if that works - this could be an option with almost no code.

Ok so no luck with persistence - haven’t checked the sqlite db content but the group was supposed to be persisted. Also another thing I figured out is that I need to have the browser open on the habpanelex to enable the screen saver. If my initial URL is any of the other panels then the screen saver never kicks in.

Hi together,
I just found this extension for HabPanel and tried to install it. Unfortunately I only get a blank widget without showing any of the configuration possibilities.

Does anybody know if HabPanelEx works also with openHAB 3.0 or might this be the issue?

1 Like

I’m having the same issue (OH3.1)

Followed the instructions. Just getting a blank panel.

1 Like