Skip to content

Prometheus Units for Sonoff S31 are Incorrect for Daily and Total Power #19538

Closed
@subtlepseudonym

Description

@subtlepseudonym

PROBLEM DESCRIPTION

A clear and concise description of what the problem is.
The prometheus metrics energy_power_kilowatts_daily and energy_power_kilowatts_total report the number of kilowatt hours on the Sonoff S31 rather than kilowatts, as implied by the metric name.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Searched the problem in issues
    Searched the problem in discussions
    Searched the problem in the docs
    Searched the problem in the chat
    Device used (e.g., Sonoff Basic): Sonoff S31
  • Tasmota binary firmware version number used: 12.1.1
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: Tasmotizer
    Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:
19:57:02.435 RSL: RESULT = {"NAME":"Generic","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18}
19:57:02.659 RSL: RESULT = {"Module":{"41":"Sonoff S31"}}
19:57:02.875 RSL: RESULT = {"GPIO0":{"32":"Button1"},"GPIO1":{"3072":"CSE7766 Tx"},"GPIO2":{"0":"None"},"GPIO3":{"3104":"CSE7766 Rx"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"224":"Relay1"},"GPIO13":{"320":"Led_i1"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:

  • Provide the output of this command: Status 0:
 
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:

TO REPRODUCE

Steps to reproduce the behavior:
Enable prometheus metrics during compilation and visit the /metrics endpoint.

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.
The metric names should match the units of the reported values. These metrics, on the S31, should be named energy_power_kilowatt_hours_daily and energy_power_kilowatt_hours_total.

I haven't looked into any other power monitoring devices that report these metrics. Assuming that other devices are reporting kilowatts rather than kilowatt hours, the best approach is likely to add two new metrics with the proposed names.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

Activity

subtlepseudonym

subtlepseudonym commented on Sep 17, 2023

@subtlepseudonym
Author

This issue can be fixed on the prometheus side with metric relabeling, so this issue is a relatively high effort change for low reward, but I figured it was worth documenting.

Jason2866

Jason2866 commented on Sep 24, 2023

@Jason2866
Collaborator

@subtlepseudonym Would you add to the Documentation? It is Open Source too. Just klick the sheet with the pencil in the upper right corner.

subtlepseudonym

subtlepseudonym commented on Sep 24, 2023

@subtlepseudonym
Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @subtlepseudonym@Jason2866

        Issue actions

          Prometheus Units for Sonoff S31 are Incorrect for Daily and Total Power · Issue #19538 · arendst/Tasmota