-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
add energy_meter component: energy usage per job #733
Conversation
Within this commit the energy_meter module was added. It allows the measuring of an energy delta between two setpoints (start/end). Signed-off-by: Sandro Pischinger <[email protected]>
If the energy_meter component is available, a measurement is started everytime a job is started. When the job is done, the measurement delta is saved to the print stats. Signed-off-by: Sandro Pischinger <[email protected]>
Expose getter for the sensor component so that a direct access on the `sensors` attribute is not needed. Use get_last_value for a sensor to get only latest value instead of all measurements. Signed-off-by: Sandro Pischinger <[email protected]>
Awesome! Works flawless using generic power meter, example config:
|
Thanks for testing @kondas ! I think for now this is ready for review. I was thinking about an edgecase where moonraker restarts and the state of energy_meter is lost - but in this case we might have a gap in measurement anyways and it kinda makes sense for the measurement reporting to 'fail'. |
Bumping this, because i'd really like to see this feature merged |
This looks fantastic, exactly what I was looking for. Thank you for doing the coding so I don't have to :) |
@Arksine can I improve anything in this PR in order to get this merged? Thank you |
Sorry for the delay, when I sit down to write feedback for this PR something always seems to pull me away. The short of it is there are some blockers that prevent this from being merged for the time being. I think this feature is useful so I'll work to help get it added.
I need to resolve the As for the |
I know it was a long time coming, but I finally found some time to complete support for adding auxiliary fields to the The documentation explains how to configure one or more "history fields" for a sensor. In addition, a sample that should work with tasmota devices is provided. |
Since support for this is now available I will close this PR. Thanks. |
fixes #445
This adds a new component
energy_meter
which is used for starting and stopping a energy measurement. For the actual data, a sensor is to be specified in the config section. Thehistory
component collects print stats already for jobs, I added the energy measuring there: On print start, the current value from the sensor's energy counter is saved. When the print stops, this saved value then gets subtracted from the most recent sensor value and voila, we get the energy used for the print.Here's a sample configuration used for a ShellyPlus1PM: