Advertisement
adorobis

gas usage

Dec 6th, 2021
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.40 KB | None | 0 0
  1. - sensor:
  2.   - name: 'Gas Usage'
  3.     state: >
  4.      {% if states("input_number.gas_meter_pulses_count") == "unknown" %}
  5.         {{ states("sensor.gas_usage") }}
  6.       {% else %}
  7.         {{ (states("input_number.gas_meter_pulses_count")|float)/100 + (states("input_number.gas_initial_usage"))|float }}
  8.       {% endif %}
  9.     unit_of_measurement: m³
  10.     device_class: gas
  11.     state_class: total_increasing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement