Integrations / Infrastructure

Home Assistant

Read the state and history of your Home Assistant entities, call actions to switch things on and off, render templates for computed answers, read calendars and the logbook, and trigger workflows from your automations.

12 tools 1 trigger event

Tools

home_assistant.list_states

List every entity with its state and friendly name. Entity IDs are domain.object_id, such as light.kitchen or sensor.outdoor_temperature; the API can't filter by domain, so to list only one domain cheaply render a template like {{ states.light | map(attribute='entity_id') | list }}.

home_assistant.get_state

Get one entity's state with all its attributes, such as brightness, temperature or battery level, and when it last changed.

entity_id*

home_assistant.list_services

List the actions (services) each domain offers, such as light → turn_on, turn_off, toggle, to find what call_service can do.

home_assistant.call_service writes

Call an action, such as light.turn_on or lock.lock, on the entities, areas or devices given, and wait for it to finish. Returns the states it changed. list_services gives each action's data fields.

domain*service*entity_idarea_iddevice_iddata

home_assistant.fire_event writes

Fire an event on Home Assistant's event bus for automations to trigger on. The data arrives as trigger.event.data.payload. Needs an administrator's token.

event_type*payload

home_assistant.render_template

Render a Jinja template on Home Assistant and return the text, for computed answers such as {{ states.light | selectattr('state', 'eq', 'on') | map(attribute='name') | list }} or {{ state_attr('sun.sun', 'next_rising') }}. Changes nothing. Needs an administrator's token.

template*

home_assistant.get_history

Get how entities' states changed over a period, as one list of state changes per entity, oldest first, without attributes.

start_time*filter_entity_id*end_time

home_assistant.get_logbook

Read logbook entries, the human-readable record of what turned on, opened or was triggered, from a start time onwards.

start_time*entityend_timeperiod

home_assistant.list_calendars

List the calendar entities, such as calendar.family, with their names.

home_assistant.list_calendar_events

List a calendar's events between two times. Each has a summary, a start and end (dateTime, or date for all-day events), and optionally a description and location.

entity_id*start*end*

home_assistant.api_get

Send a GET request to any Home Assistant API path under https://{host}/api and return the response. For endpoints the named tools don't cover.

path*params

home_assistant.api_request writes

Send a POST, PUT, PATCH or DELETE request to any Home Assistant API path under https://{host}/api.

method*path*paramsbody

Tick Allow raw writes on the connection to add api_request, which can send POST, PUT, PATCH and DELETE requests to any Home Assistant API path.

Connect

  1. In Home Assistant, open your Profile (your name at the bottom of the sidebar) → Security, scroll to Long-lived access tokens and create one. Copy it now; it is shown once.
  2. Rendering templates and firing events need the token of an administrator. A token from a non-admin user can still read states and call actions.
  3. Set Host to how Murmurator reaches Home Assistant: a public https address such as ha.example.com (a Nabu Casa remote URL works), or, for a server at home, its tailnet name and port such as http://homeassistant:8123 with a tailscale connection named as the Tailnet.
  4. To trigger workflows, make up a long random secret and paste it as the connection's webhook secret. Then add a rest_command to configuration.yaml that POSTs JSON to the request URL shown on the connection page with the header authorization: Bearer <that secret>, and call it from an automation's actions.

Credentials

Long-lived access token Webhook secret

Home Assistant API docs

Triggers

Add a rest_command to configuration.yaml with this URL, method: post, content_type: application/json, a header authorization: "Bearer <your webhook secret>" and a JSON payload such as {"name": "front_door_opened", "state": "{{ states('binary_sensor.front_door') }}"}, then call rest_command.<its name> from an automation. Give the payload a name to filter triggers on; the rest of it reaches the workflow as sent.

Events

automation
trigger
kind: home_assistant connection: home_assistant events: [automation] names: [...]

Examples

Bedtime house check — Every night, the house is checked, tidied up and reported on before you go to sleep.

Turn one person's AI process into the company's.

Murmurator is invite-only. Already invited? Sign in and build something real.