pymysensors
Python API for talking to a MySensors gateway
Decision gist · record as of 2026-08-14
Yes. pymysensors is actively maintained, has no known vulnerabilities, supports modern Python versions (3.9+), and provides a clean callback-driven API for gateway communication. Install it if you are building a home automation or IoT application around MySensors hardware. The low install friction and permissive MIT license make adoption straightforward. Consider only if you have or plan to deploy MySensors gateway hardware.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a physical MySensors gateway device connected via serial port, TCP, or MQTT broker; Python 3.9 or later.
- Low install friction; depends on 8 runtime packages including pyserial, click, and voluptuous.
- Actively maintained with recent commits and Python 3.9+ support across current versions.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and proprietary projects.
last release 2025-07-17 (393 days) · last repo commit 2026-07-30 · 64 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 73,545 downloads/mo, #14,980 on PyPI
Alternatives
Verify before relying
pip install pymysensors
import pymysensors
def event(message):
print('sensor_update ' + str(message.node_id))
gateway = pymysensors.SerialGateway('/dev/ttyACM0', event_callback=event)
gateway.start()- Extent of v2.x feature coverage beyond smartsleep, MQTT, and OTA updates
- Performance characteristics with large sensor networks (node/child count limits)
- Asyncio gateway implementation maturity and production readiness
What it is and what it does
pymysensors is a Python library that acts as a client to MySensors gateways, enabling communication with wireless sensor networks. It abstracts the MySensors serial protocol (versions 1.4–2.2) and provides a callback-driven API to receive sensor updates, query node state, and send commands to individual sensors. The library manages gateway instances (serial, TCP, or MQTT) in separate threads or via asyncio, maintains a hierarchical data structure of nodes and child sensors, and handles over-the-air firmware updates using DualOptiboot or MYSBootloader bootloaders.
Typical use involves instantiating a gateway, registering an event callback to handle sensor messages, and starting the gateway. Once running, you access the sensor network through the gateway's sensors dictionary, querying node metadata, child sensor types, and values. The library also supports persistence (pickle or JSON) to retain network state across restarts, and provides methods to push updates back to nodes—useful for controlling actuators or triggering OTA updates.
Use it for
- Monitor temperature, humidity, and motion sensors in a home automation setup by registering callbacks and querying sensor values.
- Deploy firmware updates to multiple sensor nodes without manual intervention using the update_fw method.
- Integrate a wireless sensor network with a home automation platform via the Python API.
- Persist sensor network topology and state across gateway restarts using JSON or pickle persistence.
- Control actuators (lights, relays) by sending commands to child sensors via set_child_value.
- Bridge gateways to MQTT brokers for cross-platform IoT integration.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pymysensors is actively maintained, has no known vulnerabilities, supports modern Python versions (3.9+), and provides a clean callback-driven API for gateway communication. Install it if you are building a home automation or IoT application around MySensors hardware. The low install friction and permissive MIT license make adoption straightforward. Consider only if you have or plan to deploy MySensors gateway hardware.
Install
pymysensors on PyPI
Before you install
Low install friction; depends on 8 runtime packages including pyserial, click, and voluptuous. Actively maintained with recent commits and Python 3.9+ support across current versions.
Requires a physical MySensors gateway device connected via serial port, TCP, or MQTT broker; Python 3.9 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and proprietary projects.
Quickstart
pip install pymysensors
import pymysensors
def event(message):
print('sensor_update ' + str(message.node_id))
gateway = pymysensors.SerialGateway('/dev/ttyACM0', event_callback=event)
gateway.start()
Verify before relying
- Extent of v2.x feature coverage beyond smartsleep, MQTT, and OTA updates
- Performance characteristics with large sensor networks (node/child count limits)
- Asyncio gateway implementation maturity and production readiness
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 8 packagesawesomeversionclickcrcmodgetmacIntelHexpyserialpyserial-asyncio-fastvoluptuous |
| Maintenance | Actively maintained 393 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 73,545 / month, #14,980 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: End Users/DesktopNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Home Automation |
Evidence: pymysensors-0.26.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mysensors gateway python”
- pymysensorsPython API for communicating with MySensors gateways over serial,…
- grpc-gateway-protoc-gen-openapiv2Generates Python support code for gRPC Gateway protoc annotations,…
- aioruuvigatewayAn asyncio-native library for fetching data from Ruuvi Gateway…
Give your agent the search over MCP, or paste the wish link into any chat.
More Home Automation packages
Represents and manipulates IPv4, IPv6, MAC addresses and related network objects; supports CIDR notation, subnetting, set operations, IANA lookups, and DNS reverse generation.
Home Assistant is an open-source home automation platform that centralizes control of smart home devices and automations on a local server or Raspberry Pi, prioritizing local control and privacy over cloud dependency.
Defines finite state machines and statecharts with a declarative Python API, supporting flat states, compound hierarchies, parallel regions, history states, guards, and both sync and async callbacks.
Install it if you need to model workflows, control logic, or any system with discrete states and event-driven transitions — from simple state machines to complex…
A Python library for controlling BlueZ Bluetooth adapters on Linux via the Management API, supporting both synchronous and event-driven command patterns.
An async Python library for controlling and monitoring Homematic and HomematicIP devices through multiple backend systems (CCU3, OpenCCU, Homegear, CUxD, CCU-Jack) using XML-RPC and JSON-RPC protocols.
Install it if you need to control Homematic devices from Python; the only constraint is a requirement for Python 3.14 or later and network access to a compatible…
Provides base classes and utilities for Home Assistant integrations to proxy HTTP and WebSocket traffic through Home Assistant's web server.
Install only if you are building a custom Home Assistant integration; it is not useful as a standalone package.
See also aioruuvigateway · PyCampbellCR1000 · tb-mqtt-client · pyotgw · zigpy · rflink · tb-paho-mqtt-client · meshtastic · paho-mqtt · meross-iot