Integration doesn't work in Home Assistant 2024.7.2
System Health details
System Information
| version | core-2024.7.2 |
|---|---|
| installation_type | Home Assistant OS |
| dev | false |
| hassio | true |
| docker | true |
| user | root |
| virtualenv | false |
| python_version | 3.12.4 |
| os_name | Linux |
| os_version | 6.6.33-haos |
| arch | x86_64 |
| timezone | Europe/Berlin |
| config_dir | /config |
Home Assistant Community Store
| GitHub API | ok |
|---|---|
| GitHub Content | ok |
| GitHub Web | ok |
| GitHub API Calls Remaining | 4757 |
| Installed Version | 1.34.0 |
| Stage | running |
| Available Repositories | 1651 |
| Downloaded Repositories | 16 |
Home Assistant Cloud
| logged_in | false |
|---|---|
| can_reach_cert_server | ok |
| can_reach_cloud_auth | ok |
| can_reach_cloud | ok |
Home Assistant Supervisor
| host_os | Home Assistant OS 12.4 |
|---|---|
| update_channel | stable |
| supervisor_version | supervisor-2024.06.2 |
| agent_version | 1.6.0 |
| docker_version | 26.1.4 |
| disk_total | 30.8 GB |
| disk_used | 13.8 GB |
| healthy | true |
| supported | true |
| host_connectivity | true |
| supervisor_connectivity | true |
| ntp_synchronized | true |
| virtualization | kvm |
| board | ova |
| supervisor_api | ok |
| version_api | ok |
| installed_addons | NGINX Home Assistant SSL proxy (3.9.0), Zigbee2MQTT (1.39.0-1), File editor (5.8.0), Mosquitto broker (6.4.1), Advanced SSH & Web Terminal (18.0.0) |
Dashboards
| dashboards | 3 |
|---|---|
| resources | 1 |
| views | 1 |
| mode | storage |
Miele
| component_version | 2024.5.0 |
|---|---|
| reach_miele_cloud | ok |
Recorder
| oldest_recorder_run | July 5, 2024 at 19:13 |
|---|---|
| current_recorder_run | July 15, 2024 at 02:41 |
| estimated_db_size | 435.22 MiB |
| database_engine | sqlite |
| database_version | 3.45.3 |
Checklist
- [X] I have enabled debug logging for my installation.
- [X] I have filled out the issue template to the best of my ability.
- [X] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
- [X] This issue is not a duplicate issue of any previous issues..
Describe the issue
I try to set up an entity for a car's mileage. For that, I use the following csv file:
statistic_id|unit|start|state|sum
sensor:kilometerstand|km|25.11.2008 00:00|47000|0
sensor:kilometerstand|km|01.01.2016 00:00|132670|0
sensor:kilometerstand|km|01.01.2017 00:00|141483|0
sensor:kilometerstand|km|01.01.2018 00:00|154747|0
sensor:kilometerstand|km|01.01.2019 00:00|162388|0
sensor:kilometerstand|km|01.01.2020 00:00|168462|0
sensor:kilometerstand|km|01.01.2021 00:00|169033|0
sensor:kilometerstand|km|14.07.2024 00:00|173248|0
I didn't get any error when using the service with the following settings:
service: import_statistics.import_from_file
data:
timezone_identifier: Europe/Berlin
decimal: false
filename: auto.csv
delimiter: "|"
But there aren't any changes in HA itself either. I also tried to use an previously created helper utility meter. That also didn't to anything.
Reproduction steps
- Put the csv file from the description into /homeassistant/auto.csv.
- Try to import this file with the settings from the description.
- Check if anything was imported into HA.
Debug logs
2024-07-15 03:01:09.364 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2024-07-15 03:01:09.365 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2024-07-15 03:01:09.431 INFO (SyncWorker_11) [custom_components.import_statistics] Importing statistics from file: /config/auto.csv
2024-07-15 03:01:09.431 DEBUG (SyncWorker_11) [custom_components.import_statistics] Timezone_identifier: Europe/Berlin
2024-07-15 03:01:09.431 DEBUG (SyncWorker_11) [custom_components.import_statistics] Delimiter: |
2024-07-15 03:01:09.431 DEBUG (SyncWorker_11) [custom_components.import_statistics] Decimal separator: .
2024-07-15 03:01:09.439 DEBUG (SyncWorker_11) [custom_components.import_statistics] Columns:
2024-07-15 03:01:09.440 DEBUG (SyncWorker_11) [custom_components.import_statistics] Index(['statistic_id', 'unit', 'start', 'state', 'sum'], dtype='object')
2024-07-15 03:01:09.447 DEBUG (SyncWorker_11) [custom_components.import_statistics] Calling async_import_statistics / async_add_external_statistics with:
2024-07-15 03:01:09.447 DEBUG (SyncWorker_11) [custom_components.import_statistics] Metadata:
2024-07-15 03:01:09.447 DEBUG (SyncWorker_11) [custom_components.import_statistics] {'has_mean': False, 'has_sum': True, 'source': 'sensor', 'statistic_id': 'sensor:kilometerstand', 'name': None, 'unit_of_measurement': 'km'}
2024-07-15 03:01:09.448 DEBUG (SyncWorker_11) [custom_components.import_statistics] Statistics:
2024-07-15 03:01:09.448 DEBUG (SyncWorker_11) [custom_components.import_statistics] [{'start': datetime.datetime(2008, 11, 25, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 47000}, {'start': datetime.datetime(2016, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 132670}, {'start': datetime.datetime(2017, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 141483}, {'start': datetime.datetime(2018, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 154747}, {'start': datetime.datetime(2019, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 162388}, {'start': datetime.datetime(2020, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 168462}, {'start': datetime.datetime(2021, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 169033}, {'start': datetime.datetime(2024, 7, 14, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')), 'sum': 0, 'state': 173248}]
Diagnostics dump
No response
The debug logs look perfect. How did you check that nothing happened in HA? Did you search for the "kilometerstand" external entity in developer tools / statistics? You cannot see external statistics as normal entities.
I imported your file and it worked perfectly. But I am still at an older HA version, 2024.4.3. Did it work for you with an older version? I'll update in the next days and see what happens.
Updated to 2024.7.2, works as well
Hi, I have similar case, I can't seem to find any sensor value. Purpose is to keep track of my blood pressure value taken once per day. build a stat file and imported this without any issue
HA version used Core: 2024.10.0 Supervisor: 2024.09.1 Operating System: 13.1 Frontend: 20241002.2
Log file file see below: [home-assistant_2024-10-03T10-40-35.036Z.log](https://github.com/user-attachments/files/17242971/home-assistant_2024-10-03T10-40-35.036Z.log
Statistic example:
statistic_id unit start state sum sensor:blood_pressure_upper mmHg 01.10.2024 00:00 133 0 sensor:blood_pressure_under mmHg 01.10.2024 00:00 88 0 sensor:heartbeat min 01.10.2024 10:00 56 0 sensor:blood_pressure_upper mmHg 02.10.2024 00:00 127 0 sensor:blood_pressure_under mmHg 02.10.2024 00:00 80 0 sensor:heartbeat min 02.10.2024 10:00 61 0 sensor:blood_pressure_upper mmHg 03.10.2024 00:00 124 0 sensor:blood_pressure_under mmHg 03.10.2024 00:00 80 0 sensor:heartbeat min 03.10.2024 00:00 59 0
The debug logs look perfect, same question for you:
How did you check that nothing happened in HA? Did you search for the external entities you created in developer tools / statistics? You cannot see external statistics as normal entities under developer tools/states
thanks for the info, yes I can see them, but how can I show the into a graph on my dashboard?
You can use the statistics card (just shows one value), or the Statistics graph Card (a graph over a selected period). Or use plotly, much more powerful, but more complex.
Remember to select the entity with the colon (':') there.
Great, thanks for the feedback
graphs looks great. thanks for this fantastic HA integration.
I'll add a hint to the readme in the next version