Morning Mariusz!
I didn’t use Powercalc at all. I just made some ‘custom’ sensors and used Meter Helpers, as I wanted to understand what was actually happening.
The background info on my own gas meter struggles is here on this thread.
If you want to get similar data to the dashboard I provided earlier, this is what I did…
Dashboard Overview
I get impulses/readings from the gas meter using this sensor - sensor.gas_meter, and this then feeds into the following Meter Helpers to log the various timescales for consumption:-
- Daily Total = sensor.gas_consumption_daily_v2
- Weekly Total = sensor.gas_consumption_weekly_v2
- Monthly Total = sensor.gas_meter_monthly_v2
- Annual Total = sensor.gas_consumption_annual_v2
Using those Meter Helpers above, I put together some conversion sensors, as all the above readings were in ft3. This is what I put together in yaml format…
template:
- sensor:
- name: "Daily Gas Consumption kWh"
unique_id: daily_gas_usage_kwh
state: "{{ ((((states('sensor.gas_consumption_daily_v2')|float * 0.0283) * 1.02264) * 39.9) / 3.6)|round(2) }}"
availability: "{{ states('sensor.gas_consumption_daily_v2')|is_number }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total
- name: "Weekly Gas Consumption kWh"
unique_id: weekly_gas_usage_kwh
state: "{{ ((((states('sensor.gas_consumption_weekly_v2')|float * 0.0283) * 1.02264) * 39.9) / 3.6)|round(2) }}"
availability: "{{ states('sensor.gas_consumption_weekly_v2')|is_number }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total
- name: "Monthly Gas Consumption kWh"
unique_id: monthly_gas_usage_kwh
state: "{{ ((((states('sensor.gas_consumption_monthly_v2')|float * 0.0283) * 1.02264) * 39.9) / 3.6)|round(2) }}"
availability: "{{ states('sensor.gas_consumption_monthly_v2')|is_number }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total
I then also added cost sensors to provide an indication of spend over the different time frames, and this is the yaml for those. The figure shown as 0.09835 is the unit rate in £’s charged by the gas provider - if the price goes up or down, then I will have to change this number - no real hardship I suppose.
template:
- sensor:
- name: "Daily Gas Cost"
unique_id: daily_gas_cost
state: "{{ (((((states('sensor.gas_consumption_daily_v2')|float * 0.0283) * 1.02264) * 39.9) / 3.6) * 0.09835)|round(2) }}"
availability: "{{ states('sensor.gas_consumption_daily_v2')|is_number }}"
unit_of_measurement: "£"
device_class: monetary
state_class: total
- name: "Weekly Gas Cost"
unique_id: weekly_gas_cost
state: "{{ (((((states('sensor.gas_consumption_weekly_v2')|float * 0.0283) * 1.02264) * 39.9) / 3.6) * 0.09835)|round(2) }}"
availability: "{{ states('sensor.gas_consumption_weekly_v2')|is_number }}"
unit_of_measurement: "£"
device_class: monetary
state_class: total
- name: "Monthly Gas Cost"
unique_id: monthly_gas_cost
state: "{{ (((((states('sensor.gas_meter_monthly_v2')|float * 0.0283) * 1.02264) * 39.9) / 3.6) * 0.09835)|round(2) }}"
availability: "{{ states('sensor.gas_meter_monthly_v2')|is_number }}"
unit_of_measurement: "£"
device_class: monetary
state_class: total
Then using those unique id’s you can pull various entity cards into a dashboard to provide the various readings you need.
Just for clarity the bit of yaml (‘sensor.gas_meter_monthly_v2’)|float * 0.0283) * 1.02264) * 39.9) / 3.6) is the conversion from ft3 to kWh, with the 39.9 figure being the calorific value of the gas - this is an average calorific value as I noted earlier in this thread.
I hope that helps somehow, and was a bit repetitive in setting it up, but it works well for me and I find I look at the data provided more than the regular Energy dashboard.
Cheers,
Mike.