Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior #142

Open
4 tasks done
FS-DK opened this issue Nov 18, 2024 · 6 comments
Open
4 tasks done

Strange behavior #142

FS-DK opened this issue Nov 18, 2024 · 6 comments

Comments

@FS-DK
Copy link

FS-DK commented Nov 18, 2024

System Health details

System Information

version core-2024.11.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.31-haos-raspi
arch aarch64
timezone Europe/Copenhagen
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.1
Stage running
Available Repositories 1459
Downloaded Repositories 28
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 13.2
update_channel stable
supervisor_version supervisor-2024.11.2
agent_version 1.6.0
docker_version 27.2.0
disk_total 56.5 GB
disk_used 8.4 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.4.1), Home Assistant Google Drive Backup (0.112.1), File editor (5.8.0), Advanced SSH & Web Terminal (19.0.0), Vaultwarden (Bitwarden) (0.23.4), Duck DNS (1.18.0), Node-RED (18.1.1)
Dashboards
dashboards 2
resources 13
views 3
mode storage
Recorder
oldest_recorder_run 16. november 2024 kl. 10.43
current_recorder_run 18. november 2024 kl. 16.57
estimated_db_size 65.57 MiB
database_engine sqlite
database_version 3.45.3
Sonoff
version 3.8.1 (ffa7e22)
cloud_online 1 / 2
local_online 1 / 1

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Total consumption at the sensor in home assistant is higher than the consumption i get from the api.
When a charging starts, the consumption drops around 300kwh. This gives strange consumptions when calculating to minus charging consumption from Total consumption.
Please se attached sreendump.
Is this only happening for me?
Screenshot_20241109_090708_Home Assistant

Reproduction steps

  1. Charge
  2. Watch the sensor drop
    ...

Debug logs

Can't find it.

Diagnostics dump

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2024.11.2", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.12.4", "docker": true, "arch": "aarch64", "timezone": "Europe/Copenhagen", "os_name": "Linux", "os_version": "6.6.31-haos-raspi", "supervisor": "2024.11.2", "host_os": "Home Assistant OS 13.2", "docker_version": "27.2.0", "chassis": "embedded", "run_as_root": true }, "custom_components": { "ble_monitor": { "documentation": "https://github.com/custom-components/ble_monitor", "version": "12.18.0", "requirements": [ "pycryptodomex\u003E=3.19.1", "janus\u003E=1.0.0", "aioblescan\u003E=0.2.14", "btsocket\u003E=0.2.0", "pyric\u003E=0.1.6.3" ] }, "iphonedetect": { "documentation": "https://github.com/mudape/iphonedetect", "version": "1.4.2", "requirements": [] }, "hacs": { "documentation": "https://hacs.xyz/docs/configuration/start", "version": "2.0.1", "requirements": [ "aiogithubapi\u003E=22.10.1" ] }, "leakbot": { "documentation": "https://github.com/sHedC/leakbot", "version": "0.1.0", "requirements": [] }, "energidataservice": { "documentation": "https://github.com/MTrab/energidataservice/blob/master/README.md", "version": "1.6.1", "requirements": [ "async-retrying-ng==0.1.3", "CurrencyConverter==0.17.32" ] }, "google_home": { "documentation": "https://github.com/leikoilja/ha-google-home", "version": "1.12.1", "requirements": [ "glocaltokens==0.7.3" ] }, "sonoff": { "documentation": "https://github.com/AlexxIT/SonoffLAN", "version": "3.8.1", "requirements": [ "pycryptodome\u003E=3.6.6" ] }, "zha_toolkit": { "documentation": "https://github.com/mdeweerd/zha-toolkit", "version": "v1.1.19", "requirements": [ "aiofiles\u003E=0.4.0", "pytz\u003E=2016.10" ] }, "frigate": { "documentation": "https://github.com/blakeblackshear/frigate", "version": "5.4.0", "requirements": [ "pytz" ] }, "tapo": { "documentation": "https://github.com/petretiandrea/home-assistant-tapo-p100", "version": "3.1.2", "requirements": [ "plugp100==5.1.3" ] }, "eloverblik": { "documentation": "https://github.com/JonasPed/homeassistant-eloverblik", "version": "0.6.0", "requirements": [ "pyeloverblik==0.4.2" ] }, "monta": { "documentation": "https://github.com/nickknissen/hass-monta", "version": "1.4.3", "requirements": [] }, "alarmo": { "documentation": "https://github.com/nielsfaber/alarmo", "version": "v1.10.7", "requirements": [] }, "tapo_control": { "documentation": "https://github.com/JurajNyiri/HomeAssistant-Tapo-Control", "version": "5.8.0", "requirements": [ "pytapo==3.3.32" ] } }, "integration_manifest": { "domain": "utility_meter", "name": "Utility Meter", "codeowners": [ "dgomes" ], "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/utility_meter", "integration_type": "helper", "iot_class": "local_push", "loggers": [ "croniter" ], "quality_scale": "internal", "requirements": [ "croniter==2.0.2" ], "is_built_in": true, "overwrites_built_in": false }, "setup_times": { "null": { "setup": 0.000468426034785807 }, "b5a763e386f81aaaae8546e7230c7408": { "wait_import_platforms": -11.0174154510023, "config_entry_setup": 11.0235457370291 }, "db92482ca9ded248fa090d8cb06a6259": { "wait_import_platforms": -11.0241804770194, "config_entry_setup": 11.0279456370045 }, "01JCTGECV7WN4GT6GQJ21QSJCX": { "wait_import_platforms": -11.0277815639274, "config_entry_setup": 11.0315536690177 } }, "data": { "config_entry": { "created_at": "2024-11-16T12:51:24.647614+00:00", "data": { }, "discovery_keys": { }, "domain": "utility_meter", "entry_id": "01JCTGECV7WN4GT6GQJ21QSJCX", "minor_version": 1, "modified_at": "2024-11-16T12:51:24.647637+00:00", "options": { "always_available": false, "cycle": "daily", "delta_values": false, "name": "OpladningT3", "net_consumption": false, "offset": 0, "periodically_resetting": true, "source": "sensor.monta_frants_sandberg_last_meter_reading", "tariffs": [] }, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "user", "title": "OpladningT3", "version": 2 }, "tariff_sensors": [ { "name": "OpladningT3", "entity_id": "sensor.opladningt3", "extra_attributes": { "status": "collecting", "last_period": "723.96", "last_valid_state": "1886.06", "last_reset": "2024-11-17T23:00:00.009634+00:00", "next_reset": "2024-11-19T00:00:00+01:00" }, "last_sensor_data": { "native_value": 0, "native_unit_of_measurement": "kWh", "last_period": "723.96", "last_reset": "2024-11-17T23:00:00.009634+00:00", "last_valid_state": "1886.06", "status": "collecting", "input_device_class": "energy" }, "period": "daily", "cron": "0 0 * * *", "source": "sensor.monta_frants_sandberg_last_meter_reading" } ] } }

@nickknissen
Copy link
Owner

How have you setup the Total consumption sensor?

@FS-DK
Copy link
Author

FS-DK commented Nov 20, 2024

Sorry for the late reply.
It's setup as an utility meter with a reset daily.
I have tried both with net consumption and without net consumption. The result was the same.
I have also tried uninstalling Monta, deleted the database, and then installed Monta again.
With the same result.

@nickknissen
Copy link
Owner

What does your Last meter reading history look like?

My Zaptec Go data looks like the following:
image

There seems to be a bug in the data from Monta where lastMeterReadingKwh is not always cumulative.

You could try enabling Periodically resetting in the utility meter to see if it fixes the issue.

@FS-DK
Copy link
Author

FS-DK commented Nov 26, 2024

My last meter reading looks like this with my EVBox Elvi.
It's different from yours, as mine is total increasing.
It has not always been making these drops. It started normal with no drops at all, but at the end of October it started making the drops. What is realy strange, is that it always drops to the same level. It drops to 1520,010 kWh.
My utility meter is resetting daily.

2024-11-26 14_57_50-Historik – Home Assistant – Google Chrome image

@nickknissen
Copy link
Owner

The last meter reading data comes directly monta api. You could try to create a template sensor which only increases in value

sensor:
  - platform: template
    sensors:
      tpl_monta_last_meter_reading:
        value_template: >-
          {% set current_value = states('sensor.last_meter_reading') | float %}
          {% set previous = states('sensor.tpl_monta_last_meter_reading') | float %}
          {{ [current_value, previous ] | max }}

@FS-DK
Copy link
Author

FS-DK commented Dec 6, 2024

I finally got it working with your suggestion. But I had to modify it a bit and use input counters.

But still..... it's a very strange behavior that just started out of nothing.

template:
- sensor:
- name: "Akkumuleret forøgelse"
state: >
{% set last = states('input_number.last_positive_value') | float(0) %}
{% set current = states('sensor.monta_xxxxxxxxxxxxx_last_meter_reading') | float(0) %}
{% set accumulated = states('sensor.akkumuleret_forøgelse') | float(0) %}
{% if current > last %}
{{ '%.3f' % (accumulated + (current - last)) }}
{% else %}
{{ '%.3f' % accumulated }}
{% endif %}
unit_of_measurement: "kWh"

input_number:
last_positive_value:
name: Sidste positive værdi
min: 0
max: 1000000
step: 1
akkumuleret_forbrug:
name: Akkumuleret forbrug
min: 0
max: 100000000
step: 0.01
unit_of_measurement: "kWh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants