History_stats last months consumption

Trying to use the new helper history_stat but cant figure out what to enter as “state”.

I have a couple of home made CT entities. These report power and I have created helpers to convert that to kWh (integration) and cost (momentary = power * tariff, accumulating = kWh * tariff).

I have a couple of RV sites, I would like to easily view “last month kWh/cost” and also thinking of “this month estimated cost” (daily avg * days of the month).

I tried the history_stats but I cant figure out what to put in “state”. All I find from examples are “on”, etc, which does not seem right. I skipped it and it lets me continue but I dont get any data output.

History Stats is not the correct integration for that type of data. History stats is a means to convert nominal or ordinal data into statistical data. And it is limited to the Recorder auto-purge length which defaults to 10 days… it does not have access to long term statistics.