Closed spitfire closed 1 year ago
While yesterday was fine, it happened to me again today. It didn't happen before 2023.5 (and I did upgrade to .1 then .2 between those 2 occurrences)
I have the same problem
Turns out the some entities for individual device consumption have gone crazy yesterday (but not two days before) as well:
Looks like the energy dashboard is seriously broken in 2023.5.x
I've got same problems - all consumption configured with utility meter so it should reset daily - midnight and all energy from previous day is showed again. Also values displayed in energy dashboard does not correspond with states of entity - ie fridge power consumption is twice bigger according to the graph.
And it happened to me again. Seems to be happening only every 2nd day (or on even days) for some reason.
I've got positive value from PV once utility meter is reset - that never happened before. Also all entities from individual power consumption are random values - I've got utlity meters set for daily/monthly/yearly consumption but energy dashboard displays completetly different values. @spitfire I've sent you email - we can check if there's nothing unusual on our end
Ok something is really fishy: 1st screenshot - fridge daily consumption 0.48 kWh consumed just by doing math / energy dashboard shows 0.36 kWh but once I click and do math I've got 0.48 kWh 2nd screenshot - fridge daily consumption based on utility meter -> 0.47 kWh which is right but energy dasboard shows 1.2 kWh?? Once I click I've got completely different value
This is seriously messed up. Looks like my non-resetting energy meters for PV started resetting once every 2 days(!) after the upgrade. I haven't seen that mentioned in changelog, did I miss something?
I've had the same thing happen twice to my inverter since 2023.5.0, and once each to three separate smart plugs.
The smart plugs are Tuya, and the inverter is supplying its energy stats directly to HA via REST.
Ok I'm pooling inverter data via MODBUS TCP and plugs are zigbee -> z2m. Downgraded to 2023.4.6 and no problems.
@cpuks someone else told me a downgrade resolved that issue too for them. Definitely a 2023.5.x bug
@cpuks someone else told me a downgrade resolved that issue too for them. Definitely a 2023.5.x bug
I confirm, I went back to version 2023.4.6 and the problem disappeared
So far none of developers are involved but some changes been made 2023.4->2023.5 and energy dashboard / reimann sum / utility meters are broken - we need to get attention from devs to look at this issue
Same problem for me since upgraded to 2023.5.x. for 3 times now, the solar production is not reset to zero at midnight but at 0:05 or 0:10 so there is a positive production during the night (I don't even know that the moon can produce solar energy :) ).
5.5.2023 updated from HA core_2023.4.6 to core_2023.5.1. That reseted four Riemann-sum helpers to zero and therefore Energy Dashboard shows negative for these energy entities. Two entities reseted next day 6.5.2023 and one more 8.5.2023.
I believe in all these cases source power entity was in "unavailable" state as very often withs various low power IoT devices and some why Riemann sum calculation gets reseted. That have not happened earlier on my hundreds of entities and thirty Riemann energy counters so seems that something odd is happening.
Updated 8.5.2023 to core 2023.5.2 and no new resets after update. I will report if that is happening again and trying to find solution how to set counters back to correct figures.
same issue here today in energy dashboard: running: 2023.5.1
same kind of problem here. after update to 2023.5
i have couple tuya power sockets with riehman. one in tv stand and one in work table. Tv stand has some consumption all day 24/7 and it works with no problems, but work table has consumption only at work hours. Riehman does not work any more if there is no consumption to sum. It seem seems like if source entity is long time in zero value, riehman goes unkown/unavailable mode.
Up is kWh riehman entity and down is tuya power entity
@dgomes I think you're the code owner of the Riemann sum integration?
Please wait for 2023.5.3 there is fix in there that should fixe this
thanks @dgomes
all see: https://github.com/home-assistant/core/issues/92392 (issue reported first time) and: https://github.com/home-assistant/core/pull/92825 (Pull request to fix the issue)
Please wait for 2023.5.3 there is fix in there that should fixe this
It hasn't resolved it for me (2023.5.3) :(
Installed also the new version. Had a reset today and alle values to zero again :(
Same here. @dgomes looks like that's an issue different from the one you've resolved?
There might be more then 1 issue in this thread... as @nicknol points out, what was fixed was the error message:
could not restore last state unknown: [<class 'decimal.ConversionSyntax'>]
Now, is @spitfire error related to a Rienman Integration sensor ?
There might be more then 1 issue in this thread... as @nicknol points out, what was fixed was the error message:
could not restore last state unknown: [<class 'decimal.ConversionSyntax'>]
Now, is @spitfire error related to a Rienman Integration sensor ?
Yes, it does look like it. The entities behind the individual devices I have in my energy dashboard (which are in helpers - listed as riemann integration). Seem to have started resetting every two days (!) for some reason, while they were increment ING and never resetting before:
Could you please enable debug logging:
logger:
default: warning
logs:
homeassistant.components.integration: debug
Could you please enable debug logging:
logger: default: warning logs: homeassistant.components.integration: debug
Sure. Enabled it now. Will wait for this to reoccur.
Updated yesterday to 2023.5.3 (before midnight), but today, my solar production have been reset to zero once again at 0:10. Once again tonight. Before release .3, the problem was occuring every 3-4 days, now it's everyday
I can't replicate the reset of the Riemann Integration sensor... there must be something more to it
Not ruling out that it is related to the fact that the Riemann integration will now follow the availability of the source sensor.
What integration method are you using ?
I can't replicate the reset of the Riemann Integration sensor... there must be something more to it
I use a template source
sensor for
- platform: integration
source: sensor.net_afname
name: Grid consumption kWh
unique_id: 94172690-7020-4130-9268-b140b9756539
unit_prefix: k
round: 3
This is the source
- name: Net afname
unique_id: dd4adeb0-ffa4-4e52-959f-a8b50d081b4f
unit_of_measurement: "W"
device_class: power
state: >
{%- if states("sensor.huidige_opbrengst") | float(default=0) < states("sensor.huidig_verbruik") | float(default=0) %}
{{ (states("sensor.huidig_verbruik") | float(default=0) - states("sensor.huidige_opbrengst") | float(default=0)) | round(2) }}
{%- elif states("sensor.huidige_opbrengst") | float(default=0) >= states("sensor.huidig_verbruik") | float(default=0) %}
{{ 0 | float(default=0) }}
{% endif %}
When I reload my templates there is a possibility this issue happens
I have updated 2023.5.3 and Riemann sum sensors get reseted only if I restart HA. No resets when keeping system up. So I try to avoid restarts. Some source sensors are shelly EM-sensors and some are template entities with shelly source sensors. Only once happened with Wiz power plug.
Same here - positive production from PV at 00:05. Now energy dashboard charts all over the place. I'm going back to 2023.4.6 again ehh
OK... that template @gieljnssns, can you add a default value if all IF's fail ?
I have added some ELSE statements, reloaded my templates now is I have 7 unavailable sensors
Almost all of them are grid consumption
The template
- name: Net afname
unique_id: dd4adeb0-ffa4-4e52-959f-a8b50d081b4f
unit_of_measurement: "W"
device_class: power
state: >
{%- if states("sensor.huidige_opbrengst") | float(default=0) < states("sensor.huidig_verbruik") | float(default=0) %}
{{ (states("sensor.huidig_verbruik") | float(default=0) - states("sensor.huidige_opbrengst") | float(default=0)) | round(2) }}
{%- elif states("sensor.huidige_opbrengst") | float(default=0) >= states("sensor.huidig_verbruik") | float(default=0) %}
{{ 0 | float(default=0) }}
{% else %}
{{ 0 | float(default=0) }}
{% endif %}
The integration sensor
- platform: integration
source: sensor.net_afname
name: Grid consumption kWh
unique_id: 94172690-7020-4130-9268-b140b9756539
unit_prefix: k
round: 3
And the utility meters
daily_grid_consumption_new:
source: sensor.grid_consumption_kwh
periodically_resetting: false
cycle: daily
unique_id: 025a88aa-66f0-4430-9ab7-a6eb6c223182
monthly_grid_consumption:
source: sensor.grid_consumption_kwh
periodically_resetting: false
cycle: monthly
unique_id: 593e7109-2f96-47a6-a93f-c1b0a502ac12
yearly_grid_consumption:
source: sensor.grid_consumption_kwh
periodically_resetting: false
cycle: yearly
unique_id: bb9cf6f0-bae0-4639-94b3-3c0a21c2e0d4
quarter_hourly_grid_consumption:
source: sensor.grid_consumption_kwh
periodically_resetting: false
cycle: quarter-hourly
unique_id: 6098cdbb-97ac-428b-8b69-2f6bc7c072f4
The error in HA
Logger: homeassistant.helpers.event
Source: components/sensor/__init__.py:583
First occurred: May 16, 2023 at 00:00:00 (7 occurrences)
Last logged: 11:00:06
Error while processing state change for sensor.daily_solar
Error while processing state change for sensor.daily_energy
Error while processing state change for sensor.huidig_verbruik
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 579, in state
numerical_value = int(value)
ValueError: invalid literal for int() with base 10: ''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 287, in _async_state_change_dispatcher
hass.async_run_hass_job(job, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 607, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1133, in _refresh
self.hass.async_run_hass_job(self._job, event, updates)
File "/usr/src/homeassistant/homeassistant/core.py", line 607, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 348, in _handle_results
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 583, in state
raise ValueError(
ValueError: Sensor sensor.grid_energy_consumption has device class energy, state class None unit kWh and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: (<class 'str'>)
The last time the template sensor was updated was when I reloaded them There is no grid consumption now.
@gieljnssns what version of HA are you running ?
version | core-2023.5.3 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.10.11 |
os_name | Linux |
os_version | 6.1.25 |
arch | x86_64 |
timezone | Europe/Brussels |
config_dir | /config |
Before 2023.5.x
Since the day I have installed 2023.5.x I have negative energy
the X is important as an important patch was introduced in 2023.5.3
This one is from yesterday, I was already on .3
@gieljnssns please wait for https://github.com/home-assistant/core/pull/93137
I've seen this issue on all the 2023.5 patch versions. Reverted back to 2023.4 and everything works again.
My devices are Tuya based with the current power reported under an attribute. The Riemann integration source is a template that reads the attribute. Example:
- platform: template
sensors:
geyser_current_power:
unique_id: geyser_current_power
friendly_name: "Geyser Power"
value_template: >-
{{ states.switch.geyser.attributes.current_consumption | round(2) }}
unit_of_measurement: "W"
I'm starting to see a pattern (sources are templates)
@chickenbeef can you change the template to:
{{ states.switch.geyser.attributes.current_consumption | float(default=0) | round(2) }}
Not all of them This one fails almost every RESTART of HA
- platform: integration
source: sensor.koffiezet_vermogen
name: Koffiezet kWh
unique_id: 40479fb2-765b-435e-80e5-16b91ed19b29
method: left
unit_prefix: k
round: 3
Source is ESPHome
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: true
cf_pin: GPIO05
cf1_pin: GPIO14
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
current:
name: '${channel_1} stroom'
internal: true
unit_of_measurement: 'A'
accuracy_decimals: 3
icon: mdi:flash-outline
voltage:
name: '${channel_1} spanning'
internal: true
unit_of_measurement: 'V'
icon: mdi:flash-outline
power:
name: '${channel_1} vermogen'
id: vermogen
unit_of_measurement: 'W'
icon: mdi:flash-outline
on_value_range:
- above: ${max_power}
then:
- switch.turn_off: relay
- homeassistant.service:
service: persistent_notification.create
data:
title: Message from ${upper_devicename}
data_template:
message: Switch turned off because power exceeded ${max_power}W
update_interval: 10s
Some of mine were Tasmota power plugs - I've since ditched the sum and I'm using the energy total in the energy dashboard instead. At least they are now working, but yes - some of my templated sums are doing the same as above.
Happens to me too but only if I update the host so there's a small gap in data collection.
The problem
For some reason a massive negative(!) “production” bar appeared on my energy dashboard:
Meanwhile entities related to the production do not show any kind of strange data:
Looking at Developer tools->statistics does not show any either. Neither did querying the database directly (both the statistics and statistics_short_term), aside from this one - which returned slightly negative values (some strange rounding error?):
What version of Home Assistant Core has the issue?
core-2023.5.0
What was the last working version of Home Assistant Core?
core-2023.4.*
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
Not sure, either the db or Energy Dashboard
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response