Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- W sensor.yalm
- - platform: template
- sensors:
- person_kroki_zegarek:
- friendly_name: Person kroki zegarek
- icon_template: mdi:walk
- unit_of_measurement: "kroki"
- value_template: >
- {% set notif_sensor = 'sensor.sm_g975f_last_notification' %}
- {% if state_attr (notif_sensor, 'package') == 'com.huawei.health' %}
- {{ state_attr (notif_sensor, 'android.title') | regex_findall_index('.*? ',0) | regex_replace('\D','') }}
- {% endif %}
- person_kalorie:
- friendly_name: Person kalorie
- icon_template: mdi:run-fast
- unit_of_measurement: "kcal"
- value_template: >
- {% set notif_sensor = 'sensor.sm_g975f_last_notification' %}
- {% if state_attr (notif_sensor, 'package') == 'com.huawei.health' %}
- {% if state_attr (notif_sensor, 'android.text') | regex_match('.*away') %}
- {{ state_attr (notif_sensor, 'android.title') | regex_findall_index('.*? ',2) | regex_replace('\D','') }}
- {% else %}
- {{ state_attr (notif_sensor, 'android.text') | regex_findall_index('.*? ',0) | regex_replace('\D','') }}
- {% endif %}
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement