Hi there,
I am new in Homeassistant and migrate all of my scripts from iobroker to homeassistant.
I have a question for recalculate my gas consumption.
I have the consumption in m³ from a (knx) sensor and want to calculate the kWh.
For that, I have created helper entities with “Brennwert” and “Zustandszahl”. I need both, to calculate the kWh
The calculation looks like this:
gas consumption in m³ * brennwert * zustandszahl = kWh
The result do I have at my entity sensor.gas_zahlerstand_kwh in my knx.yaml
Thanks for helping
Update:
okay, I think I have a first solution. Created an automation
alias: Umrechnung Gas Zählerstand
description: Umrechnung Gas Zählerstand m³ in kwh
trigger:
- platform: state
entity_id: sensor.gas_zahlerstand_m3
action:
- service: knx.send
data:
address: 7/4/8
payload: >-
{{ float(states('sensor.gas_zahlerstand_m3')) *
float(states("input_number.gas_brennwert")) *
float(states("input_number.gas_zustandszahl")) }}
type: active_energy_kwh
mode: single
If there is a better and easier Way, I will happy to inform about. Because I have many thinks of that, I have to migrate from ioBroker to Home Assistant.