{
  "service": "home_assistant",
  "displayName": "Home Assistant",
  "categories": [
    "Productivity"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "Long-Lived Access Token",
      "placeholder": "HOME_ASSISTANT_TOKEN",
      "description": "Home Assistant long-lived access token used with the Authorization: Bearer header. Create it from your Home Assistant user profile page.",
      "extraFields": [
        {
          "key": "baseUrl",
          "label": "Instance Base URL",
          "inputType": "text",
          "required": true,
          "secret": false,
          "placeholder": "http://homeassistant.local:8123",
          "description": "The root URL for your Home Assistant instance, for example http://homeassistant.local:8123 or https://ha.example.com."
        }
      ]
    }
  ],
  "homepageUrl": "https://www.home-assistant.io",
  "actions": [
    {
      "id": "home_assistant.call_service",
      "service": "home_assistant",
      "name": "call_service",
      "description": "Call a Home Assistant service to control entities, such as light.turn_on or switch.turn_off.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "minLength": 1,
            "description": "The Home Assistant service domain, for example light or switch."
          },
          "service": {
            "type": "string",
            "minLength": 1,
            "description": "The Home Assistant service name, for example turn_on or turn_off."
          },
          "serviceData": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The JSON service data sent directly to Home Assistant, such as entity_id or brightness."
          },
          "returnResponse": {
            "type": "boolean",
            "description": "Whether to request service response data with the return_response query parameter."
          }
        },
        "additionalProperties": false,
        "required": [
          "domain",
          "service"
        ],
        "description": "Input parameters for calling one Home Assistant service."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "changedStates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entity_id": {
                  "type": "string",
                  "description": "The Home Assistant entity identifier."
                },
                "state": {
                  "type": "string",
                  "description": "The current state value."
                },
                "attributes": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "The integration-specific attributes for the entity state."
                },
                "last_changed": {
                  "type": "string",
                  "description": "The timestamp when the state last changed."
                },
                "last_updated": {
                  "type": "string",
                  "description": "The timestamp when the state object was last updated."
                },
                "context": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The Home Assistant context identifier."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parent_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The optional parent context identifier."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "user_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The optional Home Assistant user identifier."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": true,
                  "description": "The Home Assistant context attached to a state change."
                }
              },
              "additionalProperties": true,
              "required": [
                "entity_id",
                "state",
                "last_changed",
                "last_updated"
              ],
              "description": "One Home Assistant entity state object."
            },
            "description": "The Home Assistant states changed by the service call."
          },
          "serviceResponse": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "The optional Home Assistant service response object."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "changedStates",
          "serviceResponse"
        ],
        "description": "The normalized Home Assistant service call response."
      }
    },
    {
      "id": "home_assistant.fire_event",
      "service": "home_assistant",
      "name": "fire_event",
      "description": "Fire one Home Assistant event with optional event data.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "minLength": 1,
            "description": "The Home Assistant event type to fire."
          },
          "eventData": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The optional JSON event data sent to Home Assistant."
          }
        },
        "additionalProperties": false,
        "required": [
          "eventType"
        ],
        "description": "Input parameters for firing one Home Assistant event."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "response": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The JSON response returned by Home Assistant after firing the event."
          }
        },
        "additionalProperties": false,
        "required": [
          "response"
        ],
        "description": "The Home Assistant fire-event response."
      }
    },
    {
      "id": "home_assistant.get_config",
      "service": "home_assistant",
      "name": "get_config",
      "description": "Fetch the Home Assistant instance configuration.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input is required for this action."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "config": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The Home Assistant configuration object."
          }
        },
        "additionalProperties": false,
        "required": [
          "config"
        ],
        "description": "The Home Assistant configuration response."
      }
    },
    {
      "id": "home_assistant.get_state",
      "service": "home_assistant",
      "name": "get_state",
      "description": "Fetch the current state for one Home Assistant entity.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string",
            "minLength": 1,
            "description": "The Home Assistant entity identifier, for example light.living_room."
          }
        },
        "additionalProperties": false,
        "required": [
          "entityId"
        ],
        "description": "Input parameters for selecting one Home Assistant entity."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "state": {
            "type": "object",
            "properties": {
              "entity_id": {
                "type": "string",
                "description": "The Home Assistant entity identifier."
              },
              "state": {
                "type": "string",
                "description": "The current state value."
              },
              "attributes": {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "The integration-specific attributes for the entity state."
              },
              "last_changed": {
                "type": "string",
                "description": "The timestamp when the state last changed."
              },
              "last_updated": {
                "type": "string",
                "description": "The timestamp when the state object was last updated."
              },
              "context": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "The Home Assistant context identifier."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parent_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "The optional parent context identifier."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "user_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "The optional Home Assistant user identifier."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": true,
                "description": "The Home Assistant context attached to a state change."
              }
            },
            "additionalProperties": true,
            "required": [
              "entity_id",
              "state",
              "last_changed",
              "last_updated"
            ],
            "description": "One Home Assistant entity state object."
          }
        },
        "additionalProperties": false,
        "required": [
          "state"
        ],
        "description": "The selected Home Assistant entity state."
      }
    },
    {
      "id": "home_assistant.list_events",
      "service": "home_assistant",
      "name": "list_events",
      "description": "List Home Assistant event types currently known by the instance.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input is required for this action."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "One Home Assistant event type entry."
            },
            "description": "The Home Assistant event type entries returned by the instance."
          }
        },
        "additionalProperties": false,
        "required": [
          "events"
        ],
        "description": "The Home Assistant event type catalog."
      }
    },
    {
      "id": "home_assistant.list_services",
      "service": "home_assistant",
      "name": "list_services",
      "description": "List Home Assistant service domains and their available services.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input is required for this action."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "One Home Assistant service domain entry."
            },
            "description": "The Home Assistant service domains returned by the instance."
          }
        },
        "additionalProperties": false,
        "required": [
          "services"
        ],
        "description": "The Home Assistant service catalog."
      }
    },
    {
      "id": "home_assistant.list_states",
      "service": "home_assistant",
      "name": "list_states",
      "description": "List all current Home Assistant entity states.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "No input is required for this action."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "states": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entity_id": {
                  "type": "string",
                  "description": "The Home Assistant entity identifier."
                },
                "state": {
                  "type": "string",
                  "description": "The current state value."
                },
                "attributes": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "The integration-specific attributes for the entity state."
                },
                "last_changed": {
                  "type": "string",
                  "description": "The timestamp when the state last changed."
                },
                "last_updated": {
                  "type": "string",
                  "description": "The timestamp when the state object was last updated."
                },
                "context": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The Home Assistant context identifier."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parent_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The optional parent context identifier."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "user_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "description": "The optional Home Assistant user identifier."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": true,
                  "description": "The Home Assistant context attached to a state change."
                }
              },
              "additionalProperties": true,
              "required": [
                "entity_id",
                "state",
                "last_changed",
                "last_updated"
              ],
              "description": "One Home Assistant entity state object."
            },
            "description": "The Home Assistant state objects."
          }
        },
        "additionalProperties": false,
        "required": [
          "states"
        ],
        "description": "The current Home Assistant entity states."
      }
    },
    {
      "id": "home_assistant.render_template",
      "service": "home_assistant",
      "name": "render_template",
      "description": "Render a Home Assistant template against the connected instance.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "minLength": 1,
            "description": "The Home Assistant template string to render."
          },
          "variables": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Optional template variables passed to Home Assistant."
          }
        },
        "additionalProperties": false,
        "required": [
          "template"
        ],
        "description": "Input parameters for rendering one Home Assistant template."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "result": {
            "type": "string",
            "description": "The rendered template text returned by Home Assistant."
          }
        },
        "additionalProperties": false,
        "required": [
          "result"
        ],
        "description": "The rendered Home Assistant template response."
      }
    }
  ]
}
