logo elektroda
logo elektroda
X
logo elektroda

MQTT Command EnergyCntReset is NOT resetting energycounter_today

markusb68 81 3
ADVERTISEMENT
  • #1 21801648
    markusb68
    Level 3  
    I have published an MQTT Topic: cmnd/obkSocket/EnergyCntReset (value 0).
    It resets all energy counter values but NOT obkSocket/energycounter_today. This topic still keeps its old values:

    MQTT Command EnergyCntReset is NOT resetting energycounter_today
  • ADVERTISEMENT
  • #2 21802131
    p.kaczmarek2
    Moderator Smart Home
    I've checked with self test:
    Screenshot of Visual Studio showing energy counter reset test in C code
    It seems you're using EnergyCntReset incorrectly. You should invoke it without any arguments. I am not the author of this command, but I think so...

    It indeed does not work as you expect if you use 0 as argument.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21802173
    markusb68
    Level 3  
    Hello,
    Thanks.

    It worked, but with an empty payload and QoS = 2 - otherwise the topic gets deleted on the broker.

    May I suggest that the author of this command will have a look into it and fix it, so it works when sending a 0 as value.
  • #4 21802235
    p.kaczmarek2
    Moderator Smart Home
    I think the intention of author is to allow extra argument which, if set, is used to set the energy counter to.
    So, in a nutshell:
    - without argument, it resets all counters
    - with argument, it sets total consumption to given value
    It's probably not a bug, but a behaviour per design.
    Helpful post? Buy me a coffee.
ADVERTISEMENT