Can a device driver have a help or info page? In the gui and/or at install?

When I tried creating a new virtual WebCore device awhile back, it first displayed a page with all of its information about the driver and how it works, and a button to continue or cancel. How is that done? What about a run-time help page on the device page? My Hikvision camera driver that I plan to release to the general public has some requirements that I would like to inform the user of before install. What's the best way to do that?

Drivers do not offer much in the way of UI customization, basically just the commands and preferences (inputs) as defined in the driver. You have a little leeway with preferences in that you can provide both a title and description parameter for the input (which some people stylize with HTML, even though this is not "officially" supported, just a side effect of how the current UI works). Lots of drivers use only title (I think that's the required one among the two? maybe either alone also works?), the display of which is fairly simple.

It might be helpful if you could provide an example of the specific device you were looking at, otherwise it's possible you were thinking of that.

Of course, actual documentation is probably better than anything you can provide in the UI. :smiley:

I’ve tried a few things with the Hub Information Driver v3 using tooltips and a link to an information page down in the preferences…

5 Likes

Ok thanks. but I got it now, came to me in a flash last night not long after I posted this. I know there's nothing available but there should be. All drivers should have a "help/sysinfo" page to let users know what the requirements are, how it operates and tips on how to use it. (tangent: So how do we submit enhancement requests?)

I have developed a driver for Hikvision cameras that I'm going to be releasing to the public domain soon. This driver controls the wired Alarm I/O ports and the enabled/disabled state of all motion detection events, thus allowing users to trigger their cameras using any sensor, rule or app in HE and set arming schedules for motion detection on HE if they use it.

So there are very specific requirements that the user needs to know, BEFORE they add their first camera to try it out. Because if the Alarm I/O ports are already in use (i.e. wired to a control panel), bad things could happen. Good thing is, anyone with hard wired cameras is likely to already have all the control they need, and won't be needing this driver.

My solution to this is easy. I'm adding two buttons to my driver, one for Sys Info and and the other for programming tips since what I'm doing in this driver is going to be of great interest to a lot of people who are struggling with sending/receiving XML using httpget and httpput and parsing out the response.

Those two commands will simply spit it out in the log. The first thing users will see when they add a new device and the device page pop up is my "LastResponse" Attribute, which will display "Please click SysInfo for important driver information and requirements, then view them in the log."

Really easy to do, load up a list with a hundred lines or so and spit it out backwards... :slight_smile:

1 Like

not two new buttons... two new commands... just to clarify

Start a new topic here: Feature Requests - Hubitat

2 Likes

You could make settings button which just has a link to a webpage (could be a markdown file you host on github). Also you can make a floating info box at the top. I have done both in my Zooz drivers. Personally I feel like this would be more useful than a command button which requires looking in the logs.

Here is example, I can dig out just that code for you if interested.

I have this at the end but it could be anywhere.

This is at the very top:
image

6 Likes

hmmm... That would be cool but too much work and too much "new stuff" for me at this point. I am brand new to HE, just came over from Vera. Good to know I can do stuff like that through github, where I'll be posting this. Thats all new to me too. So my log buttons will do for now. It's just to get users up and running. So I got them out there and they look good, with caps for emphasis and lines of asterisks to break up a few sections, and short lines of 50-60 to avoid wrap for most.

1 Like

@jtp10181
I just started using your Zooz ZEN16 advanced relay driver and couldn't help but notice the community link and how you did that in code. Now that I have time to look into it, this is exactly what I'd like to provide for a link to my HCC User Guide. It seems easy enough and your html formatting is nice to have, too.

But I do have a couple questions before I borrow your code for that hidden help input field, and that is, why isn't this documented (or is it?) or made more easily available by providing a stock "?" icon on every device driver page that the driver can set with an external link? That's for the staffers to pick up on, and,

Why do you have the Hidden HelpInfo Input field and two others for logging in a separate Preferences section near the bottom of the code? Any particular reason for that?
thanks!

Its not documented and it is also sort of a hack. The fact that it works is not a supported feature so it could be broken at any time with a firmware update without warning. You could probably even take my code and turn it into a small help ? instead of the larger text box I added.

The entire bottom half of my drivers is library code which I maintain a separate file for, but for ease of updating on the users end I merge/sync it into every driver. Having all the common code together at makes it easy to sync it up with my master library file. I am up to 22 Zooz drivers now.

1 Like

Great, thank you. The html is tricky and now I know... its coder beware with this hack! :slight_smile:

Yes indeed, and this was the pointer I needed to come up with the final solution until HE gives me a better built-in method for a user guide or help page. But that likely won't near as stylish as I can be with GitHub Pages, so I deployed my Hikvision Camera Controller to the Community two weeks ago, using your code to format the hidden input field button with a link to the User Guide on my new GitHub website:

@Field static final String DRIVER = "HCC 1.0.3"
@Field static final String USER_GUIDE = "https://tr-systems.github.io/web/HCC_UserGuide.html"

input name: "UserGuide", type: "hidden", title: fmtHelpInfo("User Guide")

String fmtHelpInfo(String str) {
String prefLink = "<a href='${USER_GUIDE}' target='_blank'>${str}<br><div style='font-size: 70%;'>${DRIVER}</div></a>"
return "<div style='font-size: 160%; font-style: bold; padding: 2px 0px; text-align: center;'>${prefLink}</div>"

Not all drivers or apps need a user guide like mine but some do at least a little, and this is one easy way to provide one. But I wasn't satisfied with the plain jane look of the default GitHub Pages website so I had to take it a step further, since I got the time and we're still in the deep freeze, but barely this winter. :slight_smile:

So after two additional weeks of home schooling, study and practice, 10 hours a day, I came up with this...

Lakeside Blues for GitHub Pages by TR-Systems

Hope someone out here finds it useful. Let me know if you do!

1 Like

@jtp10181 Thank you for the code; with your kind permission, I will use it in all of my drivers now!
:+1:

Go for it. All my code is out there to share. It is mostly all together in my drivers near the bottom.

2 Likes