Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template:
- - sensor:
- - name: Oktan 95 billigst
- state: >-
- # Change "fuletype" to the type you wish to track MIN
- {% set fueltype = 'oktan 95' -%}
- {% set minimum = min(
- expand(states.sensor)
- | selectattr('attributes.product_type', 'defined')
- | selectattr('attributes.product_type','eq', fueltype)
- | map(attribute='state')
- | list
- ) -%}
- {{ minimum }}
- device_class: monetary
- icon: mdi:gas-station
- attributes:
- companies: >-
- # Change "fuletype" to the type you wish to track MIN
- {% set fueltype = 'oktan 95' -%}
- {% set minimum = min(
- expand(states.sensor)
- | selectattr('attributes.product_type', 'defined')
- | selectattr('attributes.product_type','eq', fueltype)
- | map(attribute='state')
- | list
- ) -%}
- {{ expand(states.sensor)
- | selectattr('attributes.product_type', 'defined')
- | selectattr('attributes.product_type','eq', fueltype)
- | selectattr('state','eq', minimum)
- | map(attribute='attributes.company_name')
- | list}}
- - name: Oktan 95 dyrest
- state: >-
- # Change "fuletype" to the type you wish to track MAX
- {% set fueltype = 'oktan 95' -%}
- {% set maximum = max(
- expand(states.sensor)
- | selectattr('attributes.product_type', 'defined')
- | selectattr('attributes.product_type','eq', fueltype)
- | map(attribute='state')
- | list
- ) -%}
- {{ maximum }}
- device_class: monetary
- icon: mdi:gas-station
- attributes:
- companies: >-
- # Change "fuletype" to the type you wish to track MAX
- {% set fueltype = 'oktan 95' -%}
- {% set maximum = max(
- expand(states.sensor)
- | selectattr('attributes.product_type', 'defined')
- | selectattr('attributes.product_type','eq', fueltype)
- | map(attribute='state')
- | list
- ) -%}
- {{ expand(states.sensor)
- | selectattr('attributes.product_type', 'defined')
- | selectattr('attributes.product_type','eq', fueltype)
- | selectattr('state','eq', maximum)
- | map(attribute='attributes.company_name')
- | list}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement