Skip to main content

Async HTTP + WebSocket client for Social Home, used by the Home Assistant integration.

Project description

socialhome-client

Async HTTP + WebSocket client for Social Home, published to PyPI as socialhome-client and consumed by the Home Assistant integration.

Never imports from social_home (core). Safe to install inside Home Assistant Core, which runs on Python 3.13.

Install

pip install socialhome-client

Use

The client groups methods under feature resources — e.g. c.me.get(), c.shopping.add(...), c.bot.create(...) — rather than a flat surface.

import asyncio

from socialhome_client import SocialHomeClient, SocialHomeWsManager


async def main() -> None:
    async with SocialHomeClient("http://homeassistant.local:8099", token="…") as sh:
        me = await sh.me.get()
        print(me.display_name)

        await sh.shopping.add("milk")
        events = await sh.calendar.list_events("cal-1", "2026-05-01", "2026-06-01")
        print(f"{len(events)} events this month")

        ws = SocialHomeWsManager(sh)
        await ws.connect()
        ws.register(
            ["post_created"],
            lambda frame: asyncio.sleep(0, print(frame)),
        )


asyncio.run(main())

Bots

Home Assistant automations can post into a space feed through the bot-bridge. Each bot has its own Bearer token (shown once on create) and posts render with the bot's icon + name instead of a generic "Home Assistant" avatar.

# Admin turns on bot posting for the space, then registers a household bot.
await sh.space.update(space_id, bot_enabled=True)
bot = await sh.bot.create(
    space_id, scope="space", slug="doorbell",
    name="Doorbell", icon="🔔",
)

# Persist bot.token somewhere safe — the backend will not show it again.
await sh.bot.post(
    space_id, bot.token,
    title="Ring", message="Front door",
)

Develop

pip install -e .[dev]
pre-commit install
pytest

License

Mozilla Public License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socialhome_client-2026.4.25.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socialhome_client-2026.4.25-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file socialhome_client-2026.4.25.tar.gz.

File metadata

  • Download URL: socialhome_client-2026.4.25.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for socialhome_client-2026.4.25.tar.gz
Algorithm Hash digest
SHA256 146251e3a18bbdff573bd541b554b2908fec5e8ee4c8bba7e2305dac8f61bc21
MD5 6c7ca2f2ee68ef199fc7d85357a73cd9
BLAKE2b-256 9e6ada3b47050c11b4e62797248a9a6eb72d97b274c2c317fb3166721f292007

See more details on using hashes here.

Provenance

The following attestation bundles were made for socialhome_client-2026.4.25.tar.gz:

Publisher: publish.yml on social-home-io/socialhome-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file socialhome_client-2026.4.25-py3-none-any.whl.

File metadata

File hashes

Hashes for socialhome_client-2026.4.25-py3-none-any.whl
Algorithm Hash digest
SHA256 a2464f2afc695c2635c776b4c7b8adb22f6c3b0bc3ce65347d3b56cde75e021a
MD5 b26ad8b1eab6f7caee33d49bcd8a9178
BLAKE2b-256 bf67697d01cea9fd72c3a933395b7d34c9d6497896068e73bf5e1a368beeea4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for socialhome_client-2026.4.25-py3-none-any.whl:

Publisher: publish.yml on social-home-io/socialhome-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page