Chisle
코딩 에이전트 플러그인, 20개 실시간 작업에서 기본 모델 52% 활용, 간결한 페르소나와 출력 압축 제공
Victron Venus OS용 비동기 파이썬 클라이언트, MQTT 토픽을 장치·지표에 매핑해 센서 읽고 설정 제어
Async Python client for Victron Venus OS (GX) that maps MQTT topics to typed devices and metrics - read sensors and control writable settings.
개발 도구GitHub @tomer-w온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
저장소 정보는 아직 수집하지 않았습니다.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗An asynchronous Python library for communicating with Victron Energy Venus OS devices (CCGX, Cerbo GX, Ekrano GX) via MQTT. It maps Victron MQTT topics to typed Python objects with live-updating metrics, writable controls, and device hierarchy support.
This package is the backend for the Home Assistant Victron GX integration.
Disclaimer: This is a third-party library and is not affiliated with Victron Energy.
paho-mqttpip install victron_mqtt
import asyncio
import victron_mqtt
async def main():
# Connect to your Venus OS device
hub = victron_mqtt.Hub("venus.local.", 1883, None, None, False)
await hub.connect()
await hub.wait_for_first_refresh()
# Browse devices and metrics
for device in hub.devices.values():
print(f"Device: {device.name} ({device.device_type})")
for metric in device.metrics:
print(f" {metric.short_id}: {metric.formatted_value}")
await hub.disconnect()
asyncio.run(main())
The Hub is the main entry point. It manages the MQTT connection, discovers devices, and routes metric updates.
hub = victron_mqtt.Hub(
host="venus.local.", # MQTT broker hostname or IP
port=1883, # MQTT broker port
username=None, # Optional MQTT username
password=None, # Optional MQTT password
use_ssl=False, # Enable SSL/TLS
installation_id=None, # Auto-discovered if not provided
operation_mode=OperationMode.FULL, # FULL, READ_ONLY, or EXPERIMENTAL
device_type_exclude_filter=None, # Exclude specific device types
update_frequency_seconds=None, # Throttle update frequency
ssl_context=None, # Custom SSL context for certificate verification
)
Security note: with
use_ssl=Trueand nossl_context, the TLS connection does not verify the broker's certificate, because GX devices ship with self-signed certificates. To verify, pass a context with your CA loaded:import ssl context = ssl.create_default_context(cafile="/path/to/venus-ca.crt") hub = victron_mqtt.Hub("venus.local.", 8883, None, "password", True, ssl_context=context)
Update frequency: update_frequency_seconds controls how often metric updates are delivered to on_update callbacks. Throttling only applies to numeric values; non-numeric changes are always delivered.
None (default) — deliver on every value change0 — deliver on every MQTT message, even if the value is unchangedN > 0 — deliver at most one update per N seconds per metric"auto" — per-metric interval chosen by the library based on the metric type: fast-changing metrics users watch live (power, current, location) update every few seconds, while the rest use a longer interval. See AUTO_UPDATE_INTERVALS in victron_mqtt.constants."auto_unthrottled" — like "auto", but fast-changing metrics update on every value change with no time limit.Key properties:
hub.devices — dict of all devices with visible metricshub.installation_id — the Venus OS installation identifierhub.connected — whether the MQTT connection is activehub.get_metric(unique_id) — look up a metric by its unique IDEach Victron service (solar charger, battery, inverter, etc.) becomes a Device with properties like name, model, manufacturer, and serial number.
device = hub.devices["solarcharger_288"]
print(device.name) # "SmartSolar MPPT 150|35"
print(device.device_type) # DeviceType.SOLAR_CHARGER
print(device.model) # "SmartSolar MPPT 150|35"
print(device.parent_device) # parent Device or None
Device hierarchy: Sub-devices (like SwitchableOutput channels) have a parent_device reference pointing to their parent. Top-level devices are parented to the system device (system_0).
Custom names: Once a device has reported a non-null custom name (including an empty string), you can write a new name:
if device.can_set_custom_name:
device.set_custom_name("House battery")
# device.set_custom_name("") # Clear the custom name
This also supports SwitchableOutput sub-devices, using their own
Settings/CustomName topic. Names are preserved exactly, without trimming.
device.custom_name and device.name update only when the device reports the
new value over MQTT; successful publishing does not confirm that it was applied.
can_set_custom_name is false in OperationMode.READ_ONLY, without an associated
hub, or before a custom name topic is discovered. It does not indicate connection
status. Unsupported writes raise ValueError, non-string names raise TypeError,
and transport failures propagate as NotConnectedError or PublishError.
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗