mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-09-13 23:14:32 +00:00
micor changes and clean up.
This commit is contained in:
@@ -33,13 +33,13 @@ input_label:
|
||||
hasika_wifi:
|
||||
|
||||
###############################################################################
|
||||
# _ _ _
|
||||
# /\ | | | | (_)
|
||||
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
|
||||
# _ _ _
|
||||
# /\ | | | | (_)
|
||||
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
|
||||
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
|
||||
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
|
||||
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
automation:
|
||||
@@ -100,11 +100,11 @@ automation:
|
||||
data_template:
|
||||
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
|
||||
value: "{{trigger.topic.split('/')[-1] | title }}'s phone wifi enabled?"
|
||||
|
||||
|
||||
- service: input_label.set_value
|
||||
data_template:
|
||||
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
|
||||
value: '{{ trigger.payload_json.batt | int }}'
|
||||
value: "{{ trigger.payload_json.batt | int }}"
|
||||
- service: input_label.set_name
|
||||
data_template:
|
||||
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
|
||||
@@ -113,22 +113,22 @@ automation:
|
||||
data_template:
|
||||
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
|
||||
value: >
|
||||
{% set battery_level = trigger.payload_json.batt | int %}
|
||||
{% set battery_round = (battery_level / 10)|int * 10 %}
|
||||
{% if trigger.payload_json.charging == 1 %}
|
||||
{% if battery_round >= 100 %}
|
||||
mdi:battery-charging-100
|
||||
{% elif battery_round > 0 %}
|
||||
mdi:battery-charging-{{ battery_round }}
|
||||
{% else %}
|
||||
mdi:battery-alert
|
||||
{% endif %}
|
||||
{% set battery_level = trigger.payload_json.batt | int %}
|
||||
{% set battery_round = (battery_level / 10)|int * 10 %}
|
||||
{% if trigger.payload_json.charging == 1 %}
|
||||
{% if battery_round >= 100 %}
|
||||
mdi:battery-charging-100
|
||||
{% elif battery_round > 0 %}
|
||||
mdi:battery-charging-{{ battery_round }}
|
||||
{% else %}
|
||||
{% if battery_round >= 100 %}
|
||||
mdi:battery
|
||||
{% elif battery_round > 0 %}
|
||||
mdi:battery-{{ battery_round }}
|
||||
{% else %}
|
||||
mdi:battery-alert
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
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 %}
|
||||
|
Reference in New Issue
Block a user