Home Assistant
in der configurations.yaml datei:
unter
mqtt:
sensor:
`- name: "Gas Usage"
state_topic: "homeassistant/sensor/gas_meter/state"
unit_of_measurement: "m³"
device_class: gas
state_class: total_increasing
value_template: "{{ value_json.total_m3 }}"
json_attributes_topic: "homeassistant/sensor/gas_meter/state"
json_attributes_template: "{{ {'daily_usage': value_json.daily_m3, 'pulses': value_json.total_pulses, 'timestamp': value_json.timestamp} | tojson }}"
`
`binary_sensor:
- name: "Gas Meter Status"
state_topic: "homeassistant/sensor/gas_meter/status"
payload_on: "online"
payload_off: "offline"
device_class: connectivity`