Add .codex_tmp/ to .gitignore, update Dashy service references in SKILL.md, and include new BearClaw and Telegram bot YAML files in README.md
parent
46d8243294
commit
5b05bb7add
@ -0,0 +1,120 @@
|
|||||||
|
######################################################################
|
||||||
|
# @CCOSTAN - Follow Me on X
|
||||||
|
# For more info visit https://www.vcloudinfo.com/click-here
|
||||||
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# BearClaw Bridge - Telegram and webhook glue for Joanna agent
|
||||||
|
# Routes Telegram -> codex_appliance and codex_appliance -> Telegram/HA.
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# Notes: Keep BearClaw transport + bridge logic centralized in this package.
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
rest_command:
|
||||||
|
bearclaw_command:
|
||||||
|
url: !secret bearclaw_command_url
|
||||||
|
method: post
|
||||||
|
content_type: application/json
|
||||||
|
headers:
|
||||||
|
x-codex-token: !secret bearclaw_token
|
||||||
|
payload: >
|
||||||
|
{
|
||||||
|
"text": {{ text | tojson }},
|
||||||
|
"user": {{ user | default('carlo') | tojson }},
|
||||||
|
"source": {{ source | default('home_assistant') | tojson }}
|
||||||
|
}
|
||||||
|
|
||||||
|
bearclaw_ingest:
|
||||||
|
url: !secret bearclaw_ingest_url
|
||||||
|
method: post
|
||||||
|
content_type: application/json
|
||||||
|
headers:
|
||||||
|
x-codex-token: !secret bearclaw_token
|
||||||
|
payload: >
|
||||||
|
{
|
||||||
|
"summary": {{ summary | default('event') | tojson }},
|
||||||
|
"wake": {{ wake | default(false) | tojson }},
|
||||||
|
"source": "home_assistant"
|
||||||
|
}
|
||||||
|
|
||||||
|
automation:
|
||||||
|
- id: bearclaw_telegram_bear_command
|
||||||
|
alias: BearClaw Telegram Bear Command
|
||||||
|
description: Handles /bear commands and forwards text to Joanna.
|
||||||
|
mode: queued
|
||||||
|
trigger:
|
||||||
|
- platform: event
|
||||||
|
event_type: telegram_command
|
||||||
|
event_data:
|
||||||
|
command: /bear
|
||||||
|
condition:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger.event.data.user_id is defined }}"
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
command_text: "{{ (trigger.event.data.args | default([])) | join(' ') | trim }}"
|
||||||
|
from_user: "{{ (trigger.event.data.from_first | default('carlo')) | lower }}"
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ command_text == '' }}"
|
||||||
|
sequence:
|
||||||
|
- service: script.joanna_send_telegram
|
||||||
|
data:
|
||||||
|
message: "Usage: /bear <message>"
|
||||||
|
default:
|
||||||
|
- service: rest_command.bearclaw_command
|
||||||
|
data:
|
||||||
|
text: "{{ command_text }}"
|
||||||
|
user: "{{ from_user }}"
|
||||||
|
source: telegram_command
|
||||||
|
|
||||||
|
- id: bearclaw_telegram_text_no_slash_needed
|
||||||
|
alias: BearClaw Telegram Text No Slash Needed
|
||||||
|
description: Treats plain Telegram text as BearClaw command input.
|
||||||
|
mode: queued
|
||||||
|
trigger:
|
||||||
|
- platform: event
|
||||||
|
event_type: telegram_text
|
||||||
|
condition:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger.event.data.user_id is defined }}"
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ (trigger.event.data.text | default('') | trim) != '' }}"
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ not (trigger.event.data.text | default('') | trim).startswith('/') }}"
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
plain_text: "{{ trigger.event.data.text | default('') | trim }}"
|
||||||
|
from_user: "{{ (trigger.event.data.from_first | default('carlo')) | lower }}"
|
||||||
|
- service: rest_command.bearclaw_command
|
||||||
|
data:
|
||||||
|
text: "{{ plain_text }}"
|
||||||
|
user: "{{ from_user }}"
|
||||||
|
source: telegram_text
|
||||||
|
|
||||||
|
- id: bearclaw_reply_webhook
|
||||||
|
alias: BearClaw Reply Webhook
|
||||||
|
description: Receives BearClaw replies from codex_appliance and relays to Telegram/HA push.
|
||||||
|
mode: queued
|
||||||
|
trigger:
|
||||||
|
- platform: webhook
|
||||||
|
webhook_id: !secret bearclaw_reply_webhook_id
|
||||||
|
allowed_methods:
|
||||||
|
- POST
|
||||||
|
local_only: true
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
message: "{{ trigger.json.message | default('Joanna: empty reply') }}"
|
||||||
|
level: "{{ trigger.json.level | default('active') | lower }}"
|
||||||
|
- service: script.joanna_send_telegram
|
||||||
|
data:
|
||||||
|
message: "{{ message }}"
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ level in ['warning', 'error', 'critical'] }}"
|
||||||
|
sequence:
|
||||||
|
- service: script.notify_engine
|
||||||
|
data:
|
||||||
|
title: Joanna Alert
|
||||||
|
value1: "{{ message }}"
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
######################################################################
|
||||||
|
# @CCOSTAN - Follow Me on X
|
||||||
|
# For more info visit https://www.vcloudinfo.com/click-here
|
||||||
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# Telegram Bot Helpers - Joanna/BearClaw Telegram send wrappers
|
||||||
|
# Script wrappers for Telegram messaging using UI-configured integration.
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# Notes: Do not add `telegram_bot:` YAML here; integration is UI-only.
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
script:
|
||||||
|
joanna_send_telegram:
|
||||||
|
alias: Joanna Send Telegram
|
||||||
|
description: Sends a Telegram message to Carlo's allowed chat id.
|
||||||
|
mode: queued
|
||||||
|
fields:
|
||||||
|
message:
|
||||||
|
description: Message body to send.
|
||||||
|
example: Joanna is online.
|
||||||
|
sequence:
|
||||||
|
- service: telegram_bot.send_message
|
||||||
|
data:
|
||||||
|
target: !secret telegram_allowed_chat_id_carlo
|
||||||
|
message: "{{ message }}"
|
||||||
Loading…
Reference in new issue