Notifications should be separate items and be member of a group you set in <Notifications Group Name>.
Style the notification with Bootstrap3 button classes by adding one of these classes to your item’s tags: “btn-default”, “btn-primary”, “btn-success”, “btn-info”, “btn-warning”, “btn-danger”.
Give the buttons an additional glowing animation by adding “glow” to the item’s tags in addition to the btn-color-classes.
See examples/notifications.items for a working example.
In the settings of the widget, you can choose a command to be sent, when you click or tap the notification. This can be used to fire rules that listen to received command OFF commands.
For example, you could stop a flood alarm, turn off your whole-house-audio system, reset energy meters or anything else that may need context-sensitive interaction.
I replaced the header of my dashboard, but now the button to edit the dashboard is gone, also the clock and the three small buttons on the upper right side.
Can you tell me, how i can use your dashboard and still be able to edit the dashboard?
My dashboard name is “home” and when i see the dashboard, i simply click to the name “home” in the upper left and i get a pencil, so i can edit widgets and add new ones. But now when i click on “home” no pencil anymore.
Great! Thank you for your work!
A little suggestion: For greater flexibility, I think it would be nice to change the items label on demand, as discussed here.
Because we replaced the header, the old functionality of the header is missing. To still edit, I use one of these ways:
Go to the main page index.html (where the list of all your dashboards is), click on the gear icon to enter edit mode, then click on your dashboard. You will enter the dashboard and still be in edit mode
or
In the URL of your dashboard, replace /view with /edit
(edit: oops, too late, already answered)
If you want to have those buttons, you have to put that code into the custom widget.
@ysc would it make sense to have an angular “variable” that resolves to the same html like the buttons and time (basically everthing that has the pull-right class in the original header) ?
The same would be interesting for the edit button. I tried to fire the command to toggle edit mode, but I could not find the right ng scope for this.
If anyone is interested in putting this into the custom widget, please contribute back to the github repo so we can all use it
Ok. That doesn’t work, because the label of an item seems to be cached by the browser while loading the HABpanel site. So the notification is always the item label from that time, no matter if you change it in-between or not.
Yes it makes sense to move this “toolbar” in a directive, so it could be reused in your custom template (i.e. you would have to add something like that in your widget:
Thanks @gersilex for the nice widget.
I imported this to my habpanel yesterday and I am trying to play with it a little bit.
Currently in my house I have temperature sensors in different rooms and what I am trying to do is to show a notification (with label and current temperature value) if the temperature is higher than a certain value.
I have succeeded in the first part (showing notification) but couldn’t be able to show the value.
Note: I tested this on the high temperature (above 27)
my items file:
Group:Switch:OR(ON, OFF) notifications "Notification group"
String notification_temperature_high "🌡️ Temperature is high [%s]" (notifications) ["glow", "btn-warning"]
Switch notification_temperature_low "🌡️ Temperature is low" (notifications) ["glow", "btn-info"]
my rule file:
rule "temp notification"
when
Item test_room_temp changed
then
if (test_room_temp.state > BR2AC_HIGH_TEMP.state)
{
notification_temperature_high.postUpdate(test_room_temp.state)
notification_temperature_low.postUpdate(OFF)
}
else if (test_room_temp.state < BR2AC_LOW_TEMP.state)
{
notification_temperature_low.postUpdate(ON)
notification_temperature_high.postUpdate(OFF)
}
else
{
notification_temperature_high.postUpdate(OFF)
notification_temperature_low.postUpdate(OFF)
}
end