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

Fix for superfluous sensor reading #3

Merged
merged 1 commit into from Nov 18, 2020

Conversation

ronaldvdmeer
Copy link
Owner

As mentioned by Tim (#2) the script retrieves all results while only a few are needed. Because I don't have the multical402 I would like to ask @tvwerkhoven if he could test this pull request.

@ronaldvdmeer ronaldvdmeer linked an issue Nov 16, 2020 that may be closed by this pull request
@tvwerkhoven
Copy link

@ronaldvdmeer this works up to line 335, I don't have Domoticz running so I can't test the rest.

Note that this still over-queries the meter in case you want to run multiple operations on the same index, e.g. the example command queries the meter 3x. Perhaps you could cache the values for all indices the users wants, and then run the Domoticz operations.

Command:

/usr/bin/python3 ./multical402-4-domoticz.py /dev/ttyUSB0 327:60:2:323,322:60:1:323,323:60:0

Output:

=======================================================================================
Kamstrup Multical 402 serial optical data received: 2020-11-18 20:02:41
Meter vendor/type: Kamstrup M402
---------------------------------------------------------------------------------------
Heat Energy (E1)          13.37 Gj
Heat Energy (E1)          13.37 Gj
Heat Energy (E1)          13.37 Gj

@ronaldvdmeer
Copy link
Owner Author

Thank you for testing this. The rest of the code was not modified so the domoticz part should still work.

On your suggestion to create a caching system to limit the IR-readouts even more I must admit I don’t feel like investing the time into something which I can not test - and no longer use - it myself.

Feel free however to fork the repository and make any adjustment you like.

@ronaldvdmeer ronaldvdmeer merged commit 8926948 into master Nov 18, 2020
@ronaldvdmeer ronaldvdmeer deleted the superfluous-sensor-reading-fix branch Nov 18, 2020
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.

Superfluous sensor reading
2 participants