Calculate Taipower (Taiwan Power Company) bi-monthly (60 days) bill amount from kWh sensor on Home Assistant.
Calculate the electricity bill amount per period (60 calendar days) in the Home Assistant (HA).
Please note that **目前只支援"非時間電價-非營業用的表燈用電" 計費.
**可支援多次設定, 增加多個台電電表來源分別計算**
Please search for Taipower bimonthly cost in HACS Integrations and install it,
Just install it according to the UI prompts:
In the first line of the UI, please enter the utility meter sensor that you want to reference for the "instant kWh" calculation for the electricity bill (please see Appendix I below this description to learn how to add utility meter).
In the second line of UI, please enter the date of the first day of the electricity bill calculation cycle of this period (the format is YYYY-MM-DD, which is the past date, commonly known as the last meter reading date, not the next meter reading date in the future).
After that, you can use sensor.<您在設定UI 第一行輸入的傳感器名稱>_power_cost displays the electricity bill statistics for this period, and you can use sensor.<您在設定UI 第一行輸入的傳感器名稱>_kwh_cost gives the built-in energy panel to HA as an independent source of electricity bills as a circuit (equipment) to calculate the electricity bill separately (please see the appendix chapter below this description).
(For example, if you enter "sensor.AA" in the first line of your UI, you can use "sensor.sensor_AA_power_cost" and "sensor.sensor_AA_kwh_cost" after completion)
Download this file and unzip it, copy custom_components to the configuration directory in your Home Assistant (usually config ).
The directory structure will look like this:
<config directory>/
|-- custom_components/
| |-- taipower_bimonthly_cost/
| |-- __init__.py
| |-- config_flow.py
| |-- const.py
| |-- etc...
| |-- translations
| |-- etc...
Next, please restart (reboot) HA.
Please go to the settings in HA -> Devices and Services -> Integration -> Add integration (button located in the lower right corner) -> Search for Taipower bimonthly cost in the settings integration menu that pops up and install it. Then follow the UI prompts:
In the first line of the UI, please enter the utility meter sensor that you want to reference for the "instant kWh" calculation for the electricity bill (please see Appendix I below this description to learn how to add utility meter).
In the second line of UI, please enter the date of the first day of the electricity bill calculation cycle of this period (the format is YYYY-MM-DD, which is the past date, commonly known as the last meter reading date, not the next meter reading date in the future).
After that, you can use sensor.sensor_<您在設定UI 第一行輸入的傳感器名稱>_power_cost to display the electricity bill statistics for this period, and you can use sensor.sensor_<您在設定UI 第一行輸入的傳感器名稱>_kwh_cost to HA's built-in energy panel as an independent source of electricity bills as a circuit (equipment) to calculate the electricity bill separately (please see the appendix chapter below this description).
(For example, if you enter "sensor.AA" in the first line of your UI, you can use "sensor.sensor_AA_power_cost" and "sensor.sensor_AA_kwh_cost" after completion)
utility meter sensor for instant kWh as a reference for energy computing? Please add the total power utility meter in configuration.yaml , and the code is as follows:
utility_meter :
bimonthly_energy :
source : sensor.total_power # 這是您想用來計算電費的 kWh 來源傳感器. In this way, you can enter sensor.bimonthly_energy in the first line of the setting UI as the calculation source for the electricity bill calculation function.
Generally speaking, most power detection hardware is back-passing W (watts). If you want to convert W into electric meter to use for use in utility meter ,
The following code can be added to sensor: paragraph in configuration.yaml to complete the conversion work:
- platform : integration
source : sensor.your_W_sensor # 這是您原始的用電 "W (瓦特)" 偵測器.
name : total_power # 這是要交給 utility meter 的名稱.
unit_prefix : k
method : trapezoidal
round : 3 After the Home Assistant 2021.8.0 version, the built-in "Energy" panel function has been added, which can calculate daily electricity consumption and daily electricity bills separately. After adding the above 1.2 programs,
Just go to the energy panel on the left side of the HA homepage -> three small dots in the upper right corner of the energy panel (settings) -> Energy Settings -> Grid Energy Consumption -> Edit Energy Consumption (pencil illustration) -> Select independent price entity in the new project -> Select sensor in the drop-down menu. (Initial setting and enter sensor name)_kwh_cost (current unit price of electricity) and press to save.
(Note: The energy panel will take up to 2 hours before it starts to display the values, give HA some patience to calculate time)
If you are familiar with the various manual settings in Home Assistant, you can use the old fully manual settings. The advantage is that you can get the message function that will automatically promote the electricity bill and electricity consumption during each period of the electricity bill!
For setting methods, please refer to the old version instructions in the following link:
https://github.com/cnstudio/Taipower-Bimonthly-Energy-Cost-homeassistant/blob/main/Docs/old_manual_readme.md