2021.8.0: Feel the energy ⚡️

Same problem here, the fix did not work for me.

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/forwarded.py", line 77, in forwarded_middleware
    if remote is not None and remote.is_cloud_request is not None and remote.is_cloud_request.get():
AttributeError: module 'hass_nabucasa.remote' has no attribute 'is_cloud_request'

Is there a reason that “Energy” is special cased, it’s definitely nice to see it come together and be viewable by date but why just Energy?

I’ve got whole house water consumption measurements, can calculate my effective water rate and have calibrated each of my sprinkler zones so I know the gallons/minute.

I can also do something comparable for Bandwidth too.

You should also have a sensor.daily_energy_cost. Is that in the recorder.yaml?

No i don’t have this sensor. what is the point for this sensor, since it is only a matter of a simple calculation?

have you got an example of this sensor? (sensor.daily_energy_cost)

Your hunch was spot on.

I had a look at my meter box and there’s a combined breaker for main supply and inverter supply, then the Fronius smart meter sits between that and the house load.
It really is in the “consumption path” location…

So no easy solution but at least I understand why it is the way it is. I might have to mess with template sensors at some point to calculate energy exported / energy imported.

Or find out what it would take to move the smart meter… unfortunately where I am we aren’t allowed to touch mains wiring unless a licensed electrician. Though I probably wouldn’t go rewiring the switchboard even if I was permitted…

Taking a look at my entities, it seems I have _cost on items that are shown in the Energy Tab only, so I wonder if adding them to the Energy Tab enables a new sensor that ends with _cost?

can you share a screenshot please?

Did you try to remove corresponding .pyc file from _pycache subdirectory and restart HA after that?

Yes, I removed the whole __pycache subdirectory.

Also have the issue right here. Restart does not solve the issue. This occurs to 2021.8.6. I’m downgrading to 2021.8.4 to get HA back up and running

I’m not sure if I’m helping or confusing by now.

1 Like

Any chance to have energy chart whit monthly report.now is all based on daily reports.thanks

Weekly, monthly, yearly is planned.

4 Likes

Great Job . thanks

I agree, nicely done and some new features to explore, great job!

That’s Easyone to fix, constant name has changed to ELECTRIC_POTENTIAL_VOLT, so you could even edit the file yourself if you want.

1 Like

Companien App Is not supported anymore or what? After OS update all iPhones stopped tracking locations - not just one iPhone but all our phones in the household.

Forcing location update from the app doesn’t seems to do anything.

Not sure if this is the right place to ask but I’ll give it a go.

I have solar panel and a working “energy tab” with all kinds of sensors of which some are esphome integrated and some are templates (w to kw & wh to kwh etc.).

Now I wanted to give the new energy integration a go but I am stuck at the second step…

I do not see any of my “sensors”. I have read this:

But I am the maker of my esphome config for the solar readings… How can I get my entity in there?

My entity:

Is there any thing special I need to add in my esphome config or can I add that in home assistant itself? Appreciate the help. Thanks.

edit: is it just as simple as adding this in my esphome ymal:

state_class: "measurement"

edit2: played some with 2 sensors but no luck in getting them into my solar energy selection:
I did it for 2 sensors:


(I know value is now unknown but because there is not sun now)
reloaded homeassitant reloaded the esphome integration…


интеграция hiking в HA идет через localtuya, через tuya.com

configuration.yaml

sensor:
  - platform: dnsip
    name: Public IP
    

  - platform: template
    sensors:
#--------сумарное вртребление двух hiking сенсор общее квт в туя---------------#
      sumarnoe_energy_watt_kotel_i_svet_tekuschee:
        friendly_name: 'Текущее Потреб. дома Ватт сумарное Power'
        value_template: "{{ (states('sensor.metr1_svet_kwt')|float + states('sensor.meter2_kotel_grizzly_kwt')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'W'
        device_class: power



###!!!!!!!!!!!!!! Сенсор вытянутый из свитча вентиляция кухня
      load_floor_ventilyatssia_kuhnya_power:
        friendly_name: 'Вентиляция кухня power'
        value_template: "{{ state_attr('switch.svitch_1_ventiliatsiia_kukhnia', 'load_power') }}"
        icon_template: hass:flash
        unit_of_measurement: 'W'
        device_class: power

###!!!!!!!!!!!!!! Сенсор вытянутый из свитча Свитч 4 - Обогрев комната большая
      load_floor_obogrev_bolshaya_komnana_power:
        friendly_name: 'Свитч 4 - Обогрев комната большая power'
        value_template: "{{ state_attr('switch.svitch_4_obogrev_komnata_bolshaia', 'load_power') }}"
        icon_template: hass:flash
        unit_of_measurement: 'W'
        device_class: power
        
###!!!!!!!!!!!!!! Сенсор вытянутый из свитча Свитч 3 - Насос колодец
      load_floor_nasos_kolodetss_power:
        friendly_name: 'Свитч 3 - Насос колодец power'
        value_template: "{{ state_attr('switch.svitch_3_nasos_kolodets', 'load_power') }}"
        icon_template: hass:flash
        unit_of_measurement: 'W'
        device_class: power
        
###!!!!!!!!!!!!!! Сенсор вытянутый из свитча Свитч 2 - Прожектор
      load_floor_prozhektor_power:
        friendly_name: 'Свитч 2 - Прожектор power'
        value_template: "{{ state_attr('switch.svitch_2_kanalizatsiia', 'load_power') }}"
        icon_template: hass:flash
        unit_of_measurement: 'W'
        device_class: power

###!!!!!!!!!!!!!! Сенсор вытянутый из свитча Терраса
      load_floor_terrasa_power:
        friendly_name: 'Терраса'
        value_template: "{{ state_attr('switch.terrasa', 'load_power') }}"
        icon_template: hass:flash
        unit_of_measurement: 'W'
        device_class: power

###---!!!---- Сенсор вытянутый из MES мосэнергосбыта цену за дневной тариф
      prise_den_iz_mes:
        friendly_name: 'Цена вытянутая из MES мосэнергосбыта день'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_account', 'zone_t1_tariff') }}"
        icon_template: hass:flash
        unit_of_measurement: 'RUB'
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта цену за ночной тариф
      prise_noch_iz_mes:
        friendly_name: 'Цена вытянутая из MES мосэнергосбыта ночь'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_account', 'zone_t2_tariff') }}"
        icon_template: hass:flash
        unit_of_measurement: 'RUB'
##

###---!!!---- Сенсор вытянутый из MES мосэнергосбыта ФИО
      fio_iz_mes:
        friendly_name: 'ФИО вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_account', 'full_name') }}"
        icon_template: hass:flash
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта Номер лицевого счета 
      nomer_lk_iz_mes:
        friendly_name: 'Номер лицевого счета вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_account', 'friendly_name') }}"
        icon_template: hass:flash
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта последний патеж  сумма
      posledniy_platyezh_summa_iz_mes:
        friendly_name: 'Сумма последнего платежа вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('binary_sensor.mes_37436_193_99_last_payment', 'amount') }}"
        icon_template: hass:flash
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта дата последний патеж дата
      posledniy_platyezh_data_iz_mes:
        friendly_name: 'Дата последнего платежа вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('binary_sensor.mes_37436_193_99_last_payment', 'period') }}"
        icon_template: hass:flash
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта дата последнего передания показаний 
      posledniy_peredanie_pokazaniy_data_iz_mes:
        friendly_name: 'Дата последнего передания показаний вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_meter_04926300', 'last_indications_date') }}"
        icon_template: hass:flash
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта показания Т1 последние переданные
      t1_posledniy_peredanie_pokazaniy_iz_mes:
        friendly_name: 'Т1 День последние переданные показания вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_meter_04926300', 'zone_t1_last_indication') }}"
        icon_template: hass:flash
###---!!!---- Сенсор вытянутый из MES мосэнергосбыта показания Т2 последние переданные
      t2_posledniy_peredanie_pokazaniy_iz_mes:
        friendly_name: 'Т2 Ночь последние переданные показания вытянутая из MES мосэнергосбыта'
        value_template: "{{ state_attr('sensor.mes_37436_193_99_meter_04926300', 'zone_t2_last_indication') }}"
        icon_template: hass:flash

##
      myesyachniy_rschet_t1:
        friendly_name: 'Месячный расчет T1'
        value_template: "{{ (states('sensor.mounth_tekuschee_energy_tarif_t1_den_mesiachnyi')|float * states('sensor.prise_den_iz_mes')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'RUB'
        device_class: monetary
      myesyachniy_rschet_t2:
        friendly_name: 'Месячный расчет T2'
        value_template: "{{ (states('sensor.mounth_tekuschee_energy_tarif_t2_noch_mesiachnyi')|float * states('sensor.prise_noch_iz_mes')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'RUB'
        device_class: monetary        
###
      year_rschet_t1:
        friendly_name: 'Годовой расчет T1'
        value_template: "{{ (states('sensor.year_tekuschee_energy_tarif_t1_den_godovoi')|float * states('sensor.prise_den_iz_mes')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'RUB'
        device_class: monetary
      year_rschet_t2:
        friendly_name: 'Годовой расчет T2'
        value_template: "{{ (states('sensor.year_tekuschee_energy_tarif_t2_noch_godovoi')|float * states('sensor.prise_noch_iz_mes')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'RUB'
        device_class: monetary        
#

############Сумарный переключателей aqara и всего света сложение W
      sum_aqara_perekluchateley_i_sveta_w:
        friendly_name: 'Потребление всех переключателей Aqara и света w'
        value_template: "{{ (states('sensor.0x54ef44100002eed0_power')|float + states('sensor.0x158d0005959bb9_power')|float + states('sensor.0x158d0005868f18_power')|float + states('sensor.0x54ef441000030986_power')|float + states('sensor.0x158d0005869f38_power')|float + states('sensor.0x158d0005794a8a_power')|float + states('sensor.0x158d0005869094_power')|float + states('sensor.0x158d00054a063c_power')|float + states('sensor.load_floor_prozhektor_power')|float + states('sensor.load_floor_terrasa_power')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'W'
        device_class: power

############Сумарный вентиляция  w
      sum_vsey_ventilyatsii_w:
        friendly_name: 'Потребление всей вентиляции w'
        value_template: "{{ (states('sensor.0x158d000353d68e_power')|float + states('sensor.0x158d00031698b7_power')|float + states('sensor.0x158d00027cfe55_power')|float + states('sensor.0x158d000353d7fd_power')|float + states('sensor.load_floor_ventilyatssia_kuhnya_power')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'W'
        device_class: power

############Сумарный всех приборов за исключением света и вентиляции W
      sum_vseh_priborov_w:
        friendly_name: 'Потребление всех приборов за исключением вентиляции и света'
        value_template: "{{ (states('sensor.metr1_svet_kwt')|float - states('sensor.sum_vsey_ventilyatsii_w')|float - states('sensor.sum_aqara_perekluchateley_i_sveta_w')|float) }}"
        icon_template: hass:battery
        unit_of_measurement: 'W'
        device_class: power
#############



#Мощность света hiking интеграция localtuya
  - platform: integration
    source: sensor.posledniy_platyezh_summa_iz_mes
    name: Последняя сумма оплаты Мосэнергосбыт
#Мощность света hiking интеграция localtuya
  - platform: integration
    source: sensor.metr1_svet_kwt
    name: Мощность света
    unit_prefix: k
    round: 2
#Мощность котла grizly hiking интеграция localtuya
  - platform: integration
    source: sensor.meter2_kotel_grizzly_kwt
    name: Мощность котла grizly
    unit_prefix: k
    round: 2
#римана
  - platform: integration
    source: sensor.sumarnoe_energy_watt_kotel_i_svet_tekuschee
    name: rimana_power_slozhenie_watt
    unit_prefix: k
    round: 2

################--energy переключатели aqara---#####
  - platform: integration
    source: sensor.0x54ef44100002eed0_power
    name: kWh Свет кухня переключатель Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d0005959bb9_power
    name: kWh Свет гостиная переключатель Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d0005868f18_power
    name: kWh Светодиод гостиная переключатель Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x54ef441000030986_power
    name: kWh Свет улица переключатель Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d0005869f38_power
    name: kWh Свет холодный коридор Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d0005794a8a_power
    name: kWh Свет прихожая преключатель Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d0005869094_power
    name: kWh Свет туалет переключатель Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d00054a063c_power
    name: kWh Ванная свет переключатель Power
    unit_prefix: k
    round: 2
    
#Вентиляция
  - platform: integration
    source: sensor.0x158d000353d68e_power
    name: vent kWh Вентиляция ванная Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d00031698b7_power
    name: vent kWh Вытяжка кухня Power
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.0x158d00027cfe55_power
    name: vent kWh Вентиляция туалет Power
    unit_prefix: k
    round: 2

  - platform: integration
    source: sensor.0x158d000353d7fd_power
    name: vent kWh Вентиляция чердак Power
    unit_prefix: k
    round: 2
    #Вытянутая из свитча
  - platform: integration
    source: sensor.load_floor_ventilyatssia_kuhnya_power
    name: s vent kWh Вентиляция кухня Power
    unit_prefix: k
    round: 2

#Обогрев большая комната римана Вытянутая из свитча
  - platform: integration
    source: sensor.load_floor_obogrev_bolshaya_komnana_power
    name: s hot kWh Обогрев большая комната Power
    unit_prefix: k
    round: 2
#Свитч 3 - Насос колодец римана Вытянутая из свитча
  - platform: integration
    source: sensor.load_floor_nasos_kolodetss_power
    name: s water kWh Насос колодец Power
    unit_prefix: k
    round: 2

#Прожектор римана Вытянутая из свитча
  - platform: integration
    source: sensor.load_floor_prozhektor_power
    name: s kWh Прожектор Power
    unit_prefix: k
    round: 2

#Терраса римана Вытянутая из свитча
  - platform: integration
    source: sensor.load_load_floor_terrasa_power
    name: s kWh Терраса Power
    unit_prefix: k
    round: 2
    
##### Cумма всего света
  - platform: integration
    source: sensor.sum_aqara_perekluchateley_i_sveta_w
    name: Потребление всего света kwt
    unit_prefix: k
    round: 2

##### Вся вентиляция
  - platform: integration
    source: sensor.sum_vsey_ventilyatsii_w
    name: Потребление всей вентиляции kwt
    unit_prefix: k
    round: 2

##### Все приборы
  - platform: integration
    source: sensor.sum_vseh_priborov_w
    name: Потребление всех приборов kwt
    unit_prefix: k
    round: 2

utility_meter:
#  den_energy:
#    source: sensor.consumption_dvizhenie_day_kwt
#    name: Power суточный utility hiking свет Power
#    cycle: daily
#    tariffs:
#      - Tarif-T12
#      - Tarif-T22
  den_tekuschee_energy:
    source: sensor.rimana_power_slozhenie_watt
    name: Текущее utility hiking свет Power
    cycle: daily
    tariffs:
      - Тариф-T1 День
      - Тариф-T2 Ночь
  mounth_tekuschee_energy:
    source: sensor.rimana_power_slozhenie_watt
    name: Месячный utility hiking Power
    cycle: monthly
    offset:
      days: 15
      hours: 0
      minutes: 0
    tariffs:
      - Тариф-T1 День месячный
      - Тариф-T2 Ночь месячный
  year_tekuschee_energy:
    source: sensor.rimana_power_slozhenie_watt
    name: Годовой utility hiking Power
    cycle: yearly
    offset:
      days: 15
      hours: 0
      minutes: 0
    tariffs:
      - Тариф-T1 День годовой
      - Тариф-T2 Ночь годовой
######



automations:

alias: Энергия - energy Peak / Offpeak смена тарифа в зависимости от времени
description: ''
trigger:
  - platform: time
    at: '7:20:00'
  - platform: time
    at: '23:20:00'
condition: []
action:
  - service: utility_meter.next_tariff
    data: {}
    target:
      entity_id:
        - utility_meter.den_tekuschee_energy
        - utility_meter.mounth_tekuschee_energy
mode: single

В configuration.yaml используется интеграция мосэнегосбыт home assistant.
то есть тариф дневной и ночной загружается от поставщика энергии:


everything works perfectly!!!

you must use it

1 Like