StreamLabs (water sensor) integration -- Statistic for Energy Dashboard?

Wondering if anybody else is using StreamLabs - Home Assistant (looks like there are 16 of us) and if anybody has started updating it to support the Water Consumption statistic so it reports in the Energy Dashboard?

I think it should use the Total state class and implement last_reset per Sensor Entity | Home Assistant Developer Docs

I’m going to try ty look at this but I will definitely be stumbling around.

The code is here: core/sensor.py at 2ac2a288cc4f6c46591e803fa0a5e391c52b411c · home-assistant/core · GitHub

I am one of the 16. It looks like it is using gal instead of gl and it does not let me add it to the energy dashboard.

I’m not sure I understand what you are pointing out, do you mean we don’t have the right sensor to capture the correct time period?

image

image

I’ve dug into this a bit more. There are two issues.

  1. Output from this integration does not show up in http://homeAssistant:8123/developer-tools/statistics
    That is because the integration doesn’t set the State Class for Long Term statistics. The API has daily (which from my two days of testing appears to update near-real time), Monthly (appears to update the next day) and yearly (appears to update the next day). So to make this most useful, the integration should probably add state class for the daily count with total and last_reset of daily; It could also do total with last reset for monthly and the same for yearly. Since the Stream Labs isn’t a true meter that never resets, like a real physical water meter, I don’t think total_increasing is appropriate.

I worked around this by creating an Utility Meter sensor helper integration that resets daily. That appears in Statistics as gal.

That brings us to issue 2, which I don’t think is related to this integration.

  1. Statistics with gal don’t appear in the Energy Dashboard. This does not appear to be unique to StreamLabs. There are other posts on this. I found this one: WTH do we have Energy dashboard and no Water dashboard? - #52 by prubin100 and created a template sensor to convert gal to cubic feet and that now shows in the water dashboard.

I’m one of the 16 too. This post helped me, so I just wanted to post here to show my solidarity among us rare few.

Hello other few users of StreamLabs! So I am apparently not understanding how to add it via a utility meter. I tried to connect it to the daily sensor and it still doesn’t show up on the energy tab.

You should see your sensor in Settings/entities. It will be named sensor.whatever the name is in StreamLabs app. You will have one for daily, monthly etc.

Then go to helpers and create a utility meter sensor with your daily sensor as source. Choose daily for the reset.

Would you mind showing screenshots or some yaml code of all the bits you’re doing to get StreamLabs in to your Energy dashboard?

sorry. I stopped paying for the Streamlabs API since it wasn’t very useful, so have deleted that item. But you need to go to Helpers and create a Utility Meter Sensor with your stream labs sensor as input source. I did it all in the GUI; no YAML