OHpanel 0.17.0: twelve shortcuts, notifications that wake the screen only when it matters
A new release of OHpanel, the openHAB firmware for the Sonoff NSPanel, is out: v0.17.0. It comes with a new display design, so after the firmware update (Settings > Firmware > Check for updates) the panel offers the design too; install both.
Thanks for the feedback on the home screen mock-ups, and for the ideas from the last posts: most of this release came straight from them.
New
Twelve shortcuts on home, three rows of four (seven before), as several of you suggested. On the NSPanel EU and the US on its side, the clock and date moved up a little to make room; on the US upright, the weather block.
Departure times with AM/PM. The right field of the info lines now holds 8 characters, so 12:41 PM fits; the main text is a little narrower for it.
Notifications that wake the screen only when it matters. Under Display > Notifications, Wakes the screen picks the least level that wakes it: every notification, warnings and alerts, alerts only, or never. One that wakes the screen keeps it on until its card is closed; one below waits quietly and shows at your next touch.
“On when” with a limit. A status icon or shortcut can count as on while a number is beyond a limit, e.g. "on": {"above": 7}: a battery icon only while more than 7 W flow.
Changed
Notifications no longer wake the screen by default. To have alerts wake it (and keep it on), set Wakes the screen to “alerts only” ("wake_and_keep_on": "alert").
Shortcuts are numbered as read: the first four are the top row. Existing shortcuts therefore move up a row; drag them in the web interface’s preview to put them back where you want them.
“On when” only shows in the web interface where it does something (an icon shown while its item is on, or a shortcut that opens its page only then). To change an icon’s look by its value, use the rules below it.
On the NSPanel US upright, the value rows end before the shortcuts: a number with its unit up to 4 digits (1013 hPa, -12,5 °C) shows whole.
Fixed
The web interface’s preview drew the info lines a little too small, so they looked top-aligned where the panel centres them.
Feedback, bug reports and ideas are welcome, here or on GitHub.
info, warning or alert means that level and higher. A notification at or above it wakes the screen and keeps it on, at its normal brightness, until the card is closed, by a touch or by the item being emptied. One below wakes nothing: its card shows when you next touch the screen, and that touch doesn’t close it.
One change to be aware of: the default is now never, so a notification no longer wakes the screen unless you set this. The old short wake-up suited nobody, so I dropped it.
You weren’t doing much wrong, the rule just didn’t match your item. A rule “Equals OFF” compares the item’s raw state with the text OFF. Your item is a number (-8 W), so its state is never OFF, the rule never matches, and the icon keeps its own colour.
“On when” only decides whether an icon shows (with “Shown: while the item is on”), not its colour. With “Shown: always” it did nothing, which was confusing, so from 0.17.0 the web interface only offers it where it has an effect.
For your icon, use a numeric rule: If the state: at most 0 → colour grey. It’s yellow while the battery powers the house and grey otherwise:
If you’d rather have the icon appear only while the battery delivers more than a little (and not flicker around 0), 0.17.0 also lets “On when” use a limit: On when: a number beyond a limit → above 7, with “Shown: while the item is on”. In the configuration that’s "on": {"above": 7}.
0.17.0 has the new home screen with 12 shortcuts (4 / 4 / 4), as you and fregger65 suggested, with the clock and date a little higher. Note that shortcuts are now numbered as read, so existing ones move up a row; drag them in the web interface’s preview to put them back.
The WiFi symbol top right only shows when the panel has no WiFi connection (red, crossed out). Seeing nothing there means all is well.
Thanks, that makes perfect sense I was however reading it incorrectly as the helper text was showing Now -8 W counts as off I had, incorrectly assumed I should be looking of ‘off’, but logically and (now obviously!) it should be the value.
Also many thanks for the additional information:
This is perfect for my use case.
Have installed 0.17.0 and initial testing is that everything is good! Cannot thank you enough for your speed of development on the ideas from others, it is very much appreciated. Will continue testing and let you know of I find anything that’s not working (although I doubt I will !)
Hi Jonas, now have 2 panels running your software!
I’d like to have a page that shows which lights are on this house so I can switch them off if necessary.
edit: I managed to find a way to manage a dynamic group that now displays which lights are on. This works with the entity page. The code is below. However of course I didnt realise that the entity page seems to be read only. I guess ideally we would need a page which has buttons which can be dynamically built using a group. Might be too complicated!
console.info("--- Active Lights Rule Triggered ---");
console.info("Triggering Item Name: " + event.itemName);
var itemName = event.itemName;
var item = items.getItem(itemName);
var activeGroup = items.getItem('gActiveLights');
var currentState = item.state;
var isOn = currentState == 'ON' || (currentState !== null && parseFloat(currentState) > 0);
console.info("Is light considered ON? " + isOn);
// Get ItemRegistry via OSGi FrameworkUtil
var FrameworkUtil = Java.type('org.osgi.framework.FrameworkUtil');
var bundleContext = FrameworkUtil.getBundle(item.rawItem.getClass()).getBundleContext();
var registryRef = bundleContext.getServiceReference('org.openhab.core.items.ItemRegistry');
var registry = bundleContext.getService(registryRef);
var groupItem = registry.getItem('gActiveLights');
var isMember = groupItem.getMembers().contains(item.rawItem);
if (isOn) {
if (!isMember) {
console.info("Adding " + itemName + " to gActiveLights");
// Call addMember directly on the groupItem raw instance
groupItem.addMember(item.rawItem);
}
} else {
if (isMember) {
console.info("Removing " + itemName + " from gActiveLights");
groupItem.removeMember(item.rawItem);
}
}
Good afternoon. I was just wondering if there is a way that the ‘thermostat’ page could have a way of specifying the symbol to be used: Degree symbol (°) or some other symbol, for example Percent (%). [I’m guessing some may want to use a C or F also].
I’m asking this as the page works perfectly for control of my Dehumidifier (has current value, set point value, and on/off switch, etc) so I don’t think any other layout changes would be required.
So, presently, I have two of these pages on my displays, one for setting the heating and another fer setting the humidity.
A button page can now take its tiles from an openHAB group instead of a fixed list. Each Switch, Dimmer or Color member becomes a tile that toggles it, and with only_on the page lists just the lights that are on:
The list is built when the page opens. A light you switch off stays there as a grey tile until the page is opened again, so the tiles don’t move under your finger.
There are eight tiles per sheet. With more members you swipe for the next sheet, and this also works in the swipe row.
Other item types in the group are left out, since a tap can’t toggle them.
With metadata, members can get their own name, order and icon, or be hidden, as on an entity page. For example: light="Hall" [icon="ceiling-light"].
There’s no “all off” tile for now, so each light is switched off with its own tile.
To update, go to Settings > Firmware > Check for updates. Panels on 0.17.0 or later only need the firmware, older ones also get the display design it offers.
@dheneghan Good idea, that’s in 0.19.0. A thermostat page now has a Unit field next to Step ("unit": "%" in the configuration), so your page will show 56.7% and Target 55 %.
It only changes what is shown, nothing is converted. A value too wide with its unit is written a bit smaller.
Really appreciate all the work you do and the quick turnaround.
Updated to 20.0 and noticed that it now truncates the info line, which it was not doing before. It does not make sense to me why it replaces the 2 ‘rt’ characters with 3 dots, no savings at all… And it does look like there is space for more characters.
Also I noticed that you already have an automatic text scrolling capability for the labels in entities. Can something like this be done for the data coming from the items (in the info line, and in the entities)? I am not a fan of the constant text scrolling, so ideally I would like them to scroll once when the page shown or the text refreshed, and another scrolling cycle might be activated on-demand by clicking on the text…
I also see that now you can remove the labels for the hardware buttons. Is it possible to have a third info line when I do that, or there are some limitation of the platform?
I’m thinking about whether I should just integrate Let’s Encrypt and the like right away (via HTTP-01 or DNS-01).
Can your control panel be accessed from the outside? How do you create your certificates? I’m sure you don’t want to have to manually import them every 90 days.
You were right, and thanks for the screenshot. Since 0.17.0 the right field kept room for “11:11 AM” even when it was empty, so your text missed by 3 px. Now the main text takes the whole line while the right field is empty: 264 px instead of 182 on the US upright, 212 instead of 130 on the others.
The entity labels use the display’s own scrolling text, so this is possible in principle. Scrolling once and stopping, and starting it again with a tap, is more work though, and I’d like to keep the home screen calm, so I’m leaving it out for now. With the wider line most texts should fit anyway. If you still hit the limit, let me know what you need to show.
The “too large” message hid the real problem. That dialog is for a CA, and a Let’s Encrypt certificate isn’t one. There’s now Security → Use your own server certificate: upload fullchain.cer and the key, and open the panel under the name the certificate was made for.
The panel doesn’t renew it, so POST /api/v1/tls/server lets your ACME client send each new one. The install guide has a deploy hook for acme.sh. I tested this with a long self-made chain, not with a real Let’s Encrypt certificate, so I’d be glad to hear how it goes.
I also decided against ACME on the panel itself: an existing client plus the upload does the same and works with every DNS provider.
Got it, that works. I also use acme.sh script, so all worked out perfectly for me…
I noticed that your sample script sends both the private key and the certificate on the update. I normally just update the certificate and keep the existing private key. Is it possible to do that? It would be safer when using the ‘-k’ option on curl, or switching to the plain http to update the certificate (for the situations when an expired cert needs to be updated)…
And it does make perfect sense not to have the ACME management on the panel. Too many different configurations that people could be using, myself including…
Good point, thanks. 0.21.1 does this: POST /api/v1/tls/server now takes the certificate alone and keeps the key on the panel. The first upload still needs the key, and a certificate made with a new key is refused, with the old one staying in use. acme.sh keeps the key by default, certbot needs --reuse-key.
One caveat on -k and plain http: the panel’s login still goes along, and whoever reads it could upload their own certificate. Normally neither is needed, as a renewal comes about 30 days before the end, while the certificate is still valid. For one that has already expired, the install guide now shows -k with --pinnedpubkey: the key stays the same, so curl still checks it is your panel before sending the login.
This looks nice! but there seems to be a total of 3 types, 1 normal and 2 PRO versions (120 and 86)? but I see you guys talk about a EU and a US version, a little confused about which version this works on?
Good idea, to be honest, I hadn’t even realized there was a buzzer on it. I had a hunch, but then I didn’t think about it anymore. I’ll take a look.
Currently, only NSPanel is supported. The Pro model isn’t supported because it’s completely different in terms of both hardware and software (it’s Android-based). I’ve looked into it before and saw that you can install your own launcher on it. But I’m too cheap to spend any more money on it right now (maybe someone will sponsor it )