Skip to main content
Version: 4.2 (beta)

Watch Page

The Watch Page defines the project's menu in the HSYCO app for Apple Watch: a vertical list of items, such as buttons, sliders, labels and camera images, that control and display the project.

A project can have one Watch Page. The Watch Page has no ID and contains only Watch items.

Create the Watch Page​

In the Project Editor, press Add Page and choose Watch Page. The option appears only when the project has no Watch Page.

Select the Watch Page, then add items from the Add tab, which lists only Watch items while the Watch Page is selected. Items are stacked automatically from top to bottom in list order, so they have no position or size. Watch items can only be placed on the Watch Page.

The Project Editor saves the Watch Page in the project's app_watch attribute.

Items​

  • Button, On/Off, Light and Shutter perform their action when tapped:

    • command sends a command with the specified name and parameter, like a project button. See the Command API.

    • datapoint toggles the datapoint.

    • url sends an HTTP GET request to the URL.

    • With Confirm set to true, the first tap turns the item orange and a second tap performs the action.

    • On/Off, Light and Shutter show an icon that follows the datapoint state. The Shutter icon follows its Mode.

  • Slider sends its value as the command parameter, as the datapoint value, or in place of %value in the URL. The slider moves in steps of 25, so it sends 0, 25, 50, 75 or 100.

  • Label displays a text.

  • Image displays the image at the specified URL.

  • Camera displays a camera image, refreshed every Refresh seconds (3 when empty).

  • Speech sends the dictated text to the HSYCO NLP engine.

  • Datalogger shows its label and the datalogger's total for the current period; tapping it opens the chart. It requires watchOS 9 or later and is skipped on older versions.

Change items at runtime​

Give an item an ID to change it with the UISET action in EVENTS, or with uiSet() in JavaScript and Java. The Watch follows these attributes:

  • label: the label of Button, On/Off, Light, Shutter, Slider and Speech items, and the text of labels.

  • text: the text of labels.

  • state: the icon of On/Off, Light and Shutter items, e.g. on, off, up, down. It is used when the item has no datapoint.

  • value: the position of sliders, from 0 to 100. It is used when the slider has no datapoint.

  • src: the URL of images and cameras.

  • visible: false hides the item.

For example, UISET watch_status.label = "Alarm armed" changes the text of the label with ID watch_status.

IDs are not unique: the same UISET also changes objects with that ID on the project's pages. Value Bindings are not supported on Watch items.

The whole menu can also be replaced with a UISET of the project's app_watch attribute. The value is a comma-separated list of JSON objects, one per item, with the item type without the watch_ prefix, e.g. {"type":"label","id":"watch_status","label":"Home"},{"type":"light","label":"Kitchen","action":"datapoint","address":"k.light.1"}. As with a saved Watch Page, the new menu reaches the Watch through the HSYCO App, when the project is open in the app.

Use the Watch Page on the Apple Watch​

The Watch Page reaches the Apple Watch through the HSYCO App for iOS:

  1. Save the project.

  2. On the iPhone paired with the Apple Watch, open the project's connection in the HSYCO App. Remember PIN/PUK must be enabled for the connection, because the Watch logs in with the credentials stored by the app.

  3. Open the HSYCO app on the Apple Watch to see the updated menu.

Each connection with a Watch Page appears as a separate page on the Watch. Swipe horizontally to switch between them.

If the Watch keeps showing an old menu, select Resync Apple Watch in the HSYCO App settings. If that doesn't help, Reset Apple Watch clears the menus of all connections: open each project in the app again to send them back.

See HSYCO App for iOS Devices.

Attributes​