PHCA Widgets

A new feature with version 2.1.1 is the ability to add widgets to your home screen. The way they work is any pagelink or action that you add to a specially named page (“_widget”, including the underscore) will be available for you to add to the homescreen as a widget. Pagelinks will directly open that page in phca. Actions will execute that action, and associated action commands. If you have enabled PIN protection, you will get the PIN popup before executing the command/pagelink. The widget page will be created for you the first time you try to add a widget, if you haven’t created one yourself. Other than the special name, the widget page is really no different than any other page. You could even use it in your regular menus, if you so choose. You do not have to use all of the pagelinks and actions that you place on that page, if you don’t want to.

This screenshot shows a couple of different widgets placed on a homescreen.

The garage door widget shows to lines of text. The top line, “Close garage door” is the major label from the action, and the second line “The garage door is closed”, is from the minor label. As you have probably guessed, the word “closed” is the value of a variable, “~garagedoorstatus~. When I tap the widget, a command is sent to my PH server to execute my “close_garage_door” macro. I also have a PH macro to send a C2DM message to my phone with the garage door status any time it changes.

The Security widget is a pagelink to my “Security” page in PHCA. I chose to make the minor label simply “PHCA Page” so that I can remember that this widget is a pagelink and not an action.

Adding a widget to your homescreen is the same as adding any widget to your homescreen. Long press on an empty area on your home screen and choose “Widgets”. Scroll to phca and choose it. You will see a list of all of the actions and pagelinks from the _widget page. If there are no pagelinks or actions on that page yet, you will have to put some there before continuing (using the processes described in the actions and pagelinks pages). Choose the action or pagelink that you wish to use, select the size of the widget if applicable (only certain Android OSs have the ability to resize widgets), and the widget should appear on your screen. When creating actions and pagelinks on the _widget page, remember that the widgets do have a limited amount of space for text. In general, between the major and minor label, you will get a total of three lines of text. You may need to adjust the text to get it to fit within your widget.