Downloads daily import, export and load stats from the sems portal for a given day and imports them into long and short term statistics tables in Home Assistant.
Use at your own risk. This app was built for me and may cause issues your unique setup.
BUG! This app nicely imports the data in the date range you specify but every day after that has a weird spike in the 12-1am time slot.
- Your Sems username, password and plant id
- Home Assistant using sqlite
- Dotnet 6 runtime installed
STOP HOME ASSISTANT BEFORE PROCEEDING because if you don't there is a fair chance this'll corrupt your database.
.\sems-history-importer record \
--username your-sems-username \
--password your-sems-password \
--plant your-sems-plant-id \
--sqlite path/to/home-assistant_v2.db \
--start yyyy-MM-dd \
--end yyyy-MM-dd \
--timezone hh:mm
start
toend
is the date range of data you want to pull from Sems, inclusive.- All Sems HomeKit import/export stats in Home Assistant before and including
end
will be deleted.
- Logs into Sems
- Finds your HomeKit serial number
- Looks in Home Assistant for import/export sensors with that serial number
- Downloads HomeKit data for your date range
- Remove HomeKit import/export statistics in Home Assistant on or before
end
date - Import the new data
- Recalculate all HomeKit import/export sums (including stats outside of your date range)
This is a spin-off project from goodwe-sems-home-assistant.