OpenWebNet developing..?

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

draghip
Posts: 19
Joined: Thursday 21 November 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Italy
Contact:

Re: OpenWebNet developing..?

Post by draghip »

Hi @spugna85,

thanks for looking into both issues!

F522 energy counters: I meant handling a counter reset correctly when it occurs, not sending a command from Domoticz to physically reset the device counters.

My preference would be to keep the total in Domoticz cumulative, preserving continuity in the consumption history without negative values or artificial spikes after a reset.

KW4691 setpoints: A global gateway setting would be sufficient for my installation: all four thermostats are KW4691, so I do not need per-thermostat configuration.

An optional dimension 7 mode, keeping the existing method as the default for compatibility with older installations, sounds good.

For completeness, my successful dimension 7 test was in heating/manual mode on zone 6, confirmed by both readback and the physical thermostat display. Cooling and automatic modes remain untested.

Thanks again for your help!
spugna85
Posts: 93
Joined: Tuesday 29 March 2016 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Italia
Contact:

Re: OpenWebNet developing..?

Post by spugna85 »

Hi @draghip,

I’ve opened a pull request with the changes for both issues.

I don’t have KW4691 thermostats or F522 actuators in my installation, so I haven’t been able to test the changes on real hardware. Could you try them on your system and let me know whether both the energy counters and the optional dimension 7 setpoint mode work as expected?

Thanks for your help with testing!
draghip
Posts: 19
Joined: Thursday 21 November 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Italy
Contact:

Re: OpenWebNet developing..?

Post by draghip »

Hi @spugna85,

thanks for implementing both changes!

I’m happy to test them with my F522 actuators and KW4691 thermostats. Could you share the PR link and the recommended way to obtain a test build?

I currently run Domoticz 2025.2, build 16818, using domoticz/domoticz:stable in Docker on a Raspberry Pi with IOTstack. I’d like to back up my installation and keep a way to restore the current version before testing.

I’ll check the F522 energy readings and the optional dimension 7 mode, confirming setpoint changes through both readback and the thermostat display.

Thanks again!
spugna85
Posts: 93
Joined: Tuesday 29 March 2016 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Italia
Contact:

Re: OpenWebNet developing..?

Post by spugna85 »

Hi @draghip,

Here’s the Domoticz pull request: https://github.com/domoticz/domoticz/pull/7187

The PR is still open, and the Linux build from CI is for x86-64.
For your Raspberry Pi, the simplest option is to wait until the changes are merged and included in an official ARM Docker beta build.
draghip
Posts: 19
Joined: Thursday 21 November 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Italy
Contact:

Re: OpenWebNet developing..?

Post by draghip »

Hi @spugna85,

thanks for the update.
I’m ready to test this on my hardware, but my production Domoticz runs in an ARM Docker container, while the available CI build is for x86-64.
Should I wait for an ARM build before testing the PR on my Raspberry Pi?
draghip
Posts: 19
Joined: Thursday 21 November 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Italy
Contact:

Re: OpenWebNet developing..?

Post by draghip »

Hi, I still have issues with the energy meters, I did some investigation with an AI agent and here is what he reported:

Following PR #7187, I installed the official ARM64 Docker beta. Some energy readings initially updated correctly, but two F522 meters supplying active loads now have frozen cumulative energy totals. Instantaneous power and device LastUpdate continue updating.

Environment

Domoticz V2026.4, build 18655-beta.
Docker image: domoticz/domoticz:2026-beta.18655.
Image source revision: 52457bd41.
MYHOMESERVER1 firmware 3.87.13.
Affected meters configured as From device.
The installation previously worked reliably with an F454 gateway. However, I do not have equivalent old protocol captures, and the Domoticz version has also changed, so this is not a controlled gateway comparison.

3 main issues identified:

1. Increasing counter rejected because reset metadata is zero

One affected F522 returns:


The raw counter increases, but Domoticz’s logical total remains frozen. No OpenWebNetTotalizer1 metadata is saved for this device.

The inspected ReadTotalizer() code rejects zero day/month values. Another F522 also returns an all-zero reset timestamp. These timestamps were already observed on November 23, so they did not first appear during the latest restart.

Is an all-zero reset timestamp expected for some devices or gateway configurations? Could the driver support unknown reset metadata while preserving existing totals and retaining counter-regression protection?

2. Possible timeout preventing fallback selection after restart

After a Domoticz restart, 15-minute energy polling continued for some devices, but monitor logs no longer showed automatic energy readings for several others. Power updates continued.

An independent authenticated OWNd probe returned:


The dimension-51 reply is an ACK, not a NACK, arriving after 1.357 seconds.

The inspected driver waits only one second for the initial 51 probe, clears source selection on startup, and requires a successful nonempty probe response before enabling fallback.

Hypothesis: a late ACK could leave fallback unselected for an individual device, despite that device answering 72#1 promptly. This might also explain why some devices work while others do not.

This timing was measured through OWNd, not captured from Domoticz’s own command session. Could you verify the hypothesis and consider a longer bounded response window?

3. Separate counter discrepancy and diagnostic intervention

Before the restart, one affected meter returned a lower but increasing raw counter with the same reset timestamp:


I have not deliberately reset the meter. The cause of this decrease is unknown.

For transparency: after verified backups, with Domoticz stopped, we changed only the saved raw reference to 3611813, preserving logical total 2852195, reset key, device Idx and history. Energy still did not advance after restart, including after the valid direct reading shown above.

Could you advise on these findings and a safe recovery procedure? I would prefer a maintainer-reviewed fix and an official ARM64 beta to test, without factory resets, counter resets or loss of history.

No custom Domoticz binary has been installed.

Thank you.
spugna85
Posts: 93
Joined: Tuesday 29 March 2016 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Italia
Contact:

Re: OpenWebNet developing..?

Post by spugna85 »

Hi,

thanks for the detailed investigation and for documenting the manual baseline adjustment.

I’ve prepared a follow-up fix for the first two findings:
- An all-zero reset timestamp is treated as unknown metadata, allowing increasing readings to advance the cumulative total while retaining counter-regression protection.
- The dimension-51 probe window is extended from one to three seconds to accommodate slower replies.
Regression tests pass, including an ACK arriving after 1.4 seconds and increasing readings with unknown reset metadata. These changes still need testing on your hardware.

Once the fix is reviewed, merged and available in an official ARM64 beta, please check whether both affected meters resume counting. The zero-timestamp rejection could explain why changing the saved raw reference did not restore updates. The original counter decrease remains unexplained, so let’s reassess it after testing these fixes.

The protocol frames appear to be missing from your post. Could you resend them in code blocks, including the readings before and after the decrease?

Thanks.
draghip
Posts: 19
Joined: Thursday 21 November 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Italy
Contact:

Re: OpenWebNet developing..?

Post by draghip »

Hi,

Thank you for preparing the fix and regression tests. I will wait for the reviewed changes to become available in an official ARM64 beta before testing.

Here are the protocol frames, with timestamps from the original captures.

1. Address 74: readings before and after the apparent counter decrease

Earlier reading:


Later readings, already below the saved reference:


The reset timestamp is unchanged. These are captures from before and after the apparent decrease, not a capture of the transition itself. The retained log window did not cover that transition.

The following is decoded database metadata, not a protocol frame. It was read on November 29 before the manual adjustment:


We do not have the original protocol frame corresponding to the saved raw value 3669988.

2. Independent authenticated probe of address 74

Elapsed times below were measured after sending each request through OWNd:


3. Address 75: unknown reset metadata and increasing readings

Earlier capture:


Later captures:


The later samples increase by 50 Wh, but they are also lower than the November 23 reading. Thus, the saved captures show an unexplained raw-counter decrease on address 75 as well. Again, we did not capture the transition or deliberately reset either meter.

One clarification: the manual baseline adjustment concerned address 74, whose reset timestamp was valid. The all-zero timestamp rejection concerns address 75. After the adjustment and restart, address 74’s saved reference and logical total remained unchanged, including after the direct probe above.

No custom binary has been installed. Please let me know which official ARM64 beta includes the fixes; I will then check that both logical totals and recorded energy samples advance, not just power or LastUpdate.

Thank you.
draghip
Posts: 19
Joined: Thursday 21 November 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Italy
Contact:

Re: OpenWebNet developing..?

Post by draghip »

Sorry,

I just realized the copy paste was incomplete in both messages....

Here the correct one:

Hi,

Thank you for preparing the fix and regression tests. I will wait for the reviewed changes to become available in an official ARM64 beta before testing.

Here are the protocol frames, with timestamps from the original captures.

1. Address 74: readings before and after the apparent counter decrease

Earlier reading:

Code: Select all

2026-11-23 22:52:40.739
*#18*74#0*72#1*3656486*25*4*2023*0*47##
Later readings, already below the saved reference:

Code: Select all

2026-11-29 02:19:11.450
*#18*74#0*72#1*3609721*25*4*2023*0*47##

2026-11-29 19:06:11.800
*#18*74#0*72#1*3611776*25*4*2023*0*47##
The reset timestamp is unchanged. These are captures from before and after the apparent decrease, not a capture of the transition itself. The retained log window did not cover that transition.

The following is decoded database metadata, not a protocol frame. It was read on November 29 before the manual adjustment:

Code: Select all

OpenWebNetEnergySource = 72#1
OpenWebNetTotalizer1 = 3669988|2852195|1212078287
We do not have the original protocol frame corresponding to the saved raw value 3669988.

2. Independent authenticated probe of address 74

Elapsed times below were measured after sending each request through OWNd:

Code: Select all

TX *#18*74#0*51##
RX +1.357s *#*1##

TX *#18*74#0*72#1##
RX +0.358s *#18*74#0*72#1*3612262*25*4*2023*0*47##
RX +0.399s *#*1##
3. Address 75: unknown reset metadata and increasing readings

Earlier capture:

Code: Select all

2026-11-23 22:52:41.773
*#18*75#0*72#1*5364956*0*0*0*0*0##
Later captures:

Code: Select all

2026-11-29 20:52:45.643
*#18*75#0*72#1*5322256*0*0*0*0*0##

2026-11-29 21:07:48.322
*#18*75#0*72#1*5322306*0*0*0*0*0##
The later samples increase by 50 Wh, but they are also lower than the November 23 reading. Thus, the saved captures show an unexplained raw-counter decrease on address 75 as well. Again, we did not capture the transition or deliberately reset either meter.

One clarification: the manual baseline adjustment concerned address 74, whose reset timestamp was valid. The all-zero timestamp rejection concerns address 75. After the adjustment and restart, address 74's saved reference and logical total remained unchanged, including after the direct probe above.

No custom binary has been installed. Please let me know which official ARM64 beta includes the fixes; I will then check that both logical totals and recorded energy samples advance, not just power or LastUpdate.

Thank you.
Post Reply