Closed erikhubers closed 1 year ago
Hey Erik
Always nice to hear that someone is using my code :) Thanks for letting me know.
I have not tested all options of my release, but my intend was that what you want, a higher sample rate is already implemented.
My intend was that you adapt dmsr50.py If you would set the MAXRATE field of a measurement to eg 3600 for the entries which need a high sample rate, you would get every second a sample (assuming that the DSMR meter will actually generate every second a sample).
My intention was that you can specify this per measurement, eg it is useless to do high frequency for kWh measurement, as that is a cumulative number; while for W measurement, it can be very useful. I am storing all my measurements in a influx database; to reduce disk space by reducing sample frequency where it high frequency is not required.
I think you have made the sample frequency for all measurements equal, while I made it configurable per measurement in dsmr50.py.
Have you tried this?
Thanks Hans
On Mon, Nov 14, 2022 at 5:07 PM Erik @.***> wrote:
Hey there,
Thank you for this amazing tool! I bought myself a P1 cable yesterday to integrate my energy usage into HomeAssistant. I'm investigating my energy usage at the moment and needed a higher sample rate than once per minute (10s) in order to have a 'live' view of the current power usage to find some devices that draw a lot of power.
I created a fork with a (quick & dirty) way to set the sample rate in the config.py.
If you like this small addition you could merge this PR, if not you can just decline this and I'll keep using my fork :). PR feedback is fine too if I need to improve on some stuff before approval.
You can view, comment on, or merge this pull request online at:
https://github.com/hansij66/dsmr2mqtt/pull/2 Commit Summary
- ec18ebd https://github.com/hansij66/dsmr2mqtt/pull/2/commits/ec18ebd49f28e269c03a220f64a5336e44dd6b39 Add ability to customize dsmr/el, dsmr/gas measurement rate in config.
- 85b266c https://github.com/hansij66/dsmr2mqtt/pull/2/commits/85b266c11eef71569d1db7feba786cbf11c035ac Allow publishing if mintimeinterval equals timeelapsed.
File Changes
(3 files https://github.com/hansij66/dsmr2mqtt/pull/2/files)
- M P1_parser.py https://github.com/hansij66/dsmr2mqtt/pull/2/files#diff-cbd91b4196de37f9bb75bdbd43e4a11461756505e39c1f519ccb2de42cada04f (13)
- M config.rename.py https://github.com/hansij66/dsmr2mqtt/pull/2/files#diff-e6d6b610f600ec093c09a324532f558a56e1eb7edfbc44aea9616cfa9d74feca (7)
- M dsmr50.py https://github.com/hansij66/dsmr2mqtt/pull/2/files#diff-12a3022373cda75ba0103cd5bbabe13cac0799be39fbe40d7a1ebba5085cd8b1 (33)
Patch Links:
- https://github.com/hansij66/dsmr2mqtt/pull/2.patch
- https://github.com/hansij66/dsmr2mqtt/pull/2.diff
— Reply to this email directly, view it on GitHub https://github.com/hansij66/dsmr2mqtt/pull/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFFPZDZI2KN5UX5EI2XAQPTWIJPV5ANCNFSM6AAAAAAR77QU7A . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hey Hans,
Thank you for your explanation. I wasn't really interpreting this as a configuration file. With your explanation of the intended use of the dmsr50.py
file this now makes a lot of sense and makes this PR a bit silly. Your approach makes a lot more sense.
I think I'll just populate the sample rates in the dmsr50.py
file directly, I'll just have to tweak my Ansible deployment a bit.
Thank you for taking the time to respond.
Kind regards,
Erik
Hi Erik, I will see if I can enhance the readme a bit better.
On Mon, Nov 14, 2022 at 9:41 PM Erik @.***> wrote:
Hey Hans,
Thank you for your explanation. I wasn't really interpreting this as a configuration file. With your explanation of the intended use of the dmsr50.py file this now makes a lot of sense and makes this PR a bit silly. Your approach makes a lot more sense.
I think I'll just populate the sample rates in the dmsr50.py file directly, I'll just have to tweak my Ansible deployment a bit.
Thank you for taking the time to respond.
Kind regards,
Erik
— Reply to this email directly, view it on GitHub https://github.com/hansij66/dsmr2mqtt/pull/2#issuecomment-1314353761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFFPZD6HZRBN2NDTTZ6QCLDWIKPX5ANCNFSM6AAAAAAR77QU7A . You are receiving this because you commented.Message ID: @.***>
Hey there,
Thank you for this amazing tool! I bought myself a P1 cable yesterday to integrate my energy usage into HomeAssistant. I'm investigating my energy usage at the moment and needed a higher sample rate than once per minute (10s) in order to have a 'live' view of the current power usage to find some devices that draw a lot of power.
I created a fork with a (quick & dirty) way to set the sample rate in the config.py.
If you like this small addition you could merge this PR, if not you can just decline this and I'll keep using my fork :). PR feedback is fine too if I need to improve on some stuff before approval.