Lodol Docs

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

ParameterTypeRequiredDescription
entity_idstringYesThe 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

ParameterTypeRequiredDescription
entity_idstringYesThe ID of the thermostat (climate entity) to update, for example climate.living_room.
temperaturenumberYesThe target temperature to set.
hvac_modestringNoHeating 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

ParameterTypeRequiredDescription
entity_idsarrayYesThe 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

ParameterTypeRequiredDescription
script_entity_idstringYesThe 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

ParameterTypeRequiredDescription
entity_idsarrayYesThe 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

ParameterTypeRequiredDescription
entity_idsarrayYesThe entity IDs to turn on, for example light.kitchen.
brightnessnumberNoFor lights, the brightness level to set, from 0 to 255.

Response

{
  "entity_ids": [
    "light.kitchen"
  ],
  "response": {
    "result": "ok"
  },
  "service": "homeassistant.turn_on"
}

On this page