Skip to content

lupzn/ha-local-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Home Assistant Local Chat ๐Ÿ’ฌ

HA Local Chat

A private, fully-local chat for your Home Assistant dashboard.
Real-time messages, delete & admin moderation, emoji picker โ€” no cloud, no servers.

HACS Custom Home Assistant Latest Release Apache 2.0 License Donate via PayPal

โœ… Stable release โ€” v2.2.2. Production-ready and installable via HACS. See the latest release and the changelog.

Unofficial community integration โ€” not affiliated with or endorsed by Home Assistant or Nabu Casa.


๐ŸŽฏ Why this?

Home Assistant is the screen everyone in the household already looks at โ€” yet there's no built-in way to leave each other a quick message on the dashboard. Notifications are one-way; chat-style alternatives need cloud accounts.

HA Local Chat adds a real chat card that runs 100 % inside your own instance. Messages live in Home Assistant's storage, sync in real time over the event bus, and never touch an external server.


โœจ Features

Feature What it does
๐Ÿ’ฌ Real-time chat Messages appear instantly on every open dashboard via the HA event bus
๐Ÿ’พ Persistent history The last 100 messages survive a restart (stored locally in .storage)
๐Ÿ‘ค Identity & avatars Uses the logged-in HA user's name; coloured initials avatars
๐Ÿ—‘๏ธ Delete & moderate Delete your own messages; admins can delete any โ€” enforced server-side
๐Ÿ˜Š Emoji picker Built-in emoji panel, full UTF-8 โ€” great for wall tablets without an emoji keyboard
๐Ÿ› ๏ธ Visual editor Set title and height in the UI; leave the title empty for a header-less card
๐Ÿงฑ Real chat feel Date separators (Today / Yesterday), multi-line input (Shift+Enter), smart auto-scroll
๐ŸŽจ Themed Follows your Home Assistant light/dark theme automatically
๐Ÿ”Œ One-click setup Add it from the UI โ€” no YAML, no www copying, no manual Lovelace resource

See ROADMAP.md for what's planned next.


๐Ÿš€ Installation

1 ยท Install via HACS (recommended)

  1. HACS โ†’ Integrations โ†’ โ‹ฎ (top right) โ†’ Custom repositories
  2. Add https://github.com/lupzn/ha-local-chat, category Integration
  3. Install Home Assistant Local Chat, then restart Home Assistant

Manual alternative: copy custom_components/ha_chat into config/custom_components/, then restart.

2 ยท Add the integration

Settings โ†’ Devices & Services โ†’ + Add Integration โ†’ search โ€œHome Assistant Local Chatโ€ โ†’ Submit.

That's the only setup step. No configuration.yaml, no www copying, no Lovelace resource โ€” the chat card registers itself.

3 ยท Add the card to a dashboard

Edit a dashboard โ†’ + Add Card โ†’ search โ€œLocal Chat Cardโ€.

First time the card isn't listed? Hard-refresh the browser (Ctrl/Cmd + Shift + R) โ€” the frontend is cached โ€” then reopen the picker.

You can also add it manually (+ Add Card โ†’ Manual):

type: custom:ha-chat-card
# title: Familien-Chat   # optional โ€” omit for no header
# height: 320            # optional โ€” chat-area height in px

โš™๏ธ Configuration

Open the card's โ‹ฎ โ†’ Edit to use the visual editor โ€” or set the same options in YAML:

Option Type Default Description
title string (none) Header text โ€” leave empty for no header
height number 320 Height of the chat area, in px

Services

Service Description
ha_chat.send_message Send a message (field message). Works from automations & scripts too.
ha_chat.delete_message Delete a message by message_id. Succeeds only for the author or an admin.

Example โ€” post a note when someone gets home:

automation:
  - alias: "Chat: arrival note"
    trigger:
      - platform: state
        entity_id: person.daniele
        to: "home"
    action:
      - service: ha_chat.send_message
        data:
          message: "๐Ÿ  {{ trigger.to_state.name }} is home."

Deleting messages

Hover a message and click the ๐Ÿ—‘ icon. You can always delete your own messages; administrators can delete anyone's. The check is enforced in the backend, so it can't be bypassed from the UI.


๐Ÿ”’ Privacy & security

  • 100 % local โ€” messages stay in your instance, no external servers, no telemetry.
  • XSS-safe โ€” messages render as plain text, so no HTML/script injection is possible.
  • Server-side moderation โ€” delete permission (author / admin) is verified in the backend.

Full policy: PRIVACY.md.


๐Ÿ—๏ธ Project structure

ha-local-chat/
โ”œโ”€โ”€ custom_components/ha_chat/
โ”‚   โ”œโ”€โ”€ __init__.py                  โ† backend: services, WebSocket history, storage, frontend registration
โ”‚   โ”œโ”€โ”€ config_flow.py               โ† one-click UI setup (no YAML)
โ”‚   โ”œโ”€โ”€ const.py                     โ† constants (events, limits, storage keys, URLs)
โ”‚   โ”œโ”€โ”€ manifest.json
โ”‚   โ”œโ”€โ”€ services.yaml                โ† send_message / delete_message
โ”‚   โ”œโ”€โ”€ strings.json + translations/ โ† setup dialog (en, de)
โ”‚   โ”œโ”€โ”€ frontend/ha-chat-card.js      โ† Lovelace card (served + auto-registered)
โ”‚   โ””โ”€โ”€ brand/                       โ† icon.png, icon@2x.png (HA 2026.3+ local brand)
โ”œโ”€โ”€ hacs.json ยท icon.png
โ”œโ”€โ”€ README.md ยท ROADMAP.md ยท PRIVACY.md ยท CHANGELOG.md
โ””โ”€โ”€ LICENSE ยท NOTICE

๐Ÿงฉ How it works

  • Backend (__init__.py) registers two services and stores the last 100 messages in Home Assistant's Store (.storage/ha_chat_history).
  • Sending fires a ha_chat_message event on the event bus; every open card appends it instantly.
  • Deleting verifies author/admin server-side, then fires ha_chat_message_deleted so all cards drop the message.
  • History is fetched point-to-point via the WebSocket command ha_chat/get_messages โ€” no global broadcast, so other dashboards don't flicker.
  • The card is served from the integration's frontend/ folder and registered (as a Lovelace resource + module URL) once Home Assistant has finished starting โ€” so it appears automatically, no manual resource needed.

๐Ÿงฐ Troubleshooting

Card not in the picker, or โ€œCustom element doesn't exist: ha-chat-cardโ€:

  1. Add the integration first. Settings โ†’ Devices & Services โ†’ it must be listed. This is a config-flow integration โ€” it only loads (and registers the card) once it has been added.
  2. Make sure you're on the latest version in HACS and restarted HA.
  3. Hard-refresh the browser (Ctrl/Cmd + Shift + R) โ€” the frontend is cached.

Quick checks:

  • Open http://YOUR-HA:8123/ha_chat_frontend/ha-chat-card.js โ€” you should see JavaScript, not a 404.
  • The browser console should log HA-LOCAL-CHAT vX.Y.Z when the card loads.

Manual fallback (always works): copy custom_components/ha_chat/frontend/ha-chat-card.js to /config/www/, add a dashboard resource (Settings โ†’ Dashboards โ†’ โ‹ฎ โ†’ Resources) with URL /local/ha-chat-card.js, type JavaScript Module, then hard-refresh.


โค๏ธ Support

If this saves your household some sticky notes, consider supporting development:

  • โญ Star this repo on GitHub
  • โ™ฅ Donate via PayPal
  • ๐Ÿ› Report bugs in the Issues
  • ๐Ÿ’ก Suggest features โ€” same place

๐Ÿ“œ License

Apache License 2.0 ยฉ LUPZN โ€” see LICENSE and NOTICE.

โš ๏ธ Disclaimer

HA Local Chat is a third-party custom integration, not affiliated with, endorsed by, or sponsored by Home Assistant or Nabu Casa, Inc. "Home Assistant" is a trademark of Nabu Casa, Inc., used here only to identify the platform this integration runs on.

About

๐Ÿ’ฌ Private, fully-local chat card for Home Assistant โ€” real-time, delete & admin moderation, emoji picker, visual editor. HACS ยท one-click setup ยท no cloud.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors