Jeedom Daemon Python

raw JSON →
1.2.9 verified Mon Apr 27 auth: no python

A base library to implement Jeedom daemons in Python using asyncio and aiohttp. It handles WebSocket communication with Jeedom core, automatic reconnection, and JSON-RPC style commands. Current version is 1.2.9, requiring Python >=3.9. Release cadence is irregular with several updates in 2024-2025.

pip install jeedomdaemon
error ModuleNotFoundError: No module named 'jeedomdaemon'
cause The package is not installed or installed in a different Python environment.
fix
Run 'pip install jeedomdaemon' in the correct environment.
error TypeError: object NoneType can't be used in 'await' expression
cause The callback parameter was not provided or is not a callable (e.g., None).
fix
Pass a valid callback function, even if it's a no-op: callback=lambda x: None.
error aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host ...
cause The WebSocket URL is wrong or the Jeedom core is not running.
fix
Check the 'url' parameter (should be ws:// or wss://) and ensure Jeedom is accessible.
breaking JeedomDaemon now requires an explicit callback parameter in the constructor. In older versions (<1.0.0) the callback was optional. If omitted, the daemon will not process replies and may hang.
fix Provide a callback function (e.g., lambda x: None) or implement a proper reply handler.
deprecated The old import path 'from jeedomdaemon.jeedom_socket import JeedomSocket' is deprecated. All public classes are now exposed at the top-level package.
fix Use 'from jeedomdaemon import JeedomSocket' instead.
gotcha The daemon's on_message method must be a coroutine. If you define it as a regular function, the library will not await it and the message will be silently dropped.
fix Always define on_message with 'async def'.

Basic daemon subclass and startup.

import asyncio
from jeedomdaemon import JeedomDaemon

class MyDaemon(JeedomDaemon):
    async def on_message(self, message):
        print('Received:', message)

async def main():
    daemon = MyDaemon(
        apikey=os.environ.get('JEEDOM_APIKEY', ''),
        url=os.environ.get('JEEDOM_URL', 'ws://localhost:8080'),
        callback=lambda x: print('Callback:', x)
    )
    await daemon.start()

if __name__ == '__main__':
    asyncio.run(main())