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

gas meter entity not showing in the energy config wizard gas source drop down #9900

Closed
3 tasks done
apaperclip opened this issue Aug 28, 2021 · 3 comments
Closed
3 tasks done
Labels
Bug Current Bug in UI - Extra Attention

Comments

@apaperclip
Copy link

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

2021.9.0b3. My gas meter is not in the drop list for gas meter sources in the energy wizard.
The text above the drop down only lists the m³ unit. In the US ft³ is a common unit for gas and water.

Describe the behavior you expected

When my entity unit was ft³ the meter entity did not show. I changed the unit to m³ it still did not show.

Steps to reproduce the issue

  1. configure a mqtt entity like so. This meter is a counter, the new total value is transmitted each time usage increases. (e.g. 100, then 103, then 104)
sensor:
  - platform: mqtt
    name: "gas_meter2"
    state_topic: "metermon/61223112"
    unit_of_measurement: 'm³'
    unique_id: '61223112'
    # force_update: true
    value_template: "{{ value_json.Consumption }}"
    availability_topic: "metermon/status"
    payload_available: "Online"
    payload_not_available: "Offline"
    device_class: gas
    state_class: total_increasing
  1. Wait for data to come and after 12 past the hour.
  2. The entity will not show up in the drop down for adding an energy source

What version of Home Assistant Core has the issue?

2021.9.0b3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Google Chrome 93.0.4577.60 (Official Build) beta (64-bit) and Edge 92

Which operating system are you using to run this browser?

Chrome OS and Windows 10

State of relevant entities

state_class: total_increasing
unit_of_measurement: m³
friendly_name: gas_meter2
device_class: gas

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

According to https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics ft³ is also a valid unit. Since the add source screen mentioned m³ specifically, I changed to it to test but it did not help. Will ft³ be supported? it is the unit we use in the US.

While troubleshooting I was looking at the statistics graphs and statistics table in the database. The stats graph is using sum and the values where much larger than the actual entity value. In the database I saw this

380|2021-08-28 12:12:00.193783|42|2021-08-28 11:00:00.000000|||||500016.0|0.0
420|2021-08-28 13:12:00.190122|42|2021-08-28 12:00:00.000000|||||500018.0|500018.0
460|2021-08-28 14:12:00.187845|42|2021-08-28 13:00:00.000000|||||500018.0|18157987.0140006
502|2021-08-28 15:12:00.196027|42|2021-08-28 14:00:00.000000|||||500018.0|641743277.342359
544|2021-08-28 16:12:00.210846|42|2021-08-28 15:00:00.000000|||||500018.0|22663449964.3111
587|2021-08-28 17:12:00.232149|42|2021-08-28 16:00:00.000000|||||500020.0|800352681781.772
629|2021-08-28 18:12:00.231860|42|2021-08-28 17:00:00.000000|||||500020.0|28264188699594.5

The far right column does not look right for how this data is transmitted to HA.

@piltous
Copy link

piltous commented Sep 5, 2021

Try this, worked for me:
name: "Gas Consumed"
unit_of_measurement: 'm³

@jaharkes
Copy link

jaharkes commented Sep 5, 2021

The cubic feet isn't really the issue here because it gets automatically converted to cubic meters when stored as a long term statistic. One problem is that the long-term stats calculation is broken when the homeassistant.unit_system in the configuration is set for imperial instead of metric (home-assistant/core#55629).

You can set your system to metric and the statistics will start getting calculated correctly, you might have to delete the old entries from the statistics table. It takes about 2-3 hours for enough statistics to be collected before it becomes possible to pick the gas sensor it seems, at least it didn't show up right away for me.

Cost calculcation for gas still isn't working for me, I think it doesn't like the underlying sensor being in cubic feet and just adds 0 whenever it logs a new cost datapoint.

@bramkragten
Copy link
Member

This is not a frontend issue, and an issue on the core repo seems to exist already, closing this.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Current Bug in UI - Extra Attention
Projects
None yet
Development

No branches or pull requests

4 participants