Skip to content

device_info crashes (AttributeError) when miner returns psu_info: null — all entities fail to load #9

Description

@AcesHigh70

Version: v1.0.0 · HA: 2026.5.1 · Miner: Antminer S19j/S19k Pro on Braiins OS+

After the miners were offline overnight and came back, the integration reconnects but no entities load — all sensors read unavailable. Log:

File ".../braiins_os_plus/sensor.py", line 96, in device_info
hw_version=data.get("psu_info", {}).get("model_name"),
AttributeError: 'NoneType' object has no attribute 'get'
→ Error adding entity None for domain sensor with platform braiins_os_plus

Root cause: the miner's details payload contains "psu_info": null. data.get("psu_info", {}) returns None (the {} default only applies when the key is absent, not when its value is null), so .get("model_name") raises. Because device_info raises, every entity fails to add. bos_version (line 95) has the same latent issue.

Likely the same underlying cause as closed issue #8.

Fix: guard both with (data.get(key) or {}).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions