Services

Two device-level services send notifications to a LaMetric device via POST /api/v2/device/notifications. Both are registered under the lametric_hass_local domain and accept a device_id as their target.

show_message

POST /api/v2/device/notifications API 2.0.0+

Sends a text notification with an optional icon and sound to a LaMetric device. Internally this builds a Notification object with a single simple frame and posts it to the Device API.

Fields

Field Required Default Description
device_id yes Home Assistant device ID of the target LaMetric device
message yes Text to display. Scrolls if longer than the display width (37 px on LaMetric Time).
icon no Icon ID string (e.g. i1234, a5678) or a Base64-encoded PNG/GIF data URI. See Icon format.
sound no Built-in sound ID (e.g. positive1, alarm3). See Sound IDs for the full list.
cycles no 1 Number of times to repeat the notification. 0 = loop until manually dismissed or deleted via the API.
icon_type no none
none info alert
Controls the indicator icon shown before the content. info shows an “i”, alert shows “!!!”.
priority no info
info warning critical
See Priority levels below.

YAML example

service: lametric_hass_local.show_message
data:
  device_id: "your_device_id"
  message: "Deploy finished ✓"
  icon: "i7956"
  sound: "positive1"
  cycles: 1
  icon_type: info
  priority: info

Notification model reference

Both services construct a Notification object and send it to POST /api/v2/device/notifications. The following table maps service fields to API fields. Full reference: LaMetric Notifications API.

{
  "priority": "<info|warning|critical>",
  "icon_type": "<none|info|alert>",
  "model": {
    "cycles": <integer>,
    "frames": [
      // show_message — simple frame:
      {
        "icon": "<icon-id or data URI>",
        "text": "<message>"
      },
      // show_chart — chart frame:
      {
        "chartData": [1, 2, 3, 4, 5]
      }
    ],
    "sound": {
      "category": "<notifications|alarms>",
      "id": "<sound-id>",
      "repeat": 1
    }
  }
}

Priority levels

Value Behaviour
info Placed in the normal notification queue alongside app-generated notifications. Not shown when the screensaver is active.
warning Interrupts notifications with info priority. Suitable for events like “someone arrived home”. Still blocked by the screensaver.
critical Interrupts all other notifications and wakes the device from the screensaver. Use only for truly urgent events (smoke detector, water leak, etc.). May display in the middle of the night.

Frame types

The Device API supports three frame types within a single notification. This integration uses one frame type per service:

Frame type Used by Fields
Simple show_message icon (optional), text
Chart show_chart chartData — integer array
Goal — (not yet exposed) icon, goalData with start, current, end, unit

Sound IDs

The sound field accepts one of the following built-in sound identifiers. Sounds are played once by default; the Device API repeat field is always set to 1 when using these services. Full reference: LaMetric Notifications API.

Notifications category

bicycle car cash cat dog dog2 energy knock-knock letter_email lose1 lose2 negative1 negative2 negative3 negative4 negative5 notification notification2 notification3 notification4 open_door positive1 positive2 positive3 positive4 positive5 positive6 statistic thunder water1 water2 win win2 wind wind_short

Alarms category

alarm1 alarm2 alarm3 alarm4 alarm5 alarm6 alarm7 alarm8 alarm9 alarm10 alarm11 alarm12 alarm13
Category detection The integration automatically determines the category field (notifications or alarms) from the sound ID prefix. IDs starting with alarm are sent with category: alarms; all others use category: notifications.
Custom sounds (API 2.3.0+) Since API version 2.3.0, the Device API also supports custom sounds via a URL to an MP3 file (sample rates: 8000–44100 Hz, mono/stereo, 16-bit). This is not yet exposed as a service field but can be sent directly to the Device API if needed. See the Notifications API reference.

Icon format

The icon field in show_message accepts one of two formats:

Icon ID

A string of the form <prefix><number> where:

  • i prefix — static icon (PNG). Example: i1234
  • a prefix — animated icon (GIF). Example: a5678

Browse available icons at developer.lametric.com/icons. You can also search via the Cloud Icons API.

Base64 data URI (custom icon)

A PNG or GIF image encoded as a Base64 data URI:

# PNG (8x8 pixels recommended)
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76L..."

# GIF (animated)
"data:image/gif;base64,R0lGODlhCAAIAP..."
Tip LaMetric Time has an 8×8 pixel icon area. For best results, use exactly 8×8 PNG images. Larger images are displayed but may be cropped or scaled.

Legacy notify platform

The integration also registers a legacy notify platform service under the name notify.lametric_<device-name>. This is provided for backwards compatibility with automations that used the old platform-based notify service.

service: notify.lametric_my_device
data:
  message: "Hello from notify"
  data:
    icon: "i1234"
    sound: "cat"
    cycles: 1
    priority: info
Note The extra fields (icon, sound, cycles, priority, icon_type) must be nested under the data: key when using the notify platform. The show_message service is preferred for new automations.

show_chart

POST /api/v2/device/notifications API 2.0.0+

Sends a spike chart notification built from a list of numeric values. Internally this uses the chart frame type of the Notification model — the values are mapped to chartData and displayed as a bar graph that scrolls over the LED matrix.

Fields

Field Required Default Description
device_id yes Home Assistant device ID of the target LaMetric device
data yes List of integers to plot, e.g. [1, 2, 3, 4, 5, 4, 3, 2, 1]. All values are auto-scaled to the 8-pixel display height.
sound no Built-in sound ID. See Sound IDs.
cycles no 1 Repeat count. 0 = infinite.
icon_type no none
none info alert
priority no info
info warning critical

YAML example

service: lametric_hass_local.show_chart
data:
  device_id: "your_device_id"
  data: [1, 3, 5, 7, 9, 7, 5, 3, 1]
  sound: "statistic"
  cycles: 2

set_screensaver

PUT /api/v2/device/display API 2.1.0+

Enables or disables the screensaver and configures its activation mode. This service targets the brightness_mode select entity of the device (platform select, entity key brightness_mode). It maps directly to the screensaver object in the Display API's PUT /api/v2/device/display body.

Non-SKY only The screensaver feature is only available on non-SKY devices (e.g. LaMetric Time). SKY devices do not expose a brightness_mode select entity and therefore do not support this service.

Fields

Field Required Default Type Description
enabled yes boolean Enable (true) or disable (false) the screensaver.
mode no when_dark string
when_dark time_based
Activation condition. when_dark uses the ambient light sensor; time_based activates between start_time and end_time.
mode_params no object Only evaluated when mode = time_based. See the mode_params object below.

mode_params object (time_based only)

Field Type Description
enabled boolean Whether the time-based mode is active within the screensaver.
start_time string (ISO 8601 datetime) Time at which the screensaver activates. Only the time component is used; the date is ignored. Must be provided in local time — the integration converts it to UTC before sending to the device.
end_time string (ISO 8601 datetime) Time at which the screensaver deactivates. Same format as start_time.
Time zones The Device API stores screensaver times in UTC. When you read back the display state with GET /api/v2/device/display you will see both start_time / end_time (UTC) and local_start_time / local_end_time (device local time). The integration accepts local time in mode_params and performs the UTC conversion automatically.

Device API body

PUT /api/v2/device/display

{
  "screensaver": {
    "enabled": true,
    "mode": "time_based",
    "mode_params": {
      "enabled": true,
      "start_time": "19:00:00",   // UTC
      "end_time": "07:00:00"      // UTC
    }
  }
}

Example: enable when dark

service: lametric_hass_local.set_screensaver
target:
  entity_id: select.lametric_brightness_mode
data:
  enabled: true
  mode: when_dark

Example: enable on a schedule (10 PM – 7 AM)

service: lametric_hass_local.set_screensaver
target:
  entity_id: select.lametric_brightness_mode
data:
  enabled: true
  mode: time_based
  mode_params:
    enabled: true
    start_time: "2000-01-01T22:00:00"
    end_time: "2000-01-01T07:00:00"

Example: disable screensaver

service: lametric_hass_local.set_screensaver
target:
  entity_id: select.lametric_brightness_mode
data:
  enabled: false

Full API reference: Display API.

activate_action

PUT /api/v2/device/apps/:package/widgets/:id/activate API 2.1.0+
POST /api/v2/device/apps/:package/widgets/:id/actions API 2.1.0+

Triggers a widget-specific action on a LaMetric app. This service targets a scene entity (one per installed app widget). It combines two API calls:

  1. If visible = true (the default): activate the widget via PUT …/activate.
  2. Send the action payload via POST …/actions.
Comparison with scene.turn_on Calling the standard scene.turn_on service on a LaMetric scene entity only brings the widget to the foreground (step 1). activate_action additionally fires a widget-specific action (step 2), which is required for apps that respond to input commands (e.g. countdown timer, weather location change).

Fields

Field Required Default Type Description
action_id yes string ID of the action to trigger. The available action IDs are app-specific and documented by the app developer. Common examples: next, prev, start, reset.
action_parameters no object (key-value map) Optional parameters required by the action. The shape is app-specific.
visible no true boolean If true, bring the widget to the foreground before triggering the action.

Device API body

POST /api/v2/device/apps/:package/widgets/:widget_id/actions

{
  "id": "<action_id>",
  "params": { ...action_parameters },
  "activate": true       // set to visible field value
}

Example: trigger a countdown timer start

service: lametric_hass_local.activate_action
target:
  entity_id: scene.lametric_countdown
data:
  action_id: "start"
  visible: true

Example: navigate a news feed widget

service: lametric_hass_local.activate_action
target:
  entity_id: scene.lametric_news
data:
  action_id: "next"
  visible: true

Full API reference: Apps API.