Skip to content

Commit

Permalink
various
Browse files Browse the repository at this point in the history
  • Loading branch information
tinuva committed Sep 9, 2024
1 parent ffb1362 commit 1c3b459
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/lights/lights_main_bathroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ automation:
{{4*60|int}}
{% elif '20:00' <= time <= '23:59' %}
{{30*60|int}}
{% elif '00:00' <= time <= '05:00' %}
{% elif '00:00' <= time <= '04:30' %}
{{10*60|int}}
{% elif '05:00' < time <= '08:29' %}
{% elif '04:30' < time <= '08:29' %}
{{45*60|int}}
{% else %}
{{25*60|int}}
Expand Down
2 changes: 1 addition & 1 deletion packages/presence/persons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ person:
name: Karen
user_id: d85013026cdc493ea31c9db258a2b7b6
device_trackers:
- device_tracker.nokia_6_1
- device_tracker.pixel_7a
18 changes: 9 additions & 9 deletions packages/presence/zones.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ zone:
icon: mdi:school

# David = device_tracker.pixel_4
# Karen = device_tracker.nokia_6_1
# Karen = device_tracker.pixel_7a

binary_sensor:
platform: template
sensors:
anyone_home:
friendly_name: "Anyone Home"
value_template: >-
{{ is_state('device_tracker.nokia_6_1', 'home')
{{ is_state('device_tracker.pixel_7a', 'home')
or is_state('device_tracker.pixel_4', 'home') }}
automation:
Expand All @@ -65,7 +65,7 @@ automation:
platform: state
from: 'not_home'
not_to: ["unavailable", "unknown"]
- entity_id: device_tracker.nokia_6_1
- entity_id: device_tracker.pixel_7a
platform: state
from: 'not_home'
not_to: ["unavailable", "unknown"]
Expand All @@ -74,7 +74,7 @@ automation:
variables:
person: >
{% if (trigger.entity_id == "device_tracker.pixel_4") %}David{% endif %}
{% if (trigger.entity_id == "device_tracker.nokia_6_1") %}Karen{% endif %}
{% if (trigger.entity_id == "device_tracker.pixel_7a") %}Karen{% endif %}
location: >
{{ trigger.to_state.state }}
- service: script.alert
Expand All @@ -92,7 +92,7 @@ automation:
platform: state
to: 'not_home'
not_from: ["unavailable", "unknown"]
- entity_id: device_tracker.nokia_6_1
- entity_id: device_tracker.pixel_7a
platform: state
to: 'not_home'
not_from: ["unavailable", "unknown"]
Expand All @@ -101,7 +101,7 @@ automation:
variables:
person: >
{% if (trigger.entity_id == "device_tracker.pixel_4") %}David{% endif %}
{% if (trigger.entity_id == "device_tracker.nokia_6_1") %}Karen{% endif %}
{% if (trigger.entity_id == "device_tracker.pixel_7a") %}Karen{% endif %}
location: >
{{ trigger.from_state.state }}
- service: script.alert
Expand All @@ -119,7 +119,7 @@ automation:
# - entity_id: device_tracker.pixel_4
# platform: state
# to: 'Curro Rosen Castle'
# - entity_id: device_tracker.nokia_6_1
# - entity_id: device_tracker.pixel_7a
# platform: state
# to: 'Curro Rosen Castle'
# action:
Expand All @@ -130,7 +130,7 @@ automation:
# object: 'Tracking'
# message: >
# {% if (states.device_tracker.pixel_4.state == "Curro Rosen Castle") %}David{% endif %}
# {% if (states.device_tracker.nokia_6_1.state == "Curro Rosen Castle") %}Karen{% endif %}
# {% if (states.device_tracker.pixel_7a.state == "Curro Rosen Castle") %}Karen{% endif %}
# arrived at Curro Rosen Castle
# Trigger:
# ```{{ trigger }}```
Expand All @@ -141,7 +141,7 @@ automation:
# - entity_id: device_tracker.pixel_4
# platform: state
# from: 'Curro Rosen Castle'
# - entity_id: device_tracker.nokia_6_1
# - entity_id: device_tracker.pixel_7a
# platform: state
# from: 'Curro Rosen Castle'
# action:
Expand Down
11 changes: 6 additions & 5 deletions packages/security/device_tacker_triggers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ binary_sensor:
{{ (is_state('sensor.pixel_4_battery_state', 'charging')
or is_state('sensor.pixel_4_battery_state', 'full')
or is_state('sensor.pixel_4_battery_state', 'not_charging'))
and (is_state('sensor.nokia_6_1_battery_state', 'charging')
or is_state('sensor.nokia_6_1_battery_state', 'full')
or is_state('sensor.nokia_6_1_battery_state', 'not_charging')) }}
and (is_state('sensor.pixel_7a_battery_state', 'charging')
or is_state('sensor.pixel_7a_battery_state', 'full')
or is_state('sensor.pixel_7a_battery_state', 'not_charging')) }}
# silly workaround needed - mi9t phone shows not_charging when in fact charging...

either_parent_phones_charging:
Expand All @@ -22,8 +22,9 @@ binary_sensor:
{{ (is_state('sensor.pixel_4_battery_state', 'charging')
or is_state('sensor.pixel_4_battery_state', 'full')
or is_state('sensor.pixel_4_battery_state', 'not_charging'))
or (is_state('sensor.nokia_6_1_battery_state', 'charging')
or is_state('sensor.nokia_6_1_battery_state', 'full')) }}
or (is_state('sensor.pixel_7a_battery_state', 'charging')
or is_state('sensor.pixel_7a_battery_state', 'full')
or is_state('sensor.pixel_7a_battery_state', 'not_charging')) }}
automation:
- alias: Parents both in bed when both phones charge
Expand Down

0 comments on commit 1c3b459

Please sign in to comment.