I’ve had no issues previously adding individual devices to my energy dashboard, but now after upgrading to 2022.6 it seems I cannot select any devices to add to the list.
I’m sure I’ve got the new devices setup correctly, as they are the same as previous entries and I’ve even removed a working one to re-add to test and it doesn’t let me select it.
Any thoughts an input here would be appreciated.
Previously added entity, been working, no issue, removed to test and now can’t select to add back-in:
# ## Smart Plug Vaccum ##############################################
- platform: integration
name: "Vacuum Consumption"
source: sensor.current_consumption_vacuum
method: left
unit_prefix: k
round: 2
tom_l
June 7, 2022, 9:11am
2
Look at your energy sensors in Developer Tools States. They need to have the following attributes:
device_class: energy
unit_of_measurement: kWh #or Wh
state_class: total_increasing # or total
All matches there.
As I’ve said it previously had no issues adding devices, but now I can’t add any additional.
Seems this morning too my Energy Dashboard is blank and the sidebar is just sat at “Loading…”
tom_l
June 7, 2022, 11:51pm
4
Any issues you can fix in Developer Tools > Statistics?
Ok. So I cleared some issues yesterday, as the entities no longer existed, that seems to have now put a stop to any energy data going in.
It has now been more than 2 hours since I restarted HA and no energy data is in there.
I have found if I use Firefox I can add that sensor.vacuum_consumption + the others I was trying to add without issue.
tom_l
June 8, 2022, 12:52am
6
You need to add sensors here:
The main graph does not use the individually monitored devices.
Yup, which I’ve got, and it has been working for weeks, and now its decided to just stop working.
Sensors:
Can’t add new sensors into individual devices in Chrome(/webkit). If you can confirm, then it is a bug introduced in 2022.5
Energy Dashboard working yesterday, up until I removed the old and problematic sensors:
Today:
Anyway to kickstart HA to get this going again?
Ok, I think I’ve found the issue, these two templates have stopped working yesterday evening for some reason:
- platform: template
sensors:
grid_consumption_power_energy:
unique_id: grid_consumption_power_energy
value_template: >-
{% set power = states('sensor.gm_power_active')|float(0) %}
{% if power > 0.0 %} {{ (states('sensor.gm_power_active')|float(0) * 1000) }}
{% else %} 0.0 {% endif %}
device_class: Power
unit_of_measurement: 'W'
- platform: template
sensors:
grid_export_power_energy:
unique_id: grid_export_power_energy
value_template: >-
{% set power = states('sensor.gm_power_active')|float(0) %}
{% if power < 0.0 %} {{ (states('sensor.gm_power_active')|float(0) * -1 * 1000) }}
{% else %} 0.0 {% endif %}
device_class: Power
unit_of_measurement: 'W'
They aren’t reporting as having an issue, and if I copy them into the Dev tools template, the work no issue.
What can I do to nudge these going again?
tom_l
June 8, 2022, 1:58am
9
Neither of those sensors are energy sensors. They are power sensors.
That is correct, they are templates the energy sensors then use for conversion to ensure any usage and export.
I have found the issue though. HA corrupted its database yesterday when it removed statistics. Managed to see in the log that it broke itself.
Now lost a almost a years worth of energy data
I’ve got the MySQL tables in the files, but can’t reimport them.
Seems like the energy config does have a bug with Chrome/Edge though.
Seems like the energy config does have a bug with Chrome/Edge though.
Looks like it’s fixed. Works for me now at least.
opened 10:52PM - 30 May 22 UTC
closed 09:54AM - 01 Jun 22 UTC
### Checklist
- [X] I have updated to the latest available Home Assistant versi… on.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
### Describe the issue you are experiencing
When configuring any entity on the Energy Dashboard such as Grid Consumption, Return To Grid, Battery Systems, or Individual Devices, any config item that involves a drop-down selector menu doesnt allow you to actually select an entity. They show, you click and then it clears and doesnt save.
### Describe the behavior you expected
The entity selected is chosen, shown on the config popup and then saved.
### Steps to reproduce the issue
1. Login
2. Settings
3. Dashboard
4. Energy
5. Edit on Grid Consumpion
6. Use an entity with current price
7. type "amber" to find entity sensor.amber_general_price
8. Select entity
9. Drop down closes, and nothing is shown in UI.
Repeatable for individual devices (not an amber integration/entity)
Attempted on latest HA App on ios, latest ios.
Safari on latest ios (local connection)
Safari on latest MacOS
Chrome on MacOS
### What version of Home Assistant Core has the issue?
2022.5.5
### What was the last working version of Home Assistant Core?
_No response_
### In which browser are you experiencing the issue with?
Chrome on Macos Version 102.0.5005.61 (Official Build) (x86_64)
### Which operating system are you using to run this browser?
Big Sur 11.6.6
### State of relevant entities
```txt
state_class: measurement
duration: 30
date: '2022-05-31'
per_kwh: 0.46
nem_date: '2022-05-31T09:00:00+10:00'
spot_per_kwh: 0.31
start_time: '2022-05-30T22:30:01+00:00'
end_time: '2022-05-30T23:00:00+00:00'
renewables: 29
estimate: true
spike_status: none
channel_type: general
unit_of_measurement: $/kWh
attribution: Data provided by Amber Electric
icon: mdi:transmission-tower
friendly_name: Grid Price
```
### Problem-relevant frontend configuration
_No response_
### Javascript errors shown in your browser console/inspector
```txt
Unsure if this is relevant:
Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.
1 source
energy?auth_callback=1&code=4245211…&state=eyJoYXNz…ODE6ODEyMyIsImNsaWVudElkIjoiaHR0cDovLzE5Mi4xNjguMTAuODE6ODEyMy8ifQ%3D%3D:1
Learn more: User-Agent String Reduction
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
Because a cookie’s SameSite attribute was not set or is invalid, it defaults to SameSite=Lax, which prevents the cookie from being sent in a cross-site request. This behavior protects user data from accidentally leaking to third parties and cross-site request forgery.
Resolve this issue by updating the attributes of the cookie:
Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use.
Specify SameSite=Strict or SameSite=Lax if the cookie should not be sent in cross-site requests.
4 cookies
```
### Additional information
![image](https://user-images.githubusercontent.com/35386534/171065862-61b4b689-23d2-41cf-8002-2f16e891592f.png)
then
![image](https://user-images.githubusercontent.com/35386534/171065890-46d74288-a048-40b9-ba00-57261235d6db.png)
tnikk
(Tommi Nikkilä)
November 21, 2022, 8:07pm
12
This may be a really stupid question but how am I to find settings for Energy-related things. I have the dashboard but I am missing some devices and would like to add these but I just can’t find out place where to do that.
Edit. Ah, nevermind: found a solution for this. For anyone wondering the same, this is under Settings > Dashboards > Energy.