Skip to content
Main navigation
All integrations

Home Assistant

How it works:You walk into the office and the timer starts by itself. When you leave, it stops.

With rest_command, Home Assistant starts and stops your timer, for example when you enter the office, scan an NFC tag on your desk or press a wall switch. A REST sensor reads the status as a sentence.

  1. Under Settings, API and devices, add a device of the kind "Other device" and copy the token.
  2. Put the token into secrets.yaml, with the word Bearer in front.
  3. Add the commands and the sensor below to configuration.yaml and restart Home Assistant.
  4. Call the commands from automations, scripts or dashboards, for example as the action "RESTful Command: horaka_start".

secrets.yaml:

Example (yaml)
horaka_auth: "Bearer YOUR_TOKEN"

configuration.yaml:

Example (yaml)
rest_command:
  horaka_start:
    url: "https://api.horaka.com/v1/track/start"
    method: post
    headers:
      Authorization: !secret horaka_auth
    content_type: "application/json"
    payload: '{"project": "PROJECT"}'
  horaka_stop:
    url: "https://api.horaka.com/v1/track/stop"
    method: post
    headers:
      Authorization: !secret horaka_auth
    content_type: "application/json"
    payload: "{}"

sensor:
  - platform: rest
    name: HORAKA today
    resource: "https://api.horaka.com/v1/track/status"
    headers:
      Authorization: !secret horaka_auth
    value_template: "{{ value_json.data.running }}"
    json_attributes_path: "$.data"
    json_attributes: [project, today_seconds, text]
    scan_interval: 300

Automation with an NFC tag from the Home Assistant app:

Example (yaml)
automation:
  - alias: Toggle the timer at the desk
    trigger:
      - platform: tag
        tag_id: desk
    action:
      - service: rest_command.horaka_start

The sensor polls every five minutes; the attribute text is the sentence the shortcut reads aloud as well.

Win back the hours you give away.

Get started in a minute. 14 days of Premium free and without a card, then carry on with Free at no cost or from €4.90 a month with everything for billing.