Home Assistant
API actions for the Home Assistant integration.
Home Assistant
Control and monitor your Home Assistant smart home: turn devices on or off, adjust temperatures, and run scripts.
Get entity state
Look up the current state and details of a Home Assistant entity, such as a light, switch, or sensor.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_id | string | Yes | The ID of the Home Assistant entity to look up, for example light.kitchen. |
Response
{
"attributes": {
"brightness": 180
},
"entity_id": "light.kitchen",
"state": "on"
}Set thermostat temperature
Set the target temperature for a thermostat or other climate entity in Home Assistant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_id | string | Yes | The ID of the thermostat (climate entity) to update, for example climate.living_room. |
temperature | number | Yes | The target temperature to set. |
hvac_mode | string | No | Heating or cooling mode to switch to, such as heat, cool, or auto. |
Response
{
"entity_id": "climate.living_room",
"hvac_mode": "heat",
"response": {
"result": "ok"
},
"temperature": 21
}Toggle entities
Toggle one or more Home Assistant entities: anything that is on turns off, and anything that is off turns on.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_ids | array | Yes | The entity IDs to toggle, for example switch.garden. |
Response
{
"entity_ids": [
"switch.garden"
],
"response": {
"result": "ok"
},
"service": "homeassistant.toggle"
}Trigger script
Run a script that you have set up in Home Assistant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
script_entity_id | string | Yes | The ID of the script to run, for example script.goodnight. |
Response
{
"response": {
"result": "ok"
},
"script_entity_id": "script.goodnight"
}Turn off entities
Turn off one or more Home Assistant entities, such as lights or switches.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_ids | array | Yes | The entity IDs to turn off, for example light.kitchen. |
Response
{
"entity_ids": [
"light.kitchen"
],
"response": {
"result": "ok"
},
"service": "homeassistant.turn_off"
}Turn on entities
Turn on one or more Home Assistant entities, such as lights or switches.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_ids | array | Yes | The entity IDs to turn on, for example light.kitchen. |
brightness | number | No | For lights, the brightness level to set, from 0 to 255. |
Response
{
"entity_ids": [
"light.kitchen"
],
"response": {
"result": "ok"
},
"service": "homeassistant.turn_on"
}