INA3221 (I2C) sensors stop updating while others (SHT4x) remain functional / Telemetry interval not honored?

Open
#161 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 11 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
12/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
embedded-iot

Research direction

Start in custom_components/meshcore/telemetry_sensor.py: _handle_telemetry_event (around line 239) calls update_from_telemetry, which calls async_write_ha_state (around line 546) on entities that have no hass set. Check where those entities are created and added, and why the configured 1800s telemetry interval is not applied to the INA3221 channels. Reproducing needs an INA3221 sensor on a repeater, so the first step is confirming the traceback in the logs.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
I am experiencing an issue where telemetry data for specific sensors, particularly the INA3221 (I2C) current channels (2, 3, and 4) on repeater NL-APD-Hoeve (ID: 741361), stop updating in Home Assistant after approximately 1 to 3 hours. Interestingly, my other I2C sensor on the same node (an SHT4x temperature/humidity sensor) continues to work fine.

Data flow for the INA3221 only resumes after a full reload of the meshcore-ha integration.

Additionally, the configured Telemetry interval (set to 1800s in the UI) is not being honored for the INA3221. Despite this setting, the CSV logs show data arriving at extremely high frequencies (sometimes sub-second intervals), which eventually seems to lead to a crash or freeze of these specific entities.

Log Analysis
When the sensors freeze, the following errors repeat in the logs:

RuntimeError: Attribute hass is None for at telemetry_sensor.py:546.

Coordinator Warning: Error requesting status from repeater NL-APD-Hoeve: None.

Data Observation (based on attached CSV)

Interval Mismatch: The Telemetry interval of 1800s is ignored by the INA3221 module; data bursts are seen at very high rates.
Selective Failure: While the INA3221 channels (especially Ch 2, 3, 4) stop, system sensors and the SHT4x sensor often remain active or recover more easily.

Environment

Home Assistant: 2026.x
Python Version: 3.14

Integration: meshcore-ha / meshcore_py

Additional Context
It appears the INA3221 module might be operating on a hardware-loop that ignores the global telemetry interval, potentially causing a buffer overflow or "orphaned" entities in the HA coordinator (hass is None). The fact that the SHT4x (also I2C) keeps working suggests this is specific to the INA implementation or the volume of data it generates?

Image

history sensors.csv

logs:
`Logger: meshcore
Source: /usr/local/lib/python3.14/site-packages/meshcore/events.py:219
First occurred: March 16, 2026 at 19:04:42 (78 occurrences)
Last logged: 12:32:03

Error in event handler for EventType.TELEMETRY_RESPONSE: Attribute hass is None for
Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/meshcore/events.py", line 213, in _execute_callback
await callback(event)
File "/config/custom_components/meshcore/telemetry_sensor.py", line 239, in _handle_telemetry_event
sensor.update_from_telemetry(lpp_data)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/config/custom_components/meshcore/telemetry_sensor.py", line 546, in update_from_telemetry
self.async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in async_write_ha_state
self._async_verify_state_writable()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 979, in _async_verify_state_writable
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for `

Dominant language
Python
Stars
269
Forks
58
Avg merge
10d 17h
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from meshcore-dev/meshcore-ha

All issues in meshcore-dev/meshcore-ha

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.