This update also includes the ability to specify your video file name or your frame file name in the tile editor. It uses the name field if a tile matching that name is found (after ignoring spaces).
The clocks also get new fmt_time and fmt_date elements that contain the format used to render time. These are by default set to “g:I:s a” and “M d, Y” to render as before but using the custom feature above these variables can be replaced by any user provided text field to give different formats. I will build common options into the editor later.
Finally I thought I would document the format of the hmoptions user config for those wanting to try it. A user field is defined by adding a json formatted array of arrays. The main key is the word “user_” concatenated with the unique ID of the tile to customize. This is the ID returned by the hub or the names assigned for the ad hog tiles. For example for a custom tile this would be “user_custom_1”. These numbers are found on the Show Info page or in the hmoptions file on the left side of the index list.
The arrays inside the array are three strings. The first string is the custom type, which is either POST, GET, PUT, URL, LINK, or TEXT. The meaning of the second string depends on what the first element is. For TEXT it is the user provided text to show up on the tile. For LINK it is the ID of the tile to link. This is the same ID used in rooms. It is on the right side of the index list and also shown in the show info page under the Tile ID column. For all other first element types the second string is a fully qualified web url that must begin with http. The third string is the name of the tile element to be either created or replaced. If the element exists it will be replaced by the user provided data in the second string. Anything can be replaced and no checking is done to confirm your choice makes sense. So you have total control but you can also do stupid stuff using this feature like changing a light switch to a web link or a silly saying. A more serious use of this replacement feature is to change the content of width and height items of video tiles and to change the skin name of the analog clock. The new fmt_time value can also be replaced this way to modify time formats. Finally for LINK types this item must exist in the linked tile. That tile’s specifies element will then magically be added to our customized tile. And remember these three elements are in an array so they are separated by commas and surrounded by square brackets. That whole thing is then repeated as many times as you like to create more new or customized elements.
Wow… I know that’s a lot to take in and not easy to follow. This is why I’m not merging this yet until I write the GUI. Here is an example:
This example adds text to a blank tile and adds below that text a live link to open a new browser window showing the bing search engine. This example also includes the switch from tile #12. It will be rendered just like it shows on tile 12.
POST and GET and PUT are similar to URL but instead of opening a window the code makes a cURL call and captures the result in a json string that shows on the tile only after clicked.
Pretty crazy stuff. I think this feature puts HP in a class of its own for panel flexibility and customization. Stay tuned for the GUI that makes it more usable.