nixos/hosts/fw/modules/home-assistant/coming-home.nix

28 lines
1.3 KiB
Nix

{
services.home-assistant.config = {
rest_command = {
moltbot_home_arrival = {
url = "https://moltbot.cloonar.com/hooks/agent";
method = "POST";
headers = {
Authorization = "!secret openclaw_hook_token"; # reuse same token
Content-Type = "application/json";
};
payload = ''{"message":"Morning briefing triggered by wake-up. Check:\n1) Today's weather for Vienna\n2) Calendar events today (check CalDAV - see TOOLS.md for credentials)\n3) Due tasks (run: bin/tasks list --due)\n4) Virtual portfolio status (run: bin/stonks portfolio)\n5) Any notable overnight news\n\nCompile into one concise WhatsApp message. Keep it scannable emoji headers, short lines. Don't be verbose.\n\nCRITICAL: Send via message tool:\nmessage(action=\"send\", channel=\"whatsapp\", target=\"+436607055308\", message=\"<briefing>\")","name":"MorningBriefing","deliver":true,"channel":"whatsapp","to":"+436607055308"}'';
verify_ssl = false;
};
};
"automation home_arrival" = {
alias = "home_arrival";
trigger = {
platform = "zone";
entity_id = "person.dominik";
zone = "zone.home";
event = "enter";
};
action = {
service = "rest_command.moltbot_home_arrival";
};
};
};
}