Suggestion Dummy Widget

Is it possible to get an change to the Dummy widget to configure it to navigate to an url or dashboard if you press it.
Usage:
I have an Dummy that shows Outdoor Temperature and i want to se an dashboard with an graph of the Temperature when i press it.

/Mike

Maybe I did not understand your intention. You can get this:

when using this code (almost complete)

I used a setpoint item to chose the duration of chart. This causes additional configuration, but is a nice feature :wink:

Sitemaps/*.sitemap:

Text item=WeatherMinMax {
	Setpoint item=Chart_Period step=1 minValue=1 maxValue=12 
	Chart item=Weather_Chart period=h refresh=10000 visibility=[Chart_Period==1]
	Chart item=Weather_Chart period=4h refresh=10000 visibility=[Chart_Period==2]
	Chart item=Weather_Chart period=8h refresh=10000 visibility=[Chart_Period==3]
	Chart item=Weather_Chart period=12h refresh=10000 visibility=[Chart_Period==4]
	Chart item=Weather_Chart period=D refresh=10000 visibility=[Chart_Period==5]
	Chart item=Weather_Chart period=3D refresh=10000 visibility=[Chart_Period==6]
	Chart item=Weather_Chart period=W refresh=10000 visibility=[Chart_Period==7]
	Chart item=Weather_Chart period=2W refresh=10000 visibility=[Chart_Period==8]
	Chart item=Weather_Chart period=M refresh=10000 visibility=[Chart_Period==9]
	Chart item=Weather_Chart period=2M refresh=10000 visibility=[Chart_Period==10]
	Chart item=Weather_Chart period=4M refresh=10000 visibility=[Chart_Period==11]
	Chart item=Weather_Chart period=Y refresh=10000 visibility=[Chart_Period==12]
}

Items/*.items:

Group Weather_Chart (Weather)
Number	Chart_Period	"Zeitraum [MAP(period.map):%s]"
Number	Weather_Temp_Max	"Maximum heute [%.1f °C]"	<temperature>	(Weather_Chart)	
Number	Weather_Temp_Min	"Minimum heute [%.1f °C]"	<temperature>	(Weather_Chart)	
String	WeatherMinMax	"Min-Akt-Max: [%s]"	<temperature>
Number	Current_Temp	"WUnderground Außentemp. [%.1f °C]"	<temperature>	(Weather_Chart)		{ weather="locationId=home, type=temperature, property=current, scale=1", knx="15/7/0" }

Transform/period.map:

1=1 Stunde
2=4 Stunden
3=8 Stunden
4=12 Stunden
5=24 Stunden
6=3 Tage
7=7 Tage
8=2 Wochen
9=1 Monat
10=2 Monate
11=4 Monate
12=1 Jahr

Rules/*.rules:

rule "Update max and min temperatures"
when
	Item Current_Temp changed or
	Time cron "0 0 0 * * ?"
then
	Weather_Temp_Max.postUpdate(Current_Temp.maximumSince(now.withTimeAtStartOfDay).state)
	Weather_Temp_Min.postUpdate(Current_Temp.minimumSince(now.withTimeAtStartOfDay).state)
	if(Current_Temp.state instanceof DecimalType && Weather_Temp_Max.state instanceof DecimalType && Weather_Temp_Min.state instanceof DecimalType)
		WeatherMinMax.postUpdate(Weather_Temp_Min.state.format("%.1f")+" °C / "+Current_Temp.state.format("%.1f")+" °C / "+Weather_Temp_Max.state.format("%.1f")+" °C")
end

Persistence/rrd4j.persist:

/ persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
	// for rrd, we need a cron strategy
	everyMinute : "0 * * * * ?"
}

Items {
	// let's only store temperature values in rrd
	Temperature*,Weather_Chart* : strategy = everyMinute
	Chart_Period : strategy = everyMinute, everyChange, restoreOnStartup
}

Hello @Udo_Hartmann

If I’m not mistaken, he’s talking about HABPanel, and not Classic/Basic UI/HABDroid.

Best regards,
Davor

Yes you are correct @davorf i was asking for a function in the Dummy Widget in HABPanel to do what @Udo_Hartmann described how you do in Classic UI.

/Mike

I’m still quite new to HabPanel. But if your asking for a Widget to navigate to another Dashboard, that is already possible.

The Button Widget is capable of navigating to another dashboard, or use the template widget to create your button or link as well.

What i am asking for is an widget that can show an value from an item and if i press that widget it redirects to another dashboard.
The button Widget can not show an value from an item.

/mike

Ah, sorry, did not take attention to the labels…

It’s not possible right now but you can easily make one, for example:

<a style="position:absolute; top:0; left:0; width:100%; height:100%"
   href="#/view/{{config.dashboard}}"
   ng-init="model={ item: config.item, font_size: 20, unit: config.unit, iconset: config.icon_iconset, icon: config.icon }">
  
<!-- ^^ add attributes with other config settings as needed - check
		 https://github.com/openhab/org.openhab.ui.habpanel/blob/master/web/app/widgets/dummy/dummy.widget.js#L76
     for a list of all possible dummy widget model attributes -->
  
  <widget-dummy ng-model="model"></widget-dummy>
  
</a>

Config settings to add:

  • dashboard type String (or possibly Choices on a recent snapshot with a prefilled list)
  • item type Item
  • unit type String
  • icon type Icon (only available on recent snapshots)
  • etc.

jack-panel-changer.widget.json (2.2 KB)

Haven’t had time to complete it… and would appreciate some help on dusting it off a bit,
but does this help?

I use this on most of my panels to allow me to move between them.

Thanks @ysc

I get your base to work, but i get in to trouble when i try to add name and backdrop.
It does not display the name and the backdrop.

<a style="position:absolute; top:0; left:0; width:100%; height:100%"
   href="#/view/{{config.dashboard}}"
   ng-init="model={ name: config.name, item: config.item, font_size: 20, unit: config.unit, iconset: config.icon_iconset, icon: config.icon, backdrop_iconset: config.backdrop_iconset, backdrop_icon: config.backdrop_icon }">
  
<!-- ^^ add attributes with other config settings as needed - check
		 https://github.com/openhab/org.openhab.ui.habpanel/blob/master/web/app/widgets/dummy/dummy.widget.js#L76
     for a list of all possible dummy widget model attributes -->
  
  <widget-dummy ng-model="model"></widget-dummy>
  
</a>

I have also attached the widget where it does nor work.

/Mike

Name should work - did you add the setting?

Also I just realized the info text when creating a setting of type Icon was wrong; instead of:

“This will define 2 config elements, config.backdrop_iconset and config.backdrop_icon”

it should read:

“This will define 2 config elements, config.backdrop_iconset and config.backdrop”

Sorry, just fixed it.

Now I have the backdrop working :smile:

Name is still not working.
If i use

name: config.name

it does not work, but if i create a new setting title and use

name: config.title

it works.

/Mike

1 Like