Closed butanon2 closed 10 months ago
I would like this too, Toon has a tile with gas today. Gas last hour isn't very helpful. Is it possible to add this?
Never mind, I found a way to store the gas used value at midnight and calculate todays usage.
If someone would like to use this, here's my solution:
Create a numeric helper, in my case input_number.gasmeter_stand_gisteren
Make an automation to store the current gas usage at midnight.
alias: Gasmeter stand opslaan
description: ""
trigger:
- platform: time
at: "23:59:59"
condition: []
action:
- service: input_number.set_value
data:
value: "{{ states('sensor.toon_gas_used_cnt') }}"
target:
entity_id: input_number.gasmeter_stand_gisteren
alias: Onthoud gasmeterstand
mode: single
sensor.gas_verbruik_vandaag
in your dashboard.sensor:
- platform: template
sensors:
gas_verbruik_vandaag:
friendly_name: "Gasverbruik vandaag"
unit_of_measurement: 'm3'
icon_template: mdi:meter-gas
value_template: "{{ (states('sensor.toon_gas_used_cnt') | float - states('input_number.gasmeter_stand_gisteren') | float) | round(2)}}"
If someone would like to use this, here's my solution:
- Create a numeric helper, in my case
input_number.gasmeter_stand_gisteren
- Make an automation to store the current gas usage at midnight.
alias: Gasmeter stand opslaan description: "" trigger: - platform: time at: "23:59:59" condition: [] action: - service: input_number.set_value data: value: "{{ states('sensor.toon_gas_used_cnt') }}" target: entity_id: input_number.gasmeter_stand_gisteren alias: Onthoud gasmeterstand mode: single
- Then add this template sensor to the configuration.yaml and use this new entity
sensor.gas_verbruik_vandaag
in your dashboard.sensor: - platform: template sensors: gas_verbruik_vandaag: friendly_name: "Gasverbruik vandaag" unit_of_measurement: 'm3' icon_template: mdi:meter-gas value_template: "{{ (states('sensor.toon_gas_used_cnt') | float - states('input_number.gasmeter_stand_gisteren') | float) | round(2)}}"
Why not using an utility meter and set it on every dag And the source: toon_gas_used_cnt? Easier and faster solution I think
Why not using an utility meter and set it on every dag And the source: toon_gas_used_cnt? Easier and faster solution I think
Thanks, added it to the README, not tested yet (awaiting midnight)
Hi,
I want to use "Gas used today"
Is this possible to adjust this option in the code?