Skip to content

Home Assistant 凭证#

¥Home Assistant credentials

你可以使用以下凭据验证以下节点:

¥You can use these credentials to authenticate the following nodes:

支持的身份验证方法#

¥Supported authentication methods

  • API 访问令牌

¥API access token

相关资源#

¥Related resources

有关服务的更多信息,请参阅 Home Assistant API 文档

¥Refer to Home Assistant's API documentation for more information about the service.

使用 API 访问令牌#

¥Using API access token

要配置此凭据,你需要安装 安装 Home Assistant,创建一个 Home Assistant 账户,并具备以下条件:

¥To configure this credential, you'll need to Install Home Assistant, create a Home Assistant account, and have:

  • 你的主机

¥Your Host

  • 端口

¥The Port

  • 长期访问令牌:

¥A Long-Lived Access Token

要生成访问令牌并设置凭据:

¥To generate an access token and set up the credential:

  1. 生成访问令牌:登录 Home Assistant 并打开你的 用户个人资料

¥To generate your Access Token, log in to Home Assistant and open your User profile. 2. 在“长期访问令牌”部分,生成一个新令牌。

¥In the Long-Lived Access Tokens section, generate a new token. 3. 复制此令牌并将其作为访问令牌输入到 n8n 中。

¥Copy this token and enter it in n8n as your Access Token. 4. 输入你的 Home Assistant 主机的 URL 或 IP 地址,无需 http://https:// 协议,例如 your.awesome.home

¥Enter the URL or IP address of your Home Assistant Host, without the http:// or https:// protocol, for example your.awesome.home. 5. 对于端口,请输入相应的端口号:

¥For the Port, enter the appropriate port:

  • 如果你未更改任何端口并通过 http:// 访问 Home Assistant,请保留默认值 8123

    ¥If you've made no port changes and access Home Assistant at http://, keep the default of 8123.

  • 如果你未更改任何端口并通过 https:// 访问 Home Assistant,请输入 443

    ¥If you've made no port changes and access Home Assistant at https://, enter 443.

  • 如果你已将 Home Assistant 配置为使用特定端口,请输入该端口。

    ¥If you've configured Home Assistant to use a specific port, enter that port. 6. 如果你已在 config.yml 映射键 的 Home Assistant 中启用 SSL,请在 n8n 中打开 SSL 开关。如果你不确定,如果你使用 https:// 而不是 http:// 访问 Home Assistant 用户界面,最好启用此设置。

¥If you've enabled SSL in Home Assistant in the config.yml map key, turn on the SSL toggle in n8n. If you're not sure, it's best to turn this setting on if you access your home assistant UI using https:// instead of http://.