so i watched a couple videos on how to access the MariaDB and it doesnt wanna work right when i select * states' FROM entity_id`= “my sensor”
it shows 0 and 11 seconds… if i browse i just have nothing but NULL entity_id
using PHPAdmin for searching… dont know why
so what i wanna do is get the value of Cost from the Energy Dashboard Page and put it into a sensor i can use in a markdown card… so i wanna extra that… as the utility meter costs you see temporary is from the grid sensor and looks like they wont fix it to retain the value at reboot… so i wanna extra the value from Energy Dashboard page
i want the daily, weekly and monthy energy ones i made and each one has a on-peak mid-peak off peak… so i wanna save those values into a sensor…
so i can make a sensor or if can extract… i want yesterdays power useage… last weeks power used, and last months used… in Kilowatts and Cost… i have no idea why they made it so the cost sensor resets at a reboot and yet retains the consumption… frustrating… so i trying to extra values from the database…
has anyone done this? if not how do you retrieve it… its been 30+ years since i used SQL so i remeberd some commands but it helped from phpadmin but i just cant seem to extract
but any help be good… i figured maybe i cant access the database correctly if i need to use user name and password in phpadmin…
sorry ahead of time if i sound confusing dont mean to i got dyslexia and it sounds right it my head but not always comes out right for others
Also, the cost calculations in the energy dashboard are as you’ve noticed based on entities already. They are created by the dashboard. They do reset, but you can get around that by creating a non-resetting utility meter helper around them. I think even the daily/monthly, … variants of the utility meter will work as long as you set that the base is resetting.
Entity sensor.weekly_energy_off_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.weekly_energy_on_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.monthly_energy_on_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.monthly_energy_off_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.monthly_energy_mid_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
where it complains about monetary…
as this is how i do my dashboard
so i was trying to figure how do read the SQL database as when you are on the energy dash board you can change the date and it changes the values…
so i wanted to make a sql sensor that reads yesterday values of on mid off peak and put them into 3 sensors… and then also a sql search for the week and the last month …
it would be nice if they didnt reset the _cost sensor after a reboot as it would be alot easier to do … and when using the utility meter on cost you get that error above which frustrating but it least adds and retains but ive only tried it since last night so still experimenting
so i looked at that Energy Cards page… none were any useful for me… and the collection_key: has no real example… nore works whatever energy_2 is as that example bottome of page doesnt tell you how to use it anywhere or path like not a useful example at all… and no such thing as a masonry type
at looking at that page it doesnt even offer like
collection_key: last week
collection_key: last month
so you collect the data of last week and last month
so it cant display an entire week sunday to sunday or entire months value… i guess only way to do it is using the utility meter on the _cost sensors and where it resets and then have automation to save the values to as Last week Last month yesterday template sensors… as the graphs are too cluttery when you wanna see values and dont care for bar graphs or gauge graphs when you just want actual values and extra candy they offer lol
was hoping something simple as would been simple if the _cost sensor didnt reset on reboot which is frustrating and how others complained about this issue too
Ah, #@(&#)(#&! Forgot about that one. You have to wrap it in a template sensor or use customize to get around that. That is indeed a pain. I would not recommend customize on entities the dashboard creates.
@Edwin_D ah ok and how would i wrap it in a template sensor a a customize as you mention… so you wouldnt recommend using the _cost sensor… i havent worked on it as i been looking after a sick parent… so i havent even sat down to figure out stuff… i just have the utility meters that use the _cost sensor as incoming… but like i mentioned throws a stupid error… wish they made it easier as i did look at that compare data page. and they are so limited in display options as i wanted a bar graph of all the mid peaks for each day or what not so limited… and i did look at the statistics-graph card… but i couldnt figure how you can use the custom-period card to link to that to change stuff… but really just needed a basic number to spit out the cost and usages like have… as i only needed value like in my graphics… as when you want a quick glance its easier to read then look at a line graphs and then push my mouse or finger over top of things to see a value…
i just wish that damn cost sensor didnt erase at reboot…
but if you can help on how to make the wrap template sensor or customize… i did try some templates but it keeps throwing stupid errors of the monetary
i have like trigger sensor creator… but it throws errors too
- trigger:
- trigger: time_pattern
hours: "23"
minutes: "59"
- trigger: homassistant
event: start
sensor:
- name: Yesterday Power Usage Total
unique_id: yesterday_power_usage_total
state: "{{ states('sensor.current_daily_consumption') }}"
# unit_of_measure: "kWh"
- name: Yesterday Power Usage On Peak
unique_id: yesterday_power_usage_on_peak
state: "{{ states('sensor.energy_import_hydro_one_daily_on_peak')}}"
# unit_of_measure: "kWh"
- name: Yesterday Power Usage Mid Peak
unique_id: yesterday_power_usage_mid_peak
state: "{{ states('sensor.energy_import_hydro_one_daily_mid_peak')}}"
# unit_of_measure: "kWh"
- name: Yesterday Power Usage Off Peak
unique_id: yesterday_power_usage_off_peak
state: "{{ states('sensor.energy_import_hydro_one_daily_off_peak') }}"
# unit_of_measure: "kWh"
# - name: Last Months Power Usage Total Cost
# unique_id: last_months_power_usage_total_cost
# state: "{{ states('sensor.current_monthly_cost') }}"
- name: Yesterday Power Usage On Peak Cost
unique_id: yesterday_power_usage_on_peak_cost
state: "{{ states('sensor.daily_energy_on_peak_cost')}}"
unit_of_measure: "$"
device_class: "balance"
- name: Yesterday Power Usage Mid Peak Cost
unique_id: yesterday_power_usage_mid_peak_cost
state: "{{ states('sensor.daily_energy_mid_peak_cost')}}"
unit_of_measure: "$"
device_class: "balance"
- name: Yesterday Power Usage Off Peak Cost
unique_id: yesterday_power_usage_off_peak_cost
state: "{{ states('sensor.daily_energy_off_peak_cost') }}"
unit_of_measure: "$"
device_class: "balance"
the doing balance and $ doesnt help… wish they made it simplier i dont even know why they make the cost sensor disapear
or can you make a template sensor that does the same thing as the cost sensor that doesnt reset at reboot… only resets at daily weekly and monthy
@edwin_D
so i having problems…i let it run for a day and half … when i set up the sensors… i still get the error and the cost counter doesnt increment its resetting to 0 did i do something wrong
i think it resets the _cost sensor to 0
the
energy_import_hydro_one_daily_mid_peak those are the energy grid import
i must be using the wrong spot and does this once it works retains the value at reboot and then increments or what does it actually do… as id like it to increment and show todays cost this weeks and months…
unless you make a sensor that calculate the power usage of the day ?
wish there was one of those blueprints like for automation you can just copy and paste
If the cost sensor resets to 0, then the value should be total_increasing. You can set it here and it is also an option in the utility meter. But that only works for values that are indeed only increasing until they reset to 0. If the cost goes up and down because there is mixed consumption and production in one sensor, you should split that in the energy dashboard so each have their own cost.
How can you get an error though if the new sensors do not set monetary? Can hou show them in developer tools?
@edwin_d sorry delay… so i guess reason i was getting error still is i point to ontario hydro engery intergration and apparently they changed the sensor card it was no longer avaliable… i ended up deleting it and re adding the intergration and repointing the costs and season and rate in my templates to the new one… so the cost was incrementing… but i still have issue
when i reboot the "not monetary " template costs sensors you had me make they count but at reboot they reset to 0… so i tried changing state_class: total to state_class: total_increasing
but it still resets to 0 at reboot its not retaining it… so that at 12am i reset it in an automation
or how should i be doing it… . it is recording the costs and i dont see an error at the moment since i fixed the intergration card… but not sure how to retain at reboot… and then save it as day before
One you have the template sensor that is a resetting but no longer state class monetary, you should be able to wrap it in a utility meter without a reset cycle to stop it from resetting.
ok ill try that so make a new utility sensor to point to the template sensor… to solve it… il try that and get back to ya… least no errors on the not monteray sensors templates… so ill give it a try and get back to ya
ok so testing i ran into a couple issues… so i had to add |int(0)
to
availability: “{{ is_number(states(‘sensor.energy_import_hydro_one_daily_on_peak_cost’)) }}”
so it looks like
availability: “{{ is_number(states(‘sensor.energy_import_hydro_one_daily_on_peak_cost’))|int(0) }}”
to get rid of the unknown/unavaliablity so it would give a 0 value…
but when i make a Total Cost card using the Combine Sensors and using sum i get unknown…
so for testing… i got 3 utility meter sensors for cost… each one points to one of the not monetary xxxx cost template sensor
that part works… but when i make a combine sensor to show total cost of the day… combining the 3 utility meter sensors… it just gives unknown… it wont actually combine them here is a screen shot
what i might try to do if it doesnt fix itself in a few hours or by tomorrow… i going to blow out all the utility meters… start fresh… using your template you helped me with… and see from there as i still get these errors
Entity sensor.daily_energy_mid_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.weekly_energy_mid_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.weekly_energy_off_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.monthly_energy_off_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
Entity sensor.monthly_energy_mid_peak_cost (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22
so by tommorow if nothing fixes ill erase it all and run spook… and fix issues under statsitcs and start fresh… incase something is not working right… and start with your template and start with daily sensor… as i figured it should been working… so ill shall see by tommorow i guess