From bccfd3177b6daff873049e67f2dc4d9a705ec5a2 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Wed, 26 Feb 2020 16:41:22 -0500 Subject: [PATCH] updated to 0.105.3 --- jinja_helpers/readme.md | 18 +++++++++ lovelace/00_myhome_view.yaml | 27 ++++++++------ lovelace/09_settings_view.yaml | 29 +++++++-------- lovelace/13_qnap_view.yaml | 20 +++++----- packages/zwave_batteries.yaml | 37 ++++++++++++++++++ zwcfg_0xd89c4f0c.xml | 68 +++++++++++++++++----------------- 6 files changed, 128 insertions(+), 71 deletions(-) diff --git a/jinja_helpers/readme.md b/jinja_helpers/readme.md index 63e70bd..942291c 100644 --- a/jinja_helpers/readme.md +++ b/jinja_helpers/readme.md @@ -887,6 +887,24 @@ If you want the date to be more readable for display, you can use the script bel {{ get_date(now()) }} ``` +## 21a. Formatting Numbers + +If you want to format numbers, currency...etc, you can use something like: + +``` +{% set number = 12345 %} +{{ "${:,.2f}".format(number) }} +``` + +returns `$12,345.00`. + +``` +{% set number = 12345 %} +{{ "{:,}".format(number) }} +``` + +returns `12,345` + Feel free to modify the `strftime` format that fits your need. You can also pass your sensor value - ex: `{{ get_date(states.sensor.mysensor.last_updated) }}`. ## 22. BANNER/ASCII Text Command in Jinja diff --git a/lovelace/00_myhome_view.yaml b/lovelace/00_myhome_view.yaml index 36428cb..10cbb15 100644 --- a/lovelace/00_myhome_view.yaml +++ b/lovelace/00_myhome_view.yaml @@ -75,27 +75,30 @@ cards: show_empty: false show_header_toggle: false entities: - - entity: sensor.hasika_battery_state - name: Hasika - - entity: sensor.mallika_battery_state - name: Mallika - - entity: sensor.srinika_battery_state - name: Srinika - - entity: sensor.srinika_battery_state + - entity: input_label.suresh_charging name: Suresh - - entity: sensor.hasika_iphone_wifi_state - name: Hasika - - entity: sensor.mallika_iphone_wifi_state + - entity: input_label.mallika_charging name: Mallika - - entity: sensor.srinika_iphone_wifi_state + - entity: input_label.srinika_charging name: Srinika - - entity: sensor.srinika_iphone_wifi_state + - entity: input_label.hasika_charging + name: Hasika + + - entity: input_label.hasika_wifi + name: Hasika + - entity: input_label.mallika_wifi + name: Mallika + - entity: input_label.srinika_wifi + name: Srinika + - entity: input_label.suresh_wifi name: Suresh + - sensor.recycle_day - sensor.trash_day state_filter: - "Charging" - "yes" + - "LTE" - "Not Connected" card: type: glance diff --git a/lovelace/09_settings_view.yaml b/lovelace/09_settings_view.yaml index 9f8c609..39b9fd1 100644 --- a/lovelace/09_settings_view.yaml +++ b/lovelace/09_settings_view.yaml @@ -14,7 +14,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -30,7 +30,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -46,7 +46,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -62,7 +62,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -71,7 +71,6 @@ cards: - type: horizontal-stack cards: - - type: "custom:button-card" name: Movie Time Popcorn entity: input_boolean.movie_time @@ -81,7 +80,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -97,7 +96,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -113,7 +112,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -129,7 +128,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -147,13 +146,13 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: domain: input_boolean action: working_in_office_room - + - type: "custom:button-card" name: Working in Garage entity: input_boolean.working_in_garage @@ -163,7 +162,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: @@ -181,15 +180,13 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'on' + - value: "on" color: var(--primary-color) action: toggle toggle: domain: input_boolean action: stream_camera2chromecast - - - type: entities title: Control Panel show_header_toggle: false @@ -208,6 +205,8 @@ cards: - input_boolean.notify_camera_alerts - input_boolean.alarm_clock - input_boolean.trash_reminders + - automation.family_room_motion_timer + - automation.family_room_timer_elapsed - type: entities title: Bed & Wakeup Times diff --git a/lovelace/13_qnap_view.yaml b/lovelace/13_qnap_view.yaml index ef8785a..cfe045b 100644 --- a/lovelace/13_qnap_view.yaml +++ b/lovelace/13_qnap_view.yaml @@ -24,9 +24,9 @@ cards: style: - font-weight: bold state: - - value: 'OK' + - value: "OK" color: rgb(0, 128, 0) - - value: 'FAIL' + - value: "FAIL" color: rgb(255, 0, 0) action: more_info - type: "custom:button-card" @@ -38,9 +38,9 @@ cards: style: - font-weight: bold state: - - value: 'OK' + - value: "OK" color: rgb(0, 128, 0) - - value: 'FAIL' + - value: "FAIL" color: rgb(255, 0, 0) action: more_info - type: "custom:button-card" @@ -52,9 +52,9 @@ cards: style: - font-weight: bold state: - - value: 'OK' + - value: "OK" color: rgb(0, 128, 0) - - value: 'FAIL' + - value: "FAIL" color: rgb(255, 0, 0) action: more_info - type: "custom:button-card" @@ -66,9 +66,9 @@ cards: style: - font-weight: bold state: - - value: 'OK' + - value: "OK" color: rgb(0, 128, 0) - - value: 'FAIL' + - value: "FAIL" color: rgb(255, 0, 0) action: more_info @@ -98,8 +98,8 @@ cards: name: Disk Used severity: green: 0 - yellow: 50 - red: 75 + yellow: 70 + red: 85 - type: entities title: QNAP Drives show_header_toggle: false diff --git a/packages/zwave_batteries.yaml b/packages/zwave_batteries.yaml index 5524e9b..37c64b3 100644 --- a/packages/zwave_batteries.yaml +++ b/packages/zwave_batteries.yaml @@ -27,6 +27,12 @@ input_label: mallika_battery: srinika_battery: hasika_battery: + + suresh_charging: + mallika_charging: + srinika_charging: + hasika_charging: + suresh_wifi: mallika_wifi: srinika_wifi: @@ -177,3 +183,34 @@ automation: mdi:battery-alert {% endif %} {% endif %} + - service: input_label.set_value + data_template: + entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_wifi" + value: "{{ 'WiFi' if trigger.event.data.new_state.attributes.wifi_on |string |lower == 'true' else 'LTE' }}" + - service: input_label.set_value + data_template: + entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_charging" + value: "{{ 'Charging' if trigger.event.data.new_state.attributes.battery_charging |string |lower == 'true' else 'Not Charging' }}" + - service: input_label.set_icon + data_template: + entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_charging" + value: > + {% set battery_level = trigger.event.data.new_state.attributes.battery | int %} + {% set battery_round = (battery_level / 10)|int * 10 %} + {% if trigger.event.data.new_state.attributes.battery_charging == "true" %} + {% if battery_round >= 100 %} + mdi:battery-charging-100 + {% elif battery_round > 0 %} + mdi:battery-charging-{{ battery_round }} + {% else %} + mdi:battery-alert + {% endif %} + {% else %} + {% if battery_round >= 100 %} + mdi:battery + {% elif battery_round > 0 %} + mdi:battery-{{ battery_round }} + {% else %} + mdi:battery-alert + {% endif %} + {% endif %} diff --git a/zwcfg_0xd89c4f0c.xml b/zwcfg_0xd89c4f0c.xml index 5fc4015..310018f 100644 --- a/zwcfg_0xd89c4f0c.xml +++ b/zwcfg_0xd89c4f0c.xml @@ -34,7 +34,7 @@ - + @@ -197,7 +197,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -216,9 +216,9 @@ - + - + @@ -350,7 +350,7 @@ - + @@ -390,7 +390,7 @@ - + @@ -415,7 +415,7 @@ - + @@ -601,7 +601,7 @@ - + @@ -728,9 +728,9 @@ - + - + @@ -974,7 +974,7 @@ - + @@ -984,7 +984,7 @@ - + @@ -1006,12 +1006,12 @@ - - - - - - + + + + + + @@ -1181,7 +1181,7 @@ - + @@ -1190,8 +1190,8 @@ - - + + @@ -1213,7 +1213,7 @@ - + @@ -1339,7 +1339,7 @@ - + @@ -1369,7 +1369,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1703,7 +1703,7 @@ - + @@ -2038,7 +2038,7 @@ - + @@ -2132,7 +2132,7 @@ - + @@ -2391,7 +2391,7 @@ - + @@ -2405,9 +2405,9 @@ - + - + @@ -2730,7 +2730,7 @@ - + @@ -2781,7 +2781,7 @@ - +