Skip to content

Total System Power demand values ignored when negative (Solar Export) #144

@SEWADE

Description

@SEWADE

System Health details

System Information

version core-2026.1.3
installation_type Home Assistant OS
dev false
hassio true
docker true
container_arch amd64
user root
virtualenv false
python_version 3.13.11
os_name Linux
os_version 6.12.63-haos
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.5
Stage running
Available Repositories 2642
Downloaded Repositories 30
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 17.0
update_channel stable
supervisor_version supervisor-2026.01.1
agent_version 1.8.1
docker_version 29.1.3
disk_total 48.5 GB
disk_used 30.4 GB
nameservers fdfa:c9ca:abd7:0:be24:11ff:fef2:93c6, 192.168.0.1, 192.168.0.2
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization kvm
board ova
supervisor_api ok
version_api ok
installed_addons File editor (5.8.0), Terminal & SSH (9.22.0), Mosquitto broker (6.5.2), MQTT Explorer (browser-1.0.3), Studio Code Server (6.0.1), Matter Server (8.2.0), Home-Assistant-Matter-Hub (3.0.4), Zigbee2MQTT Proxy (0.3.0), CEC Scanner (3.0), go2rtc (1.9.11), Music Assistant (2.7.5), YT Music PO Token Generator (1.2.2), ESPHome Device Builder (2026.1.2)
Dashboards
dashboards 4
resources 13
views 3
mode storage
Network Configuration
adapters lo (disabled), enp0s19 (enabled, default, auto), docker0 (disabled), hassio (disabled), veth1ec47fa (disabled), veth08344e8 (disabled), veth392e8c2 (disabled), veth6f77a5e (disabled), vethf7d2000 (disabled), veth9313a0f (disabled), vethbfc872f (disabled), veth3defdeb (disabled), veth9763368 (disabled), vethb3c5bee (disabled), vethaaede91 (disabled), veth97edf7b (disabled), veth7e18549 (disabled)
ipv4_addresses lo (127.0.0.1/8), enp0s19 (192.168.0.21/22), docker0 (172.30.232.1/23), hassio (172.30.32.1/23), veth1ec47fa (), veth08344e8 (), veth392e8c2 (), veth6f77a5e (), vethf7d2000 (), veth9313a0f (), vethbfc872f (), veth3defdeb (), veth9763368 (), vethb3c5bee (), vethaaede91 (), veth97edf7b (), veth7e18549 ()
ipv6_addresses lo (::1/128), enp0s19 (2003:e6:5f30:8d00:3f38:6f70:5ca3:17cd/64, fdfa:c9ca:abd7:0:5f82:5f13:5b8c:19e6/64, fe80::d3ac:afa7:4628:b9db/64), docker0 (fe80::e0a5:7fff:fe8f:624c/64), hassio (fe80::cc77:adff:fe94:723c/64), veth1ec47fa (fe80::c06c:eeff:fe5c:ed08/64), veth08344e8 (fe80::ec06:a7ff:fe6a:e97b/64), veth392e8c2 (fe80::1cd5:c7ff:fefe:47a0/64), veth6f77a5e (fe80::78cc:14ff:fe1f:e79e/64), vethf7d2000 (fe80::b83e:84ff:fe74:6b23/64), veth9313a0f (fe80::a82c:8fff:fe2a:9f60/64), vethbfc872f (fe80::44f2:29ff:fe45:96d7/64), veth3defdeb (fe80::f448:eaff:fecf:a38c/64), veth9763368 (fe80::a40c:e3ff:fedb:91ab/64), vethb3c5bee (fe80::3c1e:60ff:fef8:bc34/64), vethaaede91 (fe80::fc0c:72ff:fe6f:a63/64), veth97edf7b (fe80::90e4:a5ff:fed3:c0eb/64), veth7e18549 (fe80::4824:52ff:fe8a:948a/64)
announce_addresses 192.168.0.21, 2003:e6:5f30:8d00:3f38:6f70:5ca3:17cd, fdfa:c9ca:abd7:0:5f82:5f13:5b8c:19e6, fe80::d3ac:afa7:4628:b9db
Recorder
oldest_recorder_run 29. September 2025 um 11:30
current_recorder_run 26. Januar 2026 um 18:43
estimated_db_size 16713.67 MiB
database_engine sqlite
database_version 3.49.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The integration incorrectly ignores values for the sensor Total System Power demand when they are negative. This happens during solar export periods. It seems the integration treats this sensor as a monotonic counter (total_increasing) rather than a measurement that can be negative.

Reproduction steps

  1. Use the modbus_local_gateway with a device that reports negative power during grid export.
  2. Observe the Home Assistant logs during a period of high solar production/low consumption.
  3. The sensor value in Home Assistant stops updating and the log shows "Ignoring device value".

Debug logs

Logger: custom_components.modbus_local_gateway.sensor
Source: custom_components/modbus_local_gateway/sensor.py:154
Integration: Modbus Local Gateway

Ignoring device value with Total System Power demand as -520.1522216796875 - never resets -516.4185791015625
Ignoring device value with Total System Power demand as -523.7283325195312 - never resets -520.1522216796875


New finding: The Home Assistant recorder also throws an error confirming that the entity sensor.eastron_total_system_power_demand is incorrectly assigned the state class total_increasing:

Entity [...] has state class total_increasing, but its state is negative (-41.7).

This sensor represents "Power" (W), not "Energy" (kWh). It should be changed to state_class: measurement and device_class: power to allow negative values during export.

Diagnostics dump

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions