Method 1: HACS (Click to install)
Download and copy
custom_components/poe_chat
folder tocustom_components
folder in your HomeAssistant config folder
wget -q -O - https://hacs.vip/get | HUB_DOMAIN=ghproxy.com/github.com DOMAIN=poe_chat REPO_PATH=ichuixue/poe-chat ARCHIVE_TAG=main bash -
- Copy this code to file
configuration.yaml
shell_command: update_poe_chat: |- wget -q -O - https://hacs.vip/get | HUB_DOMAIN=ghproxy.com/github.com DOMAIN=poe_chat REPO_PATH=ichuixue/poe-chat ARCHIVE_TAG=main bash -
- Restart HA core
- Call this
service: shell_command.update_poe_chat
in Developer Tools
-
name
: Config entry name, unique -
token
: Poe token,p-b
in cookiesFind Your Poe Token: Log into Poe on any desktop web browser, then open your browser's developer tools (also known as "inspect") and look for the value of the
p-b
cookie in the following menus:- Chromium: Devtools > Application > Cookies > poe.com
- Firefox: Devtools > Storage > Cookies
- Safari: Devtools > Storage > Cookies
-
proxy
: Proxy to use, e.g.,http://192.168.xx.xx:7890
ATTENTION: DO NOT use it too frequently in a short time or your Poe account may have chance to be banned.
- Download the Nod-Red flow for Siri Shortcut and add it to Node-Red in your homeassistant.
- Download the latest version of Poe-Chat Siri Shortcut to your iPhone or iPad and Config the relevant parameters according to the pop-up window during installation.
HA_address
: Your homeassistant IP_ADDRESS, e.g.,http://HA_IP_ADDRESS:8123
HA_token
:The Long-Lived Access Token
obtained athttp://HA_IP_ADDRESS:8123/profile
entry_name
: The entry name when you config thePoe Chat
integrationbot_name
: The default bot you want to use. Please refer to the corresponding relationship below:{ "capybara": "Sage", "a2": "Claude-instant", "nutria": "Dragonfly", "a2_100k": "Claude-instant-100k", "beaver": "GPT-4", "chinchilla": "ChatGPT", "a2_2": "Claude+" }
- Run the Siri shortcut once and agree to all permissions.
- Now you can use
hey siri 对话
to talk with ChatGPT on Apple devices (iPhone/iPad/Apple Watch/HomePod/CarPlay...)
-
poe_chat.chat
service: poe_chat.chat data: name: poe # Config entry name bot: chinchilla message: Hello conversation_id: xxxx throw: false # Output reply result to HA notifications throw_chunk: true # Output chunked reply text to HA notifications extra: # Optional chunk_size: 128 chunk_mark: true chunk_code: true
poe_chat.reply
poe_chat.reply_chunk
event_type: poe_chat.reply data: name: poe bot: chinchilla message: Hello conversation_id: xxxx id: TWVzc2FnZTozMjM1OTk4Nzc= messageId: 323599877 creationTime: 1681373526812436 state: incomplete author: chinchilla text: Hello! How can I assist you today? linkifiedText: Hello! How can I assist you today? text_new: assist you today? suggestedReplies: []
poe_chat.reply_error
event_type: poe_chat.reply_error data: name: poe bot: chinchilla message: Hello conversation_id: xxxx error: xxxx
- Chat with Xiaoai speaker via
hass-xiaomi-miot
alias: Chat with Xiaoai speaker trigger_variables: conversation_id: xiaoai_chat trigger: - platform: state entity_id: sensor.xiaomi_x08c_xxxx_conversation id: send - platform: event event_type: poe_chat.reply event_data: conversation_id: "{{ conversation_id }}" id: reply condition: [] action: - choose: - conditions: - condition: trigger id: send - condition: template value_template: |- {% set sta = trigger.to_state.state|default('') %} {{ sta|regex_findall('给我|请问|告诉我')|length > 0 }} sequence: - service: xiaomi_miot.intelligent_speaker data: entity_id: media_player.xiaomi_x08c_xxxx text: 闭嘴 execute: true silent: true - service: poe_chat.chat data: name: poe # Config entry name bot: chinchilla message: "{{ trigger.to_state.state }}" conversation_id: "{{ conversation_id }}" - conditions: - condition: trigger id: reply sequence: - service: xiaomi_miot.intelligent_speaker data: entity_id: media_player.xiaomi_x08c_xxxx text: "{{ trigger.event.data.text }}" execute: false mode: queued max: 10