evcc icon indicating copy to clipboard operation
evcc copied to clipboard

opendtu: jq: empty result

Open derNachtflieger opened this issue 3 months ago • 2 comments

Describe the bug

After update to version 0.314.5 the "error jq: empty result" for the openDTU device.

  1. in the error log, after each polling intervall (see log file)
  2. in config page for test configuration:
Image

OpenDTU and evcc container was rebooted a couple of times. In log, the json data from openDTU is received correctly.

Steps to reproduce

On every start after the first polling data.

Configuration details

root@evcc:~# evcc dump --cfg
[main  ] INFO 2026/08/28 20:34:33 config file not found, database-only mode
[main  ] FATAL 2026/08/28 20:34:33 
Found systemd service database at "/var/lib/evcc/evcc.db", evcc has been invoked with no explicit database path.
Running the same config with multiple databases can lead to expiring vehicle tokens.

If you want to use the existing service database run the following command:

evcc --database /var/lib/evcc/evcc.db

If you want to create a new user-space database run the following command:

evcc --database ~/.evcc/evcc.db

If you know what you're doing, you can skip the database check with the --ignore-db flag.

Log details

[db:2-openDTU] TRACE 2026/08/28 20:22:45 GET http://192.168.1.73/api/livedata/status
[db:2-openDTU] TRACE 2026/08/28 20:22:45 {"inverters":[{"serial":"123","name":"Umrichter 1","order":0,"data_age":4,"poll_enabled":true,"reachable":true,"producing":true,"limit_relative":53.29999924,"limit_absolute":799.5}],"total":{"Power":{"v":2.5,"u":"W","d":1},"YieldDay":{"v":2303,"u":"Wh","d":0},"YieldTotal":{"v":3572.529053,"u":"kWh","d":3}},"hints":{"time_sync":false,"radio_problem":false,"default_password":false}}
[site ] ERROR 2026/08/28 20:22:45 pv 1 energy: jq: empty result

What type of operating system or environment does evcc run on?

Linux

External automation

  • [x] I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.

Nightly build

  • [x] I have verified that the issue is reproducible with the latest nightly build

Version

evcc version 0.314.5

derNachtflieger avatar Aug 28 '26 18:08 derNachtflieger

Root cause found in templates/definition/meter/hoymiles-opendtu.yaml. The energy jq filter is:

jq: 'if all(.inverters[]; .radio_stats.rssi > -127) then .total.YieldTotal.v else empty end'

This was added in #31170 to avoid reporting a partial YieldTotal sum while OpenDTU is still reconnecting to all inverters after a restart (fixing #30154), by requiring every inverter to report a valid radio_stats.rssi.

The log you posted shows the actual /api/livedata/status response for your inverter has no radio_stats key at all:

{"serial":"123","name":"Umrichter 1","order":0,"data_age":4,"poll_enabled":true,"reachable":true,"producing":true,"limit_relative":53.29999924,"limit_absolute":799.5}

Since .radio_stats.rssi resolves to null for your inverter, null > -127 is false in jq, so all(...) is always false and the filter always takes the else empty end branch — hence jq: empty result on every poll, not just during reconnects. This exact risk (missing radio_stats) was actually flagged by an automated reviewer on #31170 at the time but wasn't addressed before merge.

This does look like a genuine bug in the template, but a correct fix needs care: simply dropping the radio_stats.rssi check (e.g. falling back to .reachable) risks reintroducing the partial-sum issue from #30154, so I'm not opening an automated fix for it.

To help narrow this down, could you share:

  • your OpenDTU firmware version and inverter model
  • whether radio_stats ever appears for this inverter (e.g. right after a fresh OpenDTU boot vs. later), or if it's always absent

cc @D4Ci0

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 28 '26 18:08 github-actions[bot]

Thank you for fixing the issue.

derNachtflieger avatar Aug 29 '26 11:08 derNachtflieger