DanielWinks / HassOS-Addons

MIT License
20 stars 5 forks source link

Add "state_class: measurement" support for long-term statistics #4

Closed Triberg closed 3 years ago

Triberg commented 3 years ago

I'm really not sure if this is an issue with the rtl plugin or Mosquitto, so this might be the wrong place to ask. I currently have a temperature sensor configured (as type temp_hum_c_to_f) in this plugin. I'd like to be able to use HA's long-term statistics to create a graph. According to https://www.home-assistant.io/more-info/statistics/, the entity needs a state_class set to "measurement". Can we do that from within this addon, or does Mosquitto need to support it instead?

DanielWinks commented 3 years ago

It will need added here. I'll see if I can find a bit tonight to add it as it should be quick, otherwise it will be a few more days possibly.

DanielWinks commented 3 years ago

Ok, I looked into what is needed to add long term statistics support, and it seemed pretty quick to add, so I pushed out a new version with it. It's added to temperature and humidity sensors, as that's the only thing I see as being applicable.

I recently sold my house and moved into an apartment, so I don't actually have HA running at the moment, and with an easily 95% reduction in IoT devices due to being a renter now, I'm not exactly in a rush to go set it up... So please give me a note here and let me know if these changes are all that's needed, or if anything else needs done, or if anything isn't working properly. Thanks!

Triberg commented 3 years ago

Installed this yesterday and it seems to be working as expected. Thank you so much for your time working on this. Good luck with your new place!