Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fehlerhaft Math.round Funktion #42

Closed
Lollo79 opened this issue Apr 20, 2021 · 5 comments
Closed

Fehlerhaft Math.round Funktion #42

Lollo79 opened this issue Apr 20, 2021 · 5 comments

Comments

@Lollo79
Copy link

Lollo79 commented Apr 20, 2021

Kann im Code der main.js die Schrittweite die in der Bedienungsanleitung steht angepasst werden?
Hier wird die Math.round Funktion mit *2 ) /2 gemacht, für die Schrittweite von 0,5 wäre aber *10)/10 angebrachter.

Auszug Bedienungsanleitung ISM8:
IDs Datenpunkt Einheit Wertebereich Schrittweite
65 / 78 / 91 / 104 Sollwertkorrektur K -4K - +4K 0,5K
66 / 79 / 92 / 105 Sparfaktor K 0K - 10K 0,5K

Codeauszug:
} else if (type === 'DPT_Tempd' && name === 'Sollwertkorrektur') {
val = Math.round(data * 2) / 2;
if (val > 4) {
val = 4
}
if (val < -4) {
val = 4
}
return [enc.encodeDPT9(data), val];
} else if (type === 'DPT_Tempd' && name === 'Sparfaktor') {
val = Math.round(data * 2) / 2;
if (val > 10) {
val = 10
}
if (val < 0) {
val = 0
}
return [enc.encodeDPT9(data), val];

Danke und MfG Silvio

@schweigel
Copy link
Contributor

schweigel commented Apr 21, 2021

Hallo,

*2/2 passt, damit wird 0,5 als Schrittweite erreicht. Mit *10/10 würde man die Schrittweite 0,1 erreichen, welche aber nicht der Definition entspricht.

Grüße Matthias

@Lollo79
Copy link
Author

Lollo79 commented Apr 22, 2021

Nochmal Hallo,

Habe durch eigenrecherche herausgefunden das dies richtig ist, also Sorry für das "angebrachter".

Aber mal zum eigentlichen Problem, Ich nutze die Sollwertkorrektur automatisiert um auf starke Temperaturstürze oder auch anstiege zu reagieren, jedoch funktionieren nur ganze Schritte um 1 bei Schritten um 0,5 kommt ein sehr großes Durcheinander zustande das z.B. der Heizkreis plötzlich auf -4 & der Mischerkreis seltsamerweise auf 0,4 steht was ja eigentlich nicht sein darf.

Grüße Silvio

@Lollo79
Copy link
Author

Lollo79 commented May 4, 2021

Neue Erkenntnisse zu dem Thema im IoBroker Forum gefunden. https://forum.iobroker.net/topic/31440/wolf-adapter-sollwertkorrektur-in-0-5er-schritten?_=1619967470092

@stale
Copy link

stale bot commented Sep 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.
Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

@stale stale bot added the wontfix label Sep 3, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions.
Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, Logs und Reproduktionsschritte enthalten sind. Vielen Dank für Eure Unterstützung.

@stale stale bot closed this as completed Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants