Skip to content

Fix #2461: Funktionsplan: Verhalten von STATE_OUT bei Analogwert - #2464

Merged
GermanBluefox merged 1 commit into
masterfrom
fix/issue-2461-mwfmx7rq
Nov 15, 2026
Merged

GermanBluefox merged 1 commit into
masterfrom
fix/issue-2461-mwfmx7rq

Conversation

@GermanBluefox

Copy link
Copy Markdown
Contributor

Function block diagrams compared the value a STATE_OUT wrote with the value the state holds exactly. Adapters like esphome store numbers as float32, so a written 11.768 comes back as 11.76799964904785. The online view then showed a deviation although both values look the same, and with "Write the value back" the diagram would correct the state again and again and finally report it as contested. sameValue() now treats two numbers within a relative tolerance of 1e-6 (NUMBER_TOLERANCE) as equal, also when one of them is a string or a boolean. The exact comparisons that decide whether a new value has to be written are unchanged. Tests cover the float32 case for the deviation display and for enforced outputs. Fixes #2461.

Fixes #2461

Function block diagrams compared the value a STATE_OUT wrote with the value the state holds exactly. Adapters like esphome store numbers as float32, so a written 11.768 comes back as 11.76799964904785. The online view then showed a deviation although both values look the same, and with "Write the value back" the diagram would correct the state again and again and finally report it as contested. `sameValue()` now treats two numbers within a relative tolerance of 1e-6 (`NUMBER_TOLERANCE`) as equal, also when one of them is a string or a boolean. The exact comparisons that decide whether a new value has to be written are unchanged. Tests cover the float32 case for the deviation display and for enforced outputs. Fixes #2461.

Fixes #2461
@GermanBluefox
GermanBluefox merged commit 355eee8 into master Nov 15, 2026
16 checks passed
@GermanBluefox
GermanBluefox deleted the fix/issue-2461-mwfmx7rq branch November 15, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Funktionsplan: Verhalten von STATE_OUT bei Analogwert

1 participant