Edit: did some more reading, and Im fairly sure I answered my own question, I should have used “total_increasing”. Will try that now. Leaving the rest as it may be interesting to others.
Im helping a neighbour, who has two old Kostal Piko30 solar inverters with no useful API I could discern. But they do have a webinterface, so I made a scraper sensor. From that scraper I get instant power (w), total energy production (kwh) and daily energy production (kwh).
The total energy production is in kWH, and always increasing, but has no decimals, so its not very useful to track through the day. The daily energy production value updates every minute or so and has 2 decimal places, so thats what I used. I defined the sensor like this, and added it as a solar production source:
- platform: scrape
resource: http://pvserver:[email protected]
select: 'td'
index: 26
name: "Kostal 1 Dag Energie"
unit_of_measurement: kWh
device_class: energy
state_class: total
unique_id: Kostal1_dag_energie
(also posting it here as it might be helpful to anyone else with a similar PIKO inverter. Username and pw are factory defaults).
I wasnt sure about state_class, but I used “total” and not “always increasing”, as it resets to zero every day. Maybe that was my mistake? As in the morning, I now get a large negative “production” value, equal to the previous’ day actual production.
Does HA support a solar production sensor that resets to zero every day, should I have used always increasing as state_class (which would be a bit ironic or disnomer), or do I need to make another template sensor myself thats always increases?