Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Billed' sensors to show actual price per hour #89

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions custom_components/frank_energie/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@
value_fn=lambda data: data[DATA_ELECTRICITY].current_hour.energy_tax_price,
entity_registry_enabled_default=False,
),
FrankEnergieEntityDescription(
key="elec_billed",
name="Current electricity billed",
native_unit_of_measurement=f"{CURRENCY_EURO}/{ENERGY_KILO_WATT_HOUR}",
suggested_display_precision=2,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda data: data[DATA_ELECTRICITY].current_hour.sourcing_markup_price + data[DATA_ELECTRICITY].current_hour.market_price_with_tax,

Check failure on line 121 in custom_components/frank_energie/sensor.py

View workflow job for this annotation

GitHub Actions / Run flake8/pytest

E501 line too long (148 > 120 characters)
),
FrankEnergieEntityDescription(
key="gas_markup",
name="Current gas price (All-in)",
Expand Down Expand Up @@ -166,6 +174,14 @@
value_fn=lambda data: data[DATA_GAS].current_hour.energy_tax_price,
entity_registry_enabled_default=False,
),
FrankEnergieEntityDescription(
key="gas_billed",
name="Current gas billed",
native_unit_of_measurement=f"{CURRENCY_EURO}/{VOLUME_CUBIC_METERS}",
suggested_display_precision=2,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda data: data[DATA_GAS].current_hour.sourcing_markup_price + data[DATA_GAS].current_hour.market_price_with_tax,

Check failure on line 183 in custom_components/frank_energie/sensor.py

View workflow job for this annotation

GitHub Actions / Run flake8/pytest

E501 line too long (132 > 120 characters)
),
FrankEnergieEntityDescription(
key="gas_min",
name="Lowest gas price today",
Expand Down
Loading