Home Assistant Git Exporter
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
blueprint:
|
||||
name: On-Off schedule with state persistence
|
||||
description: '# On-Off schedule with state persistence
|
||||
|
||||
|
||||
A simple on-off schedule, with the addition of state persistence across disruptive
|
||||
events, making sure the target device is always in the expected state.
|
||||
|
||||
|
||||
📕 Full documentation regarding this blueprint is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/automation/on_off_schedule_state_persistence).
|
||||
|
||||
|
||||
🚀 This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints)
|
||||
project**.
|
||||
|
||||
|
||||
ℹ️ Version 2021.10.26
|
||||
|
||||
'
|
||||
source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/automation/on_off_schedule_state_persistence/on_off_schedule_state_persistence.yaml
|
||||
domain: automation
|
||||
input:
|
||||
automation_target:
|
||||
name: (Required) Automation target
|
||||
description: The target which the automation will turn on and off based on the
|
||||
provided schedule.
|
||||
selector:
|
||||
target: {}
|
||||
on_time:
|
||||
name: (Required) On Time
|
||||
description: Time when the target should be placed in the on state.
|
||||
selector:
|
||||
time: {}
|
||||
off_time:
|
||||
name: (Required) Off Time
|
||||
description: Time when the target should be placed in the off state.
|
||||
selector:
|
||||
time: {}
|
||||
custom_trigger_event:
|
||||
name: (Optional) Custom Trigger Event
|
||||
description: A custom event which can trigger the state check (eg. a powercut
|
||||
event reported by external integrations).
|
||||
default: ''
|
||||
selector:
|
||||
text: {}
|
||||
trigger_at_homeassistant_startup:
|
||||
name: (Optional) Trigger at Home Assistant startup
|
||||
description: Trigger the target state check and enforcement at Home Assistant
|
||||
startup.
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
variables:
|
||||
off_time: !input 'off_time'
|
||||
on_time: !input 'on_time'
|
||||
trigger_at_homeassistant_startup: !input 'trigger_at_homeassistant_startup'
|
||||
time_fmt: '%H:%M:%S'
|
||||
first_event: '{{ on_time if strptime(on_time,time_fmt).time() < strptime(off_time,time_fmt).time()
|
||||
else off_time }}'
|
||||
second_event: '{{ on_time if strptime(on_time,time_fmt).time() >= strptime(off_time,time_fmt).time()
|
||||
else off_time }}'
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
- platform: time
|
||||
at:
|
||||
- !input 'on_time'
|
||||
- !input 'off_time'
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: event
|
||||
event_type: !input 'custom_trigger_event'
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.platform!="homeassistant" or trigger_at_homeassistant_startup
|
||||
}}'
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ now().time() >= strptime(first_event,time_fmt).time() and
|
||||
now().time() < strptime(second_event,time_fmt).time() }}'
|
||||
sequence:
|
||||
- service: homeassistant.{{ "turn_on" if first_event == on_time else "turn_off"}}
|
||||
target: !input 'automation_target'
|
||||
default:
|
||||
- service: homeassistant.{{ "turn_on" if second_event == on_time else "turn_off"}}
|
||||
target: !input 'automation_target'
|
||||
@@ -0,0 +1,334 @@
|
||||
blueprint:
|
||||
name: Dim lights based on sun elevation
|
||||
description: Adjust brightness of lights based on the current sun elevation. If
|
||||
force debug is enabled, you need to execute this automation manually or let Home
|
||||
Assitant restart before the change take effect.
|
||||
source_url: https://github.com/EvTheFuture/homeassistant-blueprints/blob/master/blueprints/dim_lights_based_on_sun_elevation.yaml
|
||||
domain: automation
|
||||
input:
|
||||
target_lights:
|
||||
name: Lights
|
||||
description: The lights to control the brightness of
|
||||
selector:
|
||||
target:
|
||||
entity:
|
||||
domain: light
|
||||
max_brightness:
|
||||
name: Maximum brightness percent
|
||||
description: Brightness to set as the maximum brightness
|
||||
default: 100
|
||||
selector:
|
||||
number:
|
||||
min: 2.0
|
||||
max: 100.0
|
||||
unit_of_measurement: '%'
|
||||
mode: slider
|
||||
step: 1.0
|
||||
min_brightness:
|
||||
name: Minimum brightnes percent
|
||||
description: Brightness to set as the minimum brightness
|
||||
default: 1
|
||||
selector:
|
||||
number:
|
||||
min: 1.0
|
||||
max: 99.0
|
||||
unit_of_measurement: '%'
|
||||
mode: slider
|
||||
step: 1.0
|
||||
reverse:
|
||||
name: Reverse brightness
|
||||
description: If checked, light will start dim when sun starts to set (start
|
||||
elevation value) and will be at full brightness when the elevation has reached
|
||||
the end elevation value.
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
allowance:
|
||||
name: Change Allowance
|
||||
description: How much can the brightnes be changed without this automation stop
|
||||
updating the brightness. If set to 0% this automation will stop update the
|
||||
brightness if the brightness has been changed at all since the last triggering
|
||||
of this automation. If set to 100% this automation will keep on and update
|
||||
the brightness even if you have manually changed the brightness to any other
|
||||
value since the last trigger.
|
||||
default: 0
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 100.0
|
||||
unit_of_measurement: '%'
|
||||
mode: slider
|
||||
step: 1.0
|
||||
turn_on:
|
||||
name: Turn on lights automatically
|
||||
description: Turn on lights when sun is setting.
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
start_elevation_setting:
|
||||
name: Elevation of the sun to start dim the light when the sun is setting
|
||||
default: 0
|
||||
selector:
|
||||
number:
|
||||
min: -60.0
|
||||
max: 60.0
|
||||
unit_of_measurement: °
|
||||
mode: slider
|
||||
step: 0.5
|
||||
end_elevation_setting:
|
||||
name: Elevation of the sun when the light shall be fully dimmed when the sun
|
||||
is setting
|
||||
default: -30
|
||||
selector:
|
||||
number:
|
||||
min: -60.0
|
||||
max: 60.0
|
||||
unit_of_measurement: °
|
||||
mode: slider
|
||||
step: 0.5
|
||||
turn_off:
|
||||
name: Turn off lights automatically
|
||||
description: Turn off lights when sun has risen.
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
start_elevation_rising:
|
||||
name: Elevation of the sun to start brighten the light when the sun is rising
|
||||
default: -8
|
||||
selector:
|
||||
number:
|
||||
min: -60.0
|
||||
max: 60.0
|
||||
unit_of_measurement: °
|
||||
mode: slider
|
||||
step: 0.5
|
||||
end_elevation_rising:
|
||||
name: Elevation of the sun when the light shall have max brightness when the
|
||||
sun is rising
|
||||
default: 6
|
||||
selector:
|
||||
number:
|
||||
min: -60.0
|
||||
max: 60.0
|
||||
unit_of_measurement: °
|
||||
mode: slider
|
||||
step: 0.5
|
||||
transition_time:
|
||||
name: Transition time in seconds between brightness values
|
||||
default: 0
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 5.0
|
||||
unit_of_measurement: s
|
||||
mode: slider
|
||||
step: 0.25
|
||||
debugging:
|
||||
name: Debug logging
|
||||
description: 'WARNING: Don''t enable this unless you have activated ''logger''
|
||||
in your configuration.yaml file. Turn on debugging of this automation. In
|
||||
order for this to take effect you need to manually trigger (EXECUTE) this
|
||||
automation or let Home Assistant restart before debug will be turned on/off.'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
variables:
|
||||
allowance_input: !input 'allowance'
|
||||
allowance_value: '{{ allowance_input|float * 2.54 }}'
|
||||
debugging: !input 'debugging'
|
||||
target_lights: !input 'target_lights'
|
||||
entity_list: "{%- if target_lights.entity_id is string -%}\n {{ [target_lights.entity_id]\
|
||||
\ }}\n{%- else -%}\n {{ target_lights.entity_id }}\n{%- endif -%}"
|
||||
transition_time: !input 'transition_time'
|
||||
turn_on: !input 'turn_on'
|
||||
turn_off: !input 'turn_off'
|
||||
reverse: !input 'reverse'
|
||||
start_setting: !input 'start_elevation_setting'
|
||||
start_rising: !input 'start_elevation_rising'
|
||||
end_setting: !input 'end_elevation_setting'
|
||||
end_rising: !input 'end_elevation_rising'
|
||||
max_brightness_input: !input 'max_brightness'
|
||||
max_brightness: '{{ max_brightness_input|float }}'
|
||||
min_brightness_input: !input 'min_brightness'
|
||||
min_brightness: '{{ min_brightness_input|float }}'
|
||||
trigger_is_event: '{{ trigger is defined and trigger.platform == ''event'' }}'
|
||||
skip_event: '{{ trigger_is_event and trigger.event.data.service_data|length > 1
|
||||
}}'
|
||||
affected_entities: "{%- if skip_event -%}\n {{ [] }}\n{%- elif trigger is not defined\
|
||||
\ or trigger.platform != 'event' or trigger.event.data.service_data is not defined\
|
||||
\ or trigger.event.data.service_data.entity_id is not defined -%}\n {{ entity_list\
|
||||
\ }}\n{%- else -%}\n {%- if trigger.event.data.service_data.entity_id is string\
|
||||
\ -%}\n {%- set eids = [trigger.event.data.service_data.entity_id] -%}\n {%-\
|
||||
\ else -%}\n {%- set eids = trigger.event.data.service_data.entity_id -%}\n\
|
||||
\ {%- endif -%}\n {%- set data = namespace(e=[]) -%}\n {%- for e in eids -%}\n\
|
||||
\ {%- if e in entity_list -%}\n {%- set data.e = data.e + [e] -%}\n \
|
||||
\ {%- endif -%}\n {% endfor %}\n {{ data.e }}\n{%- endif -%}"
|
||||
current_states: "{%- set data = namespace(e=[]) -%} {%- for e in entity_list -%}\n\
|
||||
\ {%- set a = {'entity_id': e, 'state': states(e), 'brightness': state_attr(e,\
|
||||
\ 'brightness')} -%}\n {%- set data.e = data.e + [a] -%}\n{%- endfor -%} {{ data.e\
|
||||
\ }}"
|
||||
error_msg: "{%- if start_setting|float <= end_setting|float -%}\n {{ 'Start elevation\
|
||||
\ must be greater than end evevation when the sun is setting' }}\n{%- elif start_rising|float\
|
||||
\ >= end_rising|float -%}\n {{ 'End elevation must be greater than start evevation\
|
||||
\ when the sun is rising' }}\n{%- elif entity_list|length == 0 -%}\n {{ 'No valid\
|
||||
\ entites specified or found' }}\n{%- endif -%}"
|
||||
has_last: "{% if trigger is defined and trigger.platform == 'state' and trigger.from_state.entity_id\
|
||||
\ == 'sun.sun' -%}\n {{ True }}\n{% else %}\n {{ False }}\n{% endif %}"
|
||||
rising: '{{ state_attr(''sun.sun'', ''rising'') }}'
|
||||
last_rising: '{% if has_last %}{{ trigger.from_state.attributes.rising }}{% else
|
||||
%}{{ rising }}{% endif %}'
|
||||
elevation: '{{ state_attr(''sun.sun'', ''elevation'') }}'
|
||||
last_elevation: '{% if has_last %}{{ trigger.from_state.attributes.elevation }}{%
|
||||
else %}{{ elevation }}{% endif %}'
|
||||
force_turn_on: '{{ turn_on and not rising and last_elevation != "" and last_elevation
|
||||
>= end_setting|float and elevation <= start_setting|float }}'
|
||||
force_turn_off: '{{ turn_off and rising and last_elevation != "" and last_elevation
|
||||
<= end_rising|float and elevation >= end_rising|float }}'
|
||||
max_elevation: '{% if rising %}{{end_rising|float}}{% else %}{{start_setting|float}}{%
|
||||
endif %}'
|
||||
min_elevation: '{% if rising %}{{start_rising|float}}{% else %}{{end_setting|float}}{%
|
||||
endif %}'
|
||||
last_max_elevation: '{% if last_rising %}{{end_rising|float}}{% else %}{{start_setting|float}}{%
|
||||
endif %}'
|
||||
last_min_elevation: '{% if last_rising %}{{start_rising|float}}{% else %}{{end_setting|float}}{%
|
||||
endif %}'
|
||||
elevation_range: '{{ max_elevation - min_elevation }}'
|
||||
last_elevation_range: '{{ last_max_elevation - last_min_elevation }}'
|
||||
brightness_range: '{{ max_brightness - min_brightness }}'
|
||||
delta_to_min: '{{ elevation - min_elevation }}'
|
||||
last_delta_to_min: '{{ last_elevation|float - last_min_elevation }}'
|
||||
full_percent_raw: '{% if delta_to_min / elevation_range < 0 %}0{% elif delta_to_min
|
||||
/ elevation_range > 1 %}1{% else %}{{delta_to_min / elevation_range}}{% endif
|
||||
%}'
|
||||
full_percent: '{% if reverse %}{{1 - full_percent_raw}}{% else %}{{full_percent_raw}}{%
|
||||
endif %}'
|
||||
last_full_percent_raw: '{% if last_delta_to_min / elevation_range < 0 %}0{% elif
|
||||
last_delta_to_min / elevation_range > 1 %}1{% else %}{{last_delta_to_min / elevation_range}}{%
|
||||
endif %}'
|
||||
last_full_percent: '{% if reverse %}{{1 - last_full_percent_raw}}{% else %}{{last_full_percent_raw}}{%
|
||||
endif %}'
|
||||
brightness_pct: '{{ full_percent * brightness_range + min_brightness }}'
|
||||
last_brightness_pct: '{{ last_full_percent * brightness_range + min_brightness }}'
|
||||
brightness: '{{ (brightness_pct * 2.54)|int }}'
|
||||
last_brightness: '{{ (last_brightness_pct * 2.54)|int }}'
|
||||
turn_on_entities: "{%- if force_turn_on -%}\n {%- set data = namespace(entities=[])\
|
||||
\ -%}\n {%- for e in entity_list -%}\n {%- if not state_attr(e, 'supported_features')|bitwise_and(1)\
|
||||
\ -%}\n {%- set data.entities = data.entities + [e] -%}\n {%- endif -%}\n\
|
||||
\ {%- endfor -%}\n {{ data.entities }}\n{%- else -%}\n {{ [] }}\n{%- endif\
|
||||
\ -%}"
|
||||
dim_entities: "{%- set data = namespace(entities=[]) -%} {%- for e in entity_list\
|
||||
\ -%}\n {%- set current_brightness = state_attr(e, 'brightness') -%}\n {%- set\
|
||||
\ is_on = states(e) == 'on' -%}\n {%- set last_changed = (now() - states[e].last_changed)\
|
||||
\ -%}\n {%- set can_dim = state_attr(e, 'supported_features')|bitwise_and(1)|bitwise_or(not\
|
||||
\ is_on) -%}\n {#\n Set brightness and turn on if\n * Trigger is an event\
|
||||
\ to turn on entity and it is currently off\n OR\n * dimming is supported\
|
||||
\ by the entity AND light shall be turned on because the sun is setting (force_turn_on)\n\
|
||||
\ OR\n * dimming is supported by the entity AND light is ON AND the current\
|
||||
\ brightness differ from the new brightness\n AND\n * current brightness\
|
||||
\ is equal to last set brightness (has not been changed by the user within the\
|
||||
\ allowance)\n #}\n {%- if e in affected_entities -%}\n {%- if trigger_is_event\
|
||||
\ and (not is_on or (is_on and last_changed.seconds < 2)) -%}\n {%- set data.entities\
|
||||
\ = data.entities + [e] -%}\n {%- elif can_dim and force_turn_on -%}\n \
|
||||
\ {%- set data.entities = data.entities + [e] -%}\n {%- elif can_dim and is_on\
|
||||
\ and current_brightness != brightness and (current_brightness - last_brightness)|abs\
|
||||
\ <= allowance_value -%}\n {%- set data.entities = data.entities + [e] -%}\n\
|
||||
\ {%- endif -%}\n {%- endif -%}\n{%- endfor -%} {{ data.entities }}"
|
||||
turn_off_entities: "{%- if force_turn_off -%}\n {{ entity_list }}\n{%- else -%}\n\
|
||||
\ {{ [] }}\n{%- endif -%}"
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sun.sun
|
||||
attribute: elevation
|
||||
- platform: event
|
||||
event_type: call_service
|
||||
event_data:
|
||||
domain: light
|
||||
service: turn_on
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
mode: queued
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ debugging and trigger is not defined }}'
|
||||
sequence:
|
||||
- service: logger.set_level
|
||||
data:
|
||||
homeassistant.components.blueprint.dim_lights_based_on_sun_elevation: DEBUG
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ debugging and trigger.platform == ''homeassistant'' and
|
||||
trigger.event == ''start'' }}'
|
||||
sequence:
|
||||
- service: logger.set_level
|
||||
data:
|
||||
homeassistant.components.blueprint.dim_lights_based_on_sun_elevation: DEBUG
|
||||
default:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ error_msg|length }}'
|
||||
sequence:
|
||||
- service: system_log.write
|
||||
data:
|
||||
level: error
|
||||
logger: homeassistant.components.blueprint.dim_lights_based_on_sun_elevation
|
||||
message: '{{ error_msg }}'
|
||||
default:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ debugging }}'
|
||||
sequence:
|
||||
- service: system_log.write
|
||||
data:
|
||||
level: debug
|
||||
logger: homeassistant.components.blueprint.dim_lights_based_on_sun_elevation
|
||||
message: " DEBUG:\n skip_event: {{ skip_event }}\n allowance_value: {{\
|
||||
\ allowance_value }}\n affected_entities: {{ affected_entities }}\n\n\
|
||||
\ elevation: {{ elevation }} ({% if rising %}{{ start_rising ~ ', '\
|
||||
\ ~ end_rising }}{% else %}{{ start_setting ~ ', ' ~ end_setting }}{%\
|
||||
\ endif %})\n {% if last_elevation != \"\" -%}last elevation: {{ last_elevation\
|
||||
\ }}\n{% endif %} new brightness: {{ brightness }}\n {% if last_elevation\
|
||||
\ != \"\" -%}last brightness: {{ last_brightness }}\n{% endif %} \n\
|
||||
\ current_states: {{ current_states }}\n \n force_turn_on: {{ force_turn_on\
|
||||
\ }}\n force_turn_off: {{ force_turn_off }}\n \n entities: {{ entity_list\
|
||||
\ }}\n \n turn_on_entities: {{ turn_on_entities }}\n \n dim_entities:\
|
||||
\ {{ dim_entities }}\n \n turn_off_entities: {{ turn_off_entities }}\n\
|
||||
\ \n {% if trigger is defined %}Triggered by: {{ trigger.platform }}\n\
|
||||
{% endif %} {% if trigger is defined and trigger.platform == 'state'\
|
||||
\ and trigger.from_state.entity_id == 'sun.sun' -%} from: (elevation:\
|
||||
\ {{ trigger.from_state.attributes.elevation }}, azimuth: {{ trigger.from_state.attributes.azimuth\
|
||||
\ }})\n to: (elevation: {{ trigger.to_state.attributes.elevation }},\
|
||||
\ azimuth: {{ trigger.to_state.attributes.azimuth }})\n {% endif %}\
|
||||
\ {% if trigger is defined and trigger.platform == 'event' -%} entity_id:\
|
||||
\ {{ trigger.event.data.service_data.entity_id }}\n service_data_length:\
|
||||
\ {{ trigger.event.data.service_data|length }}\n complete event data:\
|
||||
\ {{ trigger.event.data }}\n {% endif %} "
|
||||
default: []
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ not skip_event and turn_off_entities|length > 0 }}'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
data:
|
||||
entity_id: '{{ turn_off_entities }}'
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ not skip_event and turn_on_entities|length > 0 }}'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
entity_id: '{{ turn_on_entities }}'
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ not skip_event and dim_entities|length > 0 }}'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
entity_id: '{{ dim_entities }}'
|
||||
brightness: '{{ brightness }}'
|
||||
transition: '{{ transition_time }}'
|
||||
default: []
|
||||
51
config/blueprints/automation/FabienYt/cover_immediate.yaml
Normal file
51
config/blueprints/automation/FabienYt/cover_immediate.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
blueprint:
|
||||
name: Cover - Immediate conditions
|
||||
description: 'Version: 1.0.1'
|
||||
domain: automation
|
||||
input:
|
||||
entities_condition:
|
||||
name: Immediate conditions
|
||||
description: Select all entities that match your immediate conditions
|
||||
selector:
|
||||
entity:
|
||||
multiple: true
|
||||
timer:
|
||||
name: Timer
|
||||
description: Timer used for remaining suspension time
|
||||
selector:
|
||||
entity:
|
||||
domain: timer
|
||||
multiple: false
|
||||
position:
|
||||
name: Desired roller shutter position
|
||||
selector:
|
||||
entity:
|
||||
domain: input_number
|
||||
multiple: false
|
||||
automation:
|
||||
name: Roller shutter positioning
|
||||
description: Automation containing roller shutter positioning rules
|
||||
selector:
|
||||
entity:
|
||||
domain: automation
|
||||
multiple: false
|
||||
source_url: https://github.com/FabienYt/home-assistant/blob/main/blueprints/automation/FabienYt/cover_immediate.yaml
|
||||
mode: restart
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: !input entities_condition
|
||||
action:
|
||||
- service: input_number.set_value
|
||||
target:
|
||||
entity_id: !input position
|
||||
data:
|
||||
value: -1
|
||||
- service: timer.cancel
|
||||
target:
|
||||
entity_id: !input timer
|
||||
- service: automation.trigger
|
||||
data:
|
||||
skip_condition: true
|
||||
target:
|
||||
entity_id: !input automation
|
||||
@@ -0,0 +1,137 @@
|
||||
blueprint:
|
||||
name: HASPone activates a selected page after a specified period of inactivity
|
||||
description: '
|
||||
|
||||
## Blueprint Version: `1.05.00`
|
||||
|
||||
|
||||
# Description
|
||||
|
||||
|
||||
Activates a selected page after a specified period of inactivity.
|
||||
|
||||
|
||||
## HASPone Page and Button Reference
|
||||
|
||||
|
||||
The images below show each available HASPone page along with the layout of available
|
||||
button objects.
|
||||
|
||||
|
||||
<details>
|
||||
|
||||
|
||||
| Page 0 | Pages 1-3 | Pages 4-5 |
|
||||
|
||||
|--------|-----------|-----------|
|
||||
|
||||
| 
|
||||
| 
|
||||
| 
|
||||
|
|
||||
|
||||
|
||||
| Page 6 | Page 7 | Page 8 |
|
||||
|
||||
|--------|--------|--------|
|
||||
|
||||
| 
|
||||
| 
|
||||
| 
|
||||
|
|
||||
|
||||
|
||||
| Page 9 | Page 10 | Page 11 |
|
||||
|
||||
|--------|---------|---------|
|
||||
|
||||
| 
|
||||
| 
|
||||
| 
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
'
|
||||
domain: automation
|
||||
input:
|
||||
haspdevice:
|
||||
name: HASPone Device
|
||||
description: Select the HASPone device
|
||||
selector:
|
||||
device:
|
||||
integration: mqtt
|
||||
manufacturer: HASwitchPlate
|
||||
model: HASPone v1.0.0
|
||||
multiple: false
|
||||
targetpage:
|
||||
name: Page to activate
|
||||
description: Select a destination page for this button to activate.
|
||||
default: 1
|
||||
selector:
|
||||
number:
|
||||
min: 1.0
|
||||
max: 11.0
|
||||
mode: slider
|
||||
unit_of_measurement: page
|
||||
step: 1.0
|
||||
idletime:
|
||||
name: Idle Time
|
||||
description: Idle time in seconds
|
||||
default: 30
|
||||
selector:
|
||||
number:
|
||||
min: 5.0
|
||||
max: 900.0
|
||||
step: 5.0
|
||||
mode: slider
|
||||
unit_of_measurement: seconds
|
||||
source_url: https://github.com/HASwitchPlate/HASPone/blob/main/Home_Assistant/blueprints/hasp_Activate_Page_on_Idle.yaml
|
||||
mode: restart
|
||||
max_exceeded: silent
|
||||
variables:
|
||||
haspdevice: !input haspdevice
|
||||
haspname: "{%- for entity in device_entities(haspdevice) -%}\n {%- if entity|regex_search(\"^sensor\\..+_sensor(?:_\\d+|)$\")
|
||||
-%}\n {{- entity|regex_replace(find=\"^sensor\\.\", replace=\"\", ignorecase=true)|regex_replace(find=\"_sensor(?:_\\d+|)$\",
|
||||
replace=\"\", ignorecase=true) -}}\n {%- endif -%}\n{%- endfor -%}"
|
||||
targetpage: !input targetpage
|
||||
idletime: !input idletime
|
||||
pagecommandtopic: '{{ "hasp/" ~ haspname ~ "/command/page" }}'
|
||||
activepage: "{%- set activepage = namespace() -%} {%- for entity in device_entities(haspdevice)
|
||||
-%}\n {%- if entity|regex_search(\"^number\\..*_active_page(?:_\\d+|)$\") -%}\n
|
||||
\ {%- set activepage.entity=entity -%}\n {%- endif -%}\n{%- endfor -%} {{ states(activepage.entity)
|
||||
| int(default=-1) }}"
|
||||
trigger_variables:
|
||||
haspdevice: !input haspdevice
|
||||
haspname: "{%- for entity in device_entities(haspdevice) -%}\n {%- if entity|regex_search(\"^sensor\\..+_sensor(?:_\\d+|)$\")
|
||||
-%}\n {{- entity|regex_replace(find=\"^sensor\\.\", replace=\"\", ignorecase=true)|regex_replace(find=\"_sensor(?:_\\d+|)$\",
|
||||
replace=\"\", ignorecase=true) -}}\n {%- endif -%}\n{%- endfor -%}"
|
||||
haspsensor: "{%- for entity in device_entities(haspdevice) -%}\n {%- if entity|regex_search(\"^sensor\\..+_sensor(?:_\\d+|)$\")
|
||||
-%}\n {{ entity }}\n {%- endif -%}\n{%- endfor -%}"
|
||||
jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
|
||||
targetpage: !input targetpage
|
||||
pagejsonpayload: '{"event":"page","value":{{targetpage}}}'
|
||||
trigger:
|
||||
- platform: mqtt
|
||||
topic: '{{jsontopic}}'
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ is_state(haspsensor, ''ON'') }}'
|
||||
- condition: template
|
||||
value_template: "{{-\n (trigger.payload_json.event is defined)\nand\n (trigger.payload_json.event
|
||||
== 'page')\nand\n (trigger.payload_json.value is defined)\nand\n (trigger.payload_json.value
|
||||
!= targetpage)\n-}}"
|
||||
action:
|
||||
- delay:
|
||||
seconds: '{{idletime|int}}'
|
||||
- condition: template
|
||||
value_template: "{%- set currentpage = namespace() -%} {%- for entity in device_entities(haspdevice)
|
||||
-%}\n {%- if entity|regex_search(\"^number\\..*_active_page(?:_\\d+|)$\") -%}\n
|
||||
\ {%- set currentpage.entity=entity -%}\n {%- endif -%}\n{%- endfor -%} {%-
|
||||
if states(currentpage.entity) == targetpage -%}\n {{false}}\n{%- else -%}\n {{true}}\n{%-
|
||||
endif -%}"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: '{{pagecommandtopic}}'
|
||||
payload: '{{targetpage}}'
|
||||
retain: true
|
||||
@@ -0,0 +1,544 @@
|
||||
blueprint:
|
||||
name: Aqara Magic Cube
|
||||
description: Control anything using Aqara Magic Cube.
|
||||
domain: automation
|
||||
input:
|
||||
remote:
|
||||
name: Magic Cube
|
||||
description: Select the Aqara Magic Cube device
|
||||
selector:
|
||||
device:
|
||||
integration: zha
|
||||
manufacturer: LUMI
|
||||
flip_90:
|
||||
name: Flip 90 degrees
|
||||
description: 'Actions to run when cube flips 90 degrees.
|
||||
|
||||
This cancels all specific 90 degrees functions.
|
||||
|
||||
e.g From side 1 to side 2 will be the same as from side 6 to side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_flip_90:
|
||||
name: Flip cube 90 degrees
|
||||
description: Action to run when cube flips 90 degrees. This only works if 'Flip
|
||||
90 degrees' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_180:
|
||||
name: Flip 180 degrees
|
||||
description: 'Actions to run when cube flips 180 degrees.
|
||||
|
||||
This cancels all specific 180 degrees functions
|
||||
|
||||
e.g From side 1 to side 4 will be the same as from side 5 to side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_flip_180:
|
||||
name: Flip cube 180 degrees
|
||||
description: Action to run when cube flips 180 degrees. This only works if 'Flip
|
||||
180 degrees' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_any_side:
|
||||
name: Slide any side
|
||||
description: 'Actions to run when cube slides on any side.
|
||||
|
||||
This cancels all specific ''slide'' functions
|
||||
|
||||
e.g Slide on side 1 will be the same as slide on side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_slide_any:
|
||||
name: Slide cube on any side
|
||||
description: Action to run when cube slides on any slide. This only works if
|
||||
'Slide any side' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
knock_any_side:
|
||||
name: Knock on any side
|
||||
description: 'Actions to run when knocking cube regardless of the side.
|
||||
|
||||
This cancels all specific ''knock'' functions
|
||||
|
||||
e.g Knock on side 1 will be the same as knocking side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_knock_any:
|
||||
name: Knock cube on any side
|
||||
description: Action to run when knocking cube on any side. This only works if
|
||||
'Knock on any side' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_two:
|
||||
name: From side 1 to side 2
|
||||
description: Action to run when cube goes from side 1 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_three:
|
||||
name: From side 1 to side 3
|
||||
description: Action to run when cube goes from side 1 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_four:
|
||||
name: From side 1 to side 4
|
||||
description: Action to run when cube goes from side 1 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_five:
|
||||
name: From side 1 to side 5
|
||||
description: Action to run when cube goes from side 1 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_six:
|
||||
name: From side 1 to side 6
|
||||
description: Action to run when cube goes from side 1 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_one:
|
||||
name: From side 2 to side 1
|
||||
description: Action to run when cube goes from side 2 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_three:
|
||||
name: From side 2 to side 3
|
||||
description: Action to run when cube goes from side 2 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_four:
|
||||
name: From side 2 to side 4
|
||||
description: Action to run when cube goes from side 2 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_five:
|
||||
name: From side 2 to side 5
|
||||
description: Action to run when cube goes from side 2 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_six:
|
||||
name: From side 2 to side 6
|
||||
description: Action to run when cube goes from side 2 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_one:
|
||||
name: From side 3 to side 1
|
||||
description: Action to run when cube goes from side 3 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_two:
|
||||
name: From side 3 to side 2
|
||||
description: Action to run when cube goes from side 3 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_four:
|
||||
name: From side 3 to side 4
|
||||
description: Action to run when cube goes from side 3 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_five:
|
||||
name: From side 3 to side 5
|
||||
description: Action to run when cube goes from side 3 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_six:
|
||||
name: From side 3 to side 6
|
||||
description: Action to run when cube goes from side 3 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_one:
|
||||
name: From side 4 to side 1
|
||||
description: Action to run when cube goes from side 4 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_two:
|
||||
name: From side 4 to side 2
|
||||
description: Action to run when cube goes from side 4 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_three:
|
||||
name: From side 4 to side 3
|
||||
description: Action to run when cube goes from side 4 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_five:
|
||||
name: From side 4 to side 5
|
||||
description: Action to run when cube goes from side 4 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_six:
|
||||
name: From side 4 to side 6
|
||||
description: Action to run when cube goes from side 4 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_one:
|
||||
name: From side 5 to side 1
|
||||
description: Action to run when cube goes from side 5 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_two:
|
||||
name: From side 5 to side 2
|
||||
description: Action to run when cube goes from side 5 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_three:
|
||||
name: From side 5 to side 3
|
||||
description: Action to run when cube goes from side 5 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_four:
|
||||
name: From side 5 to side 4
|
||||
description: Action to run when cube goes from side 5 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_six:
|
||||
name: From side 5 to side 6
|
||||
description: Action to run when cube goes from side 5 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_one:
|
||||
name: From side 6 to side 1
|
||||
description: Action to run when cube goes from side 6 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_two:
|
||||
name: From side 6 to side 2
|
||||
description: Action to run when cube goes from side 6 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_three:
|
||||
name: From side 6 to side 3
|
||||
description: Action to run when cube goes from side 6 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_four:
|
||||
name: From side 6 to side 4
|
||||
description: Action to run when cube goes from side 6 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_five:
|
||||
name: From side 6 to side 5
|
||||
description: Action to run when cube goes from side 6 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_one:
|
||||
name: Knock - Side 1
|
||||
description: Action to run when knocking on side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_two:
|
||||
name: Knock - Side 2
|
||||
description: Action to run when knocking on side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_three:
|
||||
name: Knock - Side 3
|
||||
description: Action to run when knocking on side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_four:
|
||||
name: Knock - Side 4
|
||||
description: Action to run when knocking on side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_five:
|
||||
name: Knock - Side 5
|
||||
description: Action to run when knocking on side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_six:
|
||||
name: Knock - Side 6
|
||||
description: Action to run when knocking on side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_one:
|
||||
name: Slide - Side 1 up
|
||||
description: Action to run when slides with Side 1 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_two:
|
||||
name: Slide - Side 2 up
|
||||
description: Action to run when slides with Side 2 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_three:
|
||||
name: Slide - Side 3 up
|
||||
description: Action to run when slides with Side 3 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_four:
|
||||
name: Slide - Side 4 up
|
||||
description: Action to run when slides with Side 4 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_five:
|
||||
name: Slide - Side 5 up
|
||||
description: Action to run when slides with Side 5 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_six:
|
||||
name: Slide - Side 6 up
|
||||
description: Action to run when slides with Side 6 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_wake:
|
||||
name: Wake up the cube
|
||||
description: Action to run when cube wakes up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_drop:
|
||||
name: Cube drops
|
||||
description: Action to run when cube drops
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_shake:
|
||||
name: Shake cube
|
||||
description: Action to run when you shake the cube
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right:
|
||||
name: Rotate right
|
||||
description: Action to run when cube rotates right
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left:
|
||||
name: Rotate left
|
||||
description: Action to run when cube rotates left
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
source_url: https://community.home-assistant.io/t/aqara-magic-cube-zha-51-actions/270829
|
||||
mode: restart
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: zha_event
|
||||
event_data:
|
||||
device_id: !input 'remote'
|
||||
action:
|
||||
- variables:
|
||||
command: '{{ trigger.event.data.command }}'
|
||||
value: '{{ trigger.event.data.args.value }}'
|
||||
flip_degrees: '{{ trigger.event.data.args.flip_degrees }}'
|
||||
relative_degrees: '{{ trigger.event.data.args.relative_degrees }}'
|
||||
flip_90: !input 'flip_90'
|
||||
flip_180: !input 'flip_180'
|
||||
slide_any_side: !input 'slide_any_side'
|
||||
knock_any_side: !input 'knock_any_side'
|
||||
flip90: 64
|
||||
flip180: 128
|
||||
slide: 256
|
||||
knock: 512
|
||||
shake: 0
|
||||
drop: 3
|
||||
activated_face: "\n{% if command == \"slide\" or command == \"knock\" %}\n\n \
|
||||
\ {% if trigger.event.data.args.activated_face == 1 %} 1\n\n {% elif trigger.event.data.args.activated_face\
|
||||
\ == 2 %} 5\n\n {% elif trigger.event.data.args.activated_face == 3 %} 6\n\n\
|
||||
\ {% elif trigger.event.data.args.activated_face == 4 %} 4\n\n {% elif trigger.event.data.args.activated_face\
|
||||
\ == 5 %} 2\n\n {% elif trigger.event.data.args.activated_face == 6 %} 3\n\n\
|
||||
\ {% endif %}\n\n{% elif command == 'flip' %}\n\n {{ trigger.event.data.args.activated_face\
|
||||
\ | int }}\n\n{% endif %}\n"
|
||||
from_face: "\n{% if command == \"flip\" and flip_degrees == 90 %}\n\n {{ ((value\
|
||||
\ - flip90 - (trigger.event.data.args.activated_face - 1)) / 8) + 1 | int }}\n\
|
||||
\n{% endif %}\n"
|
||||
- choose:
|
||||
- conditions:
|
||||
- '{{ command == ''rotate_right'' }}'
|
||||
sequence: !input 'rotate_right'
|
||||
- conditions:
|
||||
- '{{ command == ''rotate_left'' }}'
|
||||
sequence: !input 'rotate_left'
|
||||
- conditions:
|
||||
- '{{ command == ''checkin'' }}'
|
||||
sequence: !input 'cube_wake'
|
||||
- conditions:
|
||||
- '{{ value == shake }}'
|
||||
sequence: !input 'cube_shake'
|
||||
- conditions:
|
||||
- '{{ value == drop }}'
|
||||
sequence: !input 'cube_drop'
|
||||
- conditions:
|
||||
- '{{ command == ''knock'' and knock_any_side }}'
|
||||
sequence: !input 'cube_knock_any'
|
||||
- conditions:
|
||||
- '{{ command == ''slide'' and slide_any_side }}'
|
||||
sequence: !input 'cube_slide_any'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and flip_90 }}'
|
||||
sequence: !input 'cube_flip_90'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 180 and flip_180 }}'
|
||||
sequence: !input 'cube_flip_180'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_one'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_one'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_one'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_one'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 2 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_two'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_two'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_two'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_two'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 3 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_three'
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_three'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_three'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_three'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 4 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_four'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_four'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_four'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_four'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 5 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_five'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_five'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_five'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_five'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 6 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_six'
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_six'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_six'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_six'
|
||||
- conditions:
|
||||
- '{{ value == flip180 + activated_face - 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'four_to_one'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'five_to_two'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'six_to_three'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'one_to_four'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'two_to_five'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'three_to_six'
|
||||
- conditions:
|
||||
- '{{ value == knock + activated_face - 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'one_to_one'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'two_to_two'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'three_to_three'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'four_to_four'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'five_to_five'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'six_to_six'
|
||||
- conditions:
|
||||
- '{{ value == slide + activated_face - 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'slide_on_one'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'slide_on_two'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'slide_on_three'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'slide_on_four'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'slide_on_five'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'slide_on_six'
|
||||
1122
config/blueprints/automation/SgtBatten/Stable.yaml
Normal file
1122
config/blueprints/automation/SgtBatten/Stable.yaml
Normal file
File diff suppressed because it is too large
Load Diff
213
config/blueprints/automation/Twanne/smart_dimmer_version_3.yaml
Normal file
213
config/blueprints/automation/Twanne/smart_dimmer_version_3.yaml
Normal file
@@ -0,0 +1,213 @@
|
||||
blueprint:
|
||||
name: Smart Light Dimmer V3.0
|
||||
description: 'Version 3.0 ! BETA !
|
||||
|
||||
Switch or dim lights based on the value of a light sensor.
|
||||
|
||||
Light color and temperature can be specified (fixed value).
|
||||
|
||||
Settings for brightness, temperature and color above and below min and max values
|
||||
of the sensor can be set.
|
||||
|
||||
'
|
||||
source_url: https://gist.github.com/Twanne/56791e1917c751de7a72b16ee5e067cd
|
||||
domain: automation
|
||||
input:
|
||||
schedule_start:
|
||||
name: Schedule start time
|
||||
description: Automation only runs after this time.
|
||||
selector:
|
||||
time: {}
|
||||
schedule_stop:
|
||||
name: Schedule stop time
|
||||
description: Automation does not run after this time.
|
||||
selector:
|
||||
time: {}
|
||||
schedule_days:
|
||||
name: Run on these days
|
||||
description: 'Days on which the automation will run.
|
||||
|
||||
Write days in short form, seperated by punctuation marks and/or spaces.
|
||||
|
||||
(i.e.: mon, tue, wed,...)
|
||||
|
||||
'
|
||||
selector:
|
||||
text: {}
|
||||
light_sensor_entity:
|
||||
name: Light Sensor
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: illuminance
|
||||
multiple: false
|
||||
max_brightness_value:
|
||||
name: Maximum ambient light value
|
||||
description: Maximum ambient light value measured.
|
||||
default: 500
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 1000.0
|
||||
step: 10.0
|
||||
unit_of_measurement: lx
|
||||
mode: slider
|
||||
min_brightness_value:
|
||||
name: Minimum ambient light value
|
||||
description: Minimum ambient light value measured.
|
||||
default: 0
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 1000.0
|
||||
step: 10.0
|
||||
unit_of_measurement: lx
|
||||
mode: slider
|
||||
light_value_1:
|
||||
name: Dimming value 1
|
||||
description: Brightness of the light at maximum ambient light.
|
||||
default: 0
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 100.0
|
||||
step: 1.0
|
||||
mode: slider
|
||||
unit_of_measurement: '%'
|
||||
light_value_2:
|
||||
name: Dimming value 2
|
||||
description: Brightness of the light at minimum ambient light.
|
||||
default: 100
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 100.0
|
||||
step: 1.0
|
||||
mode: slider
|
||||
unit_of_measurement: '%'
|
||||
light_brightness_over_max:
|
||||
name: Brightness when over max ambient.
|
||||
description: Brightness of the light when the sensor measures over the maximum
|
||||
ambient light value.
|
||||
default: 0
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 100.0
|
||||
step: 1.0
|
||||
mode: slider
|
||||
unit_of_measurement: '%'
|
||||
light_temp_over_max:
|
||||
name: Light temperature when over max ambient.
|
||||
description: Temperature of the light when over maximum ambient light value.
|
||||
default: 2000
|
||||
selector:
|
||||
color_temp: {}
|
||||
light_color_over_max:
|
||||
name: Light color when over max ambient.
|
||||
description: Color of the light when over maximum ambient light value.
|
||||
selector:
|
||||
color_rgb: {}
|
||||
light_brightness_under_min:
|
||||
name: Brightness when under min ambient.
|
||||
description: Brightness of the light when the sensor measures under the minimum
|
||||
ambient light value.
|
||||
default: 100
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 100.0
|
||||
step: 1.0
|
||||
mode: slider
|
||||
unit_of_measurement: '%'
|
||||
light_temp_under_min:
|
||||
name: Light temperature when under min ambient.
|
||||
description: Temperature of the light when under minimum ambient light value.
|
||||
default: 2000
|
||||
selector:
|
||||
color_temp: {}
|
||||
light_color_under_min:
|
||||
name: Light color when under min ambient.
|
||||
description: Color of the light when over under minimum light value.
|
||||
selector:
|
||||
color_rgb: {}
|
||||
light_temp:
|
||||
name: Light temperature
|
||||
description: Temperature of the light when between minimum and maximum measured
|
||||
light values.
|
||||
default: 2000
|
||||
selector:
|
||||
color_temp: {}
|
||||
light_color:
|
||||
name: Light color
|
||||
description: Color of the light when between minimum and maximum measured light
|
||||
values.
|
||||
selector:
|
||||
color_rgb: {}
|
||||
target_light:
|
||||
name: Target lights
|
||||
description: which lights do you want to control?
|
||||
selector:
|
||||
target:
|
||||
entity:
|
||||
domain: light
|
||||
mode: single
|
||||
variables:
|
||||
light_sensor: !input light_sensor_entity
|
||||
maxB: !input max_brightness_value
|
||||
minB: !input min_brightness_value
|
||||
light1: !input light_value_1
|
||||
light2: !input light_value_2
|
||||
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
|
||||
constant: '{{ light1 - ( slope * maxB ) }}'
|
||||
days: !input schedule_days
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: !input light_sensor_entity
|
||||
condition:
|
||||
- condition: numeric_state
|
||||
entity_id: !input light_sensor_entity
|
||||
above: !input min_brightness_value
|
||||
- condition: time
|
||||
after: !input schedule_start
|
||||
before: !input schedule_stop
|
||||
- condition: template
|
||||
value_template: '{{ now().strftime(''%a'') | lower in days }}'
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: !input light_sensor_entity
|
||||
above: maxB
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
brightness_pct: !input light_brightness_over_max
|
||||
color_temp: !input light_temp_over_max
|
||||
color_rgb: !input light_color_over_max
|
||||
target: !input target_light
|
||||
- conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: !input light_sensor_entity
|
||||
below: minB
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
brightness_pct: !input light_brightness_under_min
|
||||
color_temp: !input light_temp_under_min
|
||||
color_rgb: !input light_color_under_min
|
||||
target: !input target_light
|
||||
- conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: !input light_sensor_entity
|
||||
below: maxB
|
||||
above: minB
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
brightness_pct: '{{ (( slope_brightness * states(light_sensor)|int ) + constant_brightness)|round
|
||||
}}'
|
||||
color_temp: '{{ (( slope_temperature * states(light_sensor)|int ) + constant_temperature)|round
|
||||
}}'
|
||||
color_rgb: !input light_color
|
||||
target: !input target_light
|
||||
@@ -0,0 +1,84 @@
|
||||
blueprint:
|
||||
name: Motion-activated Switch
|
||||
description: Turn on a switch when motion is detected.
|
||||
domain: automation
|
||||
input:
|
||||
motion_entity:
|
||||
name: Motion Sensor
|
||||
selector:
|
||||
entity:
|
||||
domain: binary_sensor
|
||||
device_class: motion
|
||||
lightsensor_entity:
|
||||
name: Illuminance Sensor
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: illuminance
|
||||
illuminace_level:
|
||||
name: Max Illuminance
|
||||
description: Maximal immuminance level in lux. If illuminance is higher, light
|
||||
will not be enabled
|
||||
default: 300
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 5000.0
|
||||
unit_of_measurement: lux
|
||||
mode: slider
|
||||
step: 1.0
|
||||
switch_target:
|
||||
name: Switch
|
||||
selector:
|
||||
target:
|
||||
entity:
|
||||
domain: switch
|
||||
time_from:
|
||||
name: Active from
|
||||
description: A time input which defines the time from which motion is detected
|
||||
selector:
|
||||
time: {}
|
||||
time_to:
|
||||
name: Active to
|
||||
description: A time input which defines the time to which motion is detected
|
||||
selector:
|
||||
time: {}
|
||||
no_motion_wait:
|
||||
name: Wait time
|
||||
description: Time to leave the light on after last motion is detected.
|
||||
default: 120
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 3600.0
|
||||
unit_of_measurement: seconds
|
||||
mode: slider
|
||||
step: 1.0
|
||||
source_url: https://community.home-assistant.io/t/turn-on-a-switch-when-motion-is-detected/255709
|
||||
mode: restart
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: !input 'motion_entity'
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: time
|
||||
after: !input 'time_from'
|
||||
before: !input 'time_to'
|
||||
- condition: numeric_state
|
||||
entity_id: !input 'lightsensor_entity'
|
||||
below: !input 'illuminace_level'
|
||||
action:
|
||||
- service: switch.turn_on
|
||||
target: !input 'switch_target'
|
||||
- wait_for_trigger:
|
||||
platform: state
|
||||
entity_id: !input 'motion_entity'
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
- delay: !input 'no_motion_wait'
|
||||
- service: switch.turn_off
|
||||
target: !input 'switch_target'
|
||||
121
config/blueprints/automation/argonaute199/thermostat_tpi.yaml
Normal file
121
config/blueprints/automation/argonaute199/thermostat_tpi.yaml
Normal file
@@ -0,0 +1,121 @@
|
||||
blueprint:
|
||||
name: Thermostat TPI
|
||||
description: Thermostat TPI (Time Propertional & Integral)
|
||||
domain: automation
|
||||
input:
|
||||
coeff_c:
|
||||
name: Coefficient C
|
||||
description: coefficient multiplicateur de la différence entre la consigne et
|
||||
éa température intérieure pour le calcul de la puissance (0.6 conseillé)
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 1.0
|
||||
step: 0.01
|
||||
mode: slider
|
||||
coeff_t:
|
||||
name: Coefficient T
|
||||
description: coefficient multiplicateur de la différence entre la consigne et
|
||||
éa température extérieure pour le calcul de la puissance (0.01 conseillé)
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 0.1
|
||||
step: 0.001
|
||||
mode: slider
|
||||
entity_consigne:
|
||||
name: Consigne
|
||||
description: Champs d'entrée de la température de consigne (input number).
|
||||
selector:
|
||||
entity:
|
||||
domain: input_number
|
||||
entity_temp_ext:
|
||||
name: Température extérieure
|
||||
description: Sonde de mesure de la température extérieure (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: temperature
|
||||
entity_temp_int:
|
||||
name: Température intérieure
|
||||
description: Sonde de mesure de la température intérieure (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: temperature
|
||||
entity_fenetre:
|
||||
name: Fenètre
|
||||
description: Capteur d'ouverture de fenêtre (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: binary_sensor
|
||||
device_class: opening
|
||||
entity_puissance:
|
||||
name: Puissance
|
||||
description: Champs d'affichage de la puissance (input_number)
|
||||
selector:
|
||||
entity:
|
||||
domain: input_number
|
||||
entity_chauffage:
|
||||
name: Chauffage
|
||||
description: Interrupteur marche / arrêt du chauffage (switch)
|
||||
selector:
|
||||
entity:
|
||||
domain: switch
|
||||
source_url: https://github.com/argonaute199/chauffage-home-assistant/blob/main/blueprint/thermostat_tpi.yaml
|
||||
variables:
|
||||
coeff_c: !input 'coeff_c'
|
||||
coeff_t: !input 'coeff_t'
|
||||
entity_temp_int: !input 'entity_temp_int'
|
||||
entity_temp_ext: !input 'entity_temp_ext'
|
||||
entity_fenetre: !input 'entity_fenetre'
|
||||
trigger:
|
||||
- platform: time_pattern
|
||||
minutes: /10
|
||||
- platform: state
|
||||
entity_id: !input 'entity_consigne'
|
||||
- platform: state
|
||||
entity_id: !input 'entity_fenetre'
|
||||
action:
|
||||
- alias: récupération des données
|
||||
variables:
|
||||
entity_consigne: !input 'entity_consigne'
|
||||
consigne: '{{states(entity_consigne)}}'
|
||||
temp_ext: '{{ states(entity_temp_ext) }}'
|
||||
temp_int: '{{ states(entity_temp_int) }}'
|
||||
fenetre: '{{states(entity_fenetre)}}'
|
||||
puissance: '{%set val = coeff_c * (consigne - temp_int) + coeff_t * (consigne
|
||||
- temp_ext) %} {% if val > 1 and fenetre == ''off'' %} {% set val = 100 %} {%
|
||||
elif val < 0 or fenetre == ''on'' %} {% set val = 0 %} {% else %} {% set val
|
||||
= ( (val * 100) | round(0)) %} {% endif %} {{val}}'
|
||||
temps_chauffe: '{{ puissance * 6 }}'
|
||||
- alias: Met à jour l'indicateur de puissance
|
||||
service: input_number.set_value
|
||||
target:
|
||||
entity_id: !input 'entity_puissance'
|
||||
data:
|
||||
value: '{{puissance}}'
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{puissance == 0}}'
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: !input 'entity_chauffage'
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ puissance > 99}}'
|
||||
sequence:
|
||||
- service: switch.turn_on
|
||||
target:
|
||||
entity_id: !input 'entity_chauffage'
|
||||
default:
|
||||
- service: switch.turn_on
|
||||
target:
|
||||
entity_id: !input 'entity_chauffage'
|
||||
- delay: '{{temps_chauffe}}'
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: !input 'entity_chauffage'
|
||||
mode: restart
|
||||
@@ -0,0 +1,46 @@
|
||||
blueprint:
|
||||
name: Door Sensor-activated Light
|
||||
description: Turn on a light when door is opened.
|
||||
domain: automation
|
||||
input:
|
||||
doorsensor_entity:
|
||||
name: Door Sensor
|
||||
selector:
|
||||
entity:
|
||||
domain: binary_sensor
|
||||
light_target:
|
||||
name: Light
|
||||
selector:
|
||||
target:
|
||||
entity:
|
||||
domain: light
|
||||
door_closed_wait:
|
||||
name: Wait time
|
||||
description: Time to leave the light on after door is closed
|
||||
default: 120
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 3600.0
|
||||
unit_of_measurement: seconds
|
||||
mode: slider
|
||||
step: 1.0
|
||||
source_url: https://community.home-assistant.io/t/door-sensor-turn-on-off-light/255657
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: !input 'doorsensor_entity'
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
action:
|
||||
- service: light.turn_on
|
||||
target: !input 'light_target'
|
||||
- wait_for_trigger:
|
||||
platform: state
|
||||
entity_id: !input 'doorsensor_entity'
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
- delay: !input 'door_closed_wait'
|
||||
- service: light.turn_off
|
||||
target: !input 'light_target'
|
||||
@@ -0,0 +1,617 @@
|
||||
blueprint:
|
||||
name: Aqara Magic Cube
|
||||
description: Control anything using Aqara Magic Cube.
|
||||
domain: automation
|
||||
input:
|
||||
remote:
|
||||
name: Magic Cube
|
||||
description: Select the Aqara Magic Cube device
|
||||
selector:
|
||||
device:
|
||||
integration: zha
|
||||
manufacturer: LUMI
|
||||
flip_90:
|
||||
name: Flip 90 degrees
|
||||
description: 'Actions to run when cube flips 90 degrees.
|
||||
|
||||
This cancels all specific 90 degrees functions.
|
||||
|
||||
e.g From side 1 to side 2 will be the same as from side 6 to side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_flip_90:
|
||||
name: Flip cube 90 degrees
|
||||
description: Action to run when cube flips 90 degrees. This only works if 'Flip
|
||||
90 degrees' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_180:
|
||||
name: Flip 180 degrees
|
||||
description: 'Actions to run when cube flips 180 degrees.
|
||||
|
||||
This cancels all specific 180 degrees functions
|
||||
|
||||
e.g From side 1 to side 4 will be the same as from side 5 to side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_flip_180:
|
||||
name: Flip cube 180 degrees
|
||||
description: Action to run when cube flips 180 degrees. This only works if 'Flip
|
||||
180 degrees' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_any:
|
||||
name: Flip to any side
|
||||
description: 'Actions to run when cube flips to any side.
|
||||
|
||||
This cares about the end side, but cancels all specific flip functions.
|
||||
|
||||
e.g From side 1 to side 2 will be the same as from side 6 to side 2
|
||||
|
||||
but different than side 1 to side 5'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_flip_1:
|
||||
name: Flip cube to side 1
|
||||
description: Action to run when cube flips to side 1. This only works if 'Flip
|
||||
any' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_flip_2:
|
||||
name: Flip cube to side 2
|
||||
description: Action to run when cube flips to side 2. This only works if 'Flip
|
||||
any' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_flip_3:
|
||||
name: Flip cube to side 3
|
||||
description: Action to run when cube flips to side 3. This only works if 'Flip
|
||||
any' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_flip_4:
|
||||
name: Flip cube to side 4
|
||||
description: Action to run when cube flips to side 4. This only works if 'Flip
|
||||
any' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_flip_5:
|
||||
name: Flip cube to side 5
|
||||
description: Action to run when cube flips to side 5. This only works if 'Flip
|
||||
any' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_flip_6:
|
||||
name: Flip cube to side 6
|
||||
description: Action to run when cube flips to side 6. This only works if 'Flip
|
||||
any' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_any_side:
|
||||
name: Slide any side
|
||||
description: 'Actions to run when cube slides on any side.
|
||||
|
||||
This cancels all specific ''slide'' functions
|
||||
|
||||
e.g Slide on side 1 will be the same as slide on side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_slide_any:
|
||||
name: Slide cube on any side
|
||||
description: Action to run when cube slides on any slide. This only works if
|
||||
'Slide any side' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
knock_any_side:
|
||||
name: Knock on any side
|
||||
description: 'Actions to run when knocking cube regardless of the side.
|
||||
|
||||
This cancels all specific ''knock'' functions
|
||||
|
||||
e.g Knock on side 1 will be the same as knocking side 2'
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
cube_knock_any:
|
||||
name: Knock cube on any side
|
||||
description: Action to run when knocking cube on any side. This only works if
|
||||
'Knock on any side' is toggled
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_two:
|
||||
name: From side 1 to side 2
|
||||
description: Action to run when cube goes from side 1 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_three:
|
||||
name: From side 1 to side 3
|
||||
description: Action to run when cube goes from side 1 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_four:
|
||||
name: From side 1 to side 4
|
||||
description: Action to run when cube goes from side 1 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_five:
|
||||
name: From side 1 to side 5
|
||||
description: Action to run when cube goes from side 1 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_six:
|
||||
name: From side 1 to side 6
|
||||
description: Action to run when cube goes from side 1 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_one:
|
||||
name: From side 2 to side 1
|
||||
description: Action to run when cube goes from side 2 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_three:
|
||||
name: From side 2 to side 3
|
||||
description: Action to run when cube goes from side 2 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_four:
|
||||
name: From side 2 to side 4
|
||||
description: Action to run when cube goes from side 2 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_five:
|
||||
name: From side 2 to side 5
|
||||
description: Action to run when cube goes from side 2 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_six:
|
||||
name: From side 2 to side 6
|
||||
description: Action to run when cube goes from side 2 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_one:
|
||||
name: From side 3 to side 1
|
||||
description: Action to run when cube goes from side 3 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_two:
|
||||
name: From side 3 to side 2
|
||||
description: Action to run when cube goes from side 3 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_four:
|
||||
name: From side 3 to side 4
|
||||
description: Action to run when cube goes from side 3 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_five:
|
||||
name: From side 3 to side 5
|
||||
description: Action to run when cube goes from side 3 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_six:
|
||||
name: From side 3 to side 6
|
||||
description: Action to run when cube goes from side 3 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_one:
|
||||
name: From side 4 to side 1
|
||||
description: Action to run when cube goes from side 4 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_two:
|
||||
name: From side 4 to side 2
|
||||
description: Action to run when cube goes from side 4 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_three:
|
||||
name: From side 4 to side 3
|
||||
description: Action to run when cube goes from side 4 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_five:
|
||||
name: From side 4 to side 5
|
||||
description: Action to run when cube goes from side 4 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_six:
|
||||
name: From side 4 to side 6
|
||||
description: Action to run when cube goes from side 4 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_one:
|
||||
name: From side 5 to side 1
|
||||
description: Action to run when cube goes from side 5 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_two:
|
||||
name: From side 5 to side 2
|
||||
description: Action to run when cube goes from side 5 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_three:
|
||||
name: From side 5 to side 3
|
||||
description: Action to run when cube goes from side 5 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_four:
|
||||
name: From side 5 to side 4
|
||||
description: Action to run when cube goes from side 5 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_six:
|
||||
name: From side 5 to side 6
|
||||
description: Action to run when cube goes from side 5 to side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_one:
|
||||
name: From side 6 to side 1
|
||||
description: Action to run when cube goes from side 6 to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_two:
|
||||
name: From side 6 to side 2
|
||||
description: Action to run when cube goes from side 6 to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_three:
|
||||
name: From side 6 to side 3
|
||||
description: Action to run when cube goes from side 6 to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_four:
|
||||
name: From side 6 to side 4
|
||||
description: Action to run when cube goes from side 6 to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_five:
|
||||
name: From side 6 to side 5
|
||||
description: Action to run when cube goes from side 6 to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
one_to_one:
|
||||
name: Knock - Side 1
|
||||
description: Action to run when knocking on side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
two_to_two:
|
||||
name: Knock - Side 2
|
||||
description: Action to run when knocking on side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
three_to_three:
|
||||
name: Knock - Side 3
|
||||
description: Action to run when knocking on side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
four_to_four:
|
||||
name: Knock - Side 4
|
||||
description: Action to run when knocking on side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
five_to_five:
|
||||
name: Knock - Side 5
|
||||
description: Action to run when knocking on side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
six_to_six:
|
||||
name: Knock - Side 6
|
||||
description: Action to run when knocking on side 6
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_one:
|
||||
name: Slide - Side 1 up
|
||||
description: Action to run when slides with Side 1 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_two:
|
||||
name: Slide - Side 2 up
|
||||
description: Action to run when slides with Side 2 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_three:
|
||||
name: Slide - Side 3 up
|
||||
description: Action to run when slides with Side 3 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_four:
|
||||
name: Slide - Side 4 up
|
||||
description: Action to run when slides with Side 4 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_five:
|
||||
name: Slide - Side 5 up
|
||||
description: Action to run when slides with Side 5 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_on_six:
|
||||
name: Slide - Side 6 up
|
||||
description: Action to run when slides with Side 6 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_wake:
|
||||
name: Wake up the cube
|
||||
description: Action to run when cube wakes up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_drop:
|
||||
name: Cube drops
|
||||
description: Action to run when cube drops
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
cube_shake:
|
||||
name: Shake cube
|
||||
description: Action to run when you shake the cube
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right:
|
||||
name: Rotate right
|
||||
description: Action to run when cube rotates right
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left:
|
||||
name: Rotate left
|
||||
description: Action to run when cube rotates left
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
source_url: https://community.home-assistant.io/t/zha-aqara-magic-cube-57-actions/297012
|
||||
mode: restart
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: zha_event
|
||||
event_data:
|
||||
device_id: !input 'remote'
|
||||
action:
|
||||
- variables:
|
||||
command: '{{ trigger.event.data.command }}'
|
||||
value: '{{ trigger.event.data.args.value | default(0) }}'
|
||||
flip_degrees: '{{ trigger.event.data.args.flip_degrees | default(0) }}'
|
||||
flip_any: !input 'flip_any'
|
||||
flip_90: !input 'flip_90'
|
||||
flip_180: !input 'flip_180'
|
||||
slide_any_side: !input 'slide_any_side'
|
||||
knock_any_side: !input 'knock_any_side'
|
||||
flip90: 64
|
||||
flip180: 128
|
||||
slide: 256
|
||||
knock: 512
|
||||
shake: 0
|
||||
drop: 3
|
||||
activated_face: "\n{% if command == \"slide\" or command == \"knock\" %}\n\n \
|
||||
\ {% if trigger.event.data.args.activated_face == 1 %} 1\n\n {% elif trigger.event.data.args.activated_face\
|
||||
\ == 2 %} 5\n\n {% elif trigger.event.data.args.activated_face == 3 %} 6\n\n\
|
||||
\ {% elif trigger.event.data.args.activated_face == 4 %} 4\n\n {% elif trigger.event.data.args.activated_face\
|
||||
\ == 5 %} 2\n\n {% elif trigger.event.data.args.activated_face == 6 %} 3\n\n\
|
||||
\ {% endif %}\n\n{% elif command == 'flip' %}\n\n {{ trigger.event.data.args.activated_face\
|
||||
\ | int }}\n\n{% endif %}\n"
|
||||
from_face: "\n{% if command == \"flip\" and flip_degrees == 90 %}\n\n {{ ((value\
|
||||
\ - flip90 - (trigger.event.data.args.activated_face - 1)) / 8) + 1 | int }}\n\
|
||||
\n{% endif %}\n"
|
||||
relative_degrees: "\n{% if command == \"rotate_right\" or command == \"rotate_left\"\
|
||||
\ %}\n\n {{ trigger.event.data.args.relative_degrees | float }}\n\n{% endif\
|
||||
\ %}\n"
|
||||
- choose:
|
||||
- conditions:
|
||||
- '{{ command == ''rotate_right'' }}'
|
||||
sequence: !input 'rotate_right'
|
||||
- conditions:
|
||||
- '{{ command == ''rotate_left'' }}'
|
||||
sequence: !input 'rotate_left'
|
||||
- conditions:
|
||||
- '{{ command == ''checkin'' }}'
|
||||
sequence: !input 'cube_wake'
|
||||
- conditions:
|
||||
- '{{ value == shake }}'
|
||||
sequence: !input 'cube_shake'
|
||||
- conditions:
|
||||
- '{{ value == drop }}'
|
||||
sequence: !input 'cube_drop'
|
||||
- conditions:
|
||||
- '{{ command == ''knock'' and knock_any_side }}'
|
||||
sequence: !input 'cube_knock_any'
|
||||
- conditions:
|
||||
- '{{ command == ''slide'' and slide_any_side }}'
|
||||
sequence: !input 'cube_slide_any'
|
||||
- conditions:
|
||||
- '{{ command == ''flip'' and flip_any }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'cube_flip_1'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'cube_flip_2'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'cube_flip_3'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'cube_flip_4'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'cube_flip_5'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'cube_flip_6'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and flip_90 }}'
|
||||
sequence: !input 'cube_flip_90'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 180 and flip_180 }}'
|
||||
sequence: !input 'cube_flip_180'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_one'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_one'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_one'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_one'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 2 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_two'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_two'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_two'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_two'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 3 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_three'
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_three'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_three'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_three'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 4 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_four'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_four'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_four'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_four'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 5 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_five'
|
||||
- conditions: '{{ from_face == 3 }}'
|
||||
sequence: !input 'three_to_five'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_five'
|
||||
- conditions: '{{ from_face == 6 }}'
|
||||
sequence: !input 'six_to_five'
|
||||
- conditions:
|
||||
- '{{ flip_degrees == 90 and activated_face == 6 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ from_face == 1 }}'
|
||||
sequence: !input 'one_to_six'
|
||||
- conditions: '{{ from_face == 2 }}'
|
||||
sequence: !input 'two_to_six'
|
||||
- conditions: '{{ from_face == 4 }}'
|
||||
sequence: !input 'four_to_six'
|
||||
- conditions: '{{ from_face == 5 }}'
|
||||
sequence: !input 'five_to_six'
|
||||
- conditions:
|
||||
- '{{ value == flip180 + activated_face - 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'four_to_one'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'five_to_two'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'six_to_three'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'one_to_four'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'two_to_five'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'three_to_six'
|
||||
- conditions:
|
||||
- '{{ command == ''knock'' and not knock_any_side }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'one_to_one'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'two_to_two'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'three_to_three'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'four_to_four'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'five_to_five'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'six_to_six'
|
||||
- conditions:
|
||||
- '{{ value == slide + activated_face - 1 }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ activated_face == 1 }}'
|
||||
sequence: !input 'slide_on_one'
|
||||
- conditions: '{{ activated_face == 2 }}'
|
||||
sequence: !input 'slide_on_two'
|
||||
- conditions: '{{ activated_face == 3 }}'
|
||||
sequence: !input 'slide_on_three'
|
||||
- conditions: '{{ activated_face == 4 }}'
|
||||
sequence: !input 'slide_on_four'
|
||||
- conditions: '{{ activated_face == 5 }}'
|
||||
sequence: !input 'slide_on_five'
|
||||
- conditions: '{{ activated_face == 6 }}'
|
||||
sequence: !input 'slide_on_six'
|
||||
77
config/blueprints/automation/chaudiere/chaudiere
Normal file
77
config/blueprints/automation/chaudiere/chaudiere
Normal file
@@ -0,0 +1,77 @@
|
||||
blueprint:
|
||||
name: Thermostat chaudiere bois
|
||||
description: Thermostat chaudiere bois
|
||||
domain: automation
|
||||
|
||||
input:
|
||||
entity_consigne:
|
||||
name: Consigne
|
||||
description: Champ d'entrée de la consigne du thermostat (input number).
|
||||
selector:
|
||||
entity:
|
||||
domain: input_number
|
||||
|
||||
entity_mode:
|
||||
name: mode_on_off
|
||||
description: mode on off
|
||||
selector:
|
||||
entity:
|
||||
domain: input_boolean
|
||||
|
||||
entity_temp_ext:
|
||||
name: Température extérieure
|
||||
description: Sonde de mesure de la température extérieure (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: temperature
|
||||
entity_temp_int:
|
||||
name: Température intérieure
|
||||
description: Sonde de mesure de la température intérieure (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: temperature
|
||||
entity_temp_chaud:
|
||||
name: Température chaudiere bois
|
||||
description: Sonde de mesure de la température chaudiere bois (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: temperature
|
||||
entity_temp_ballon:
|
||||
name: Température ballon
|
||||
description: Sonde de mesure de la température du ballon (sensor)
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: temperature
|
||||
delta_thermostat:
|
||||
name: delta temperature thermostat
|
||||
description: delta de temperature entre consigne et temperature salon (0.6 conseillé)
|
||||
selector:
|
||||
number:
|
||||
min: 0.0
|
||||
max: 2.0
|
||||
step: 0.1
|
||||
|
||||
|
||||
entity_circulateur:
|
||||
name: Circulateur
|
||||
description: marche / arrêt du circulateur (switch)
|
||||
selector:
|
||||
entity:
|
||||
domain: switch
|
||||
|
||||
# Récupération des paramètres
|
||||
variables:
|
||||
entity_temp_int: !input entity_temp_int
|
||||
entity_temp_ext: !input entity_temp_ext
|
||||
entity_consigne: !input entity_consigne
|
||||
entity_mode: !input entity_mode
|
||||
entity_temp_chaud: !input entity_temp_chaud
|
||||
entity_temp_ballon: !input entity_temp_ballon
|
||||
entity_delta_th: !input delta_thermostat
|
||||
|
||||
mode: restart
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
blueprint:
|
||||
name: Turn on light, switch, scene, script or group based on motion and illuminance.
|
||||
description: "Turn on a light, switch, scene, script or group based on motion detection,\
|
||||
\ and low light level.\nThis blueprint uses helper entities you have to create\
|
||||
\ yourself for some input values, to be able to dynamically set limits. For instructions\
|
||||
\ on creating the helper entities take a look in the Home Assistant Community\
|
||||
\ forum topic: https://community.home-assistant.io/t/turn-on-light-switch-scene-or-script-based-on-motion-and-illuminance-more-conditions/257085\n\
|
||||
\nRequired entities:\n - Motion sensor (single sensor or group)\n - Target entity\
|
||||
\ (light, switch, scene or script)\n\n\nOptional features:\n- You can set a cutoff\
|
||||
\ entity of which the value determines whether the illuminance level is low and\
|
||||
\ the automation needs to trigger. - You can define a blocking entity, which blocks\
|
||||
\ the automation from running when this entity's state is on. - You van define\
|
||||
\ a turn-off blocking entity, which blocks the entity from turning off after the\
|
||||
\ set delay. - Time limits can also be defined to limit the time before and after\
|
||||
\ the automation should trigger. - If you want the entity to turn off after a\
|
||||
\ certain amount of minutes, you can use the Wait Time input. - If you want another\
|
||||
\ entity than the target_entity to turn off after the delay, you can define a\
|
||||
\ separate Turn-off entity. - If you do not enable the optional entities the automation\
|
||||
\ will skip these conditions.\n\n\nOptional entities:\n- Illuminance sensor (sensor\
|
||||
\ in illuminance class)\n- Illuminance cutoff value (input_number)\n- Blocking\
|
||||
\ entity (any entity with state on/off)\n- Time limit before (input_datetime)\n\
|
||||
- Time limit after (input_datetime)\n- Turn off wait time [in minutes!] (input_number)\
|
||||
\ - will not work with script or scene target entities.\n- Turn off entity (any\
|
||||
\ entity_id)\n"
|
||||
domain: automation
|
||||
input:
|
||||
motion_sensor:
|
||||
name: Motion Sensor
|
||||
description: This sensor will trigger the turning on of the target entity.
|
||||
selector:
|
||||
entity: {}
|
||||
target_entity:
|
||||
name: Target entity.
|
||||
description: The light, switch, scene to turn on (or script to run) when the
|
||||
automation is triggered.
|
||||
selector:
|
||||
entity: {}
|
||||
illuminance_sensor:
|
||||
name: (OPTIONAL) Illuminance sensor
|
||||
description: This sensor will be used to determine the illumination.
|
||||
default:
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
device_class: illuminance
|
||||
illuminance_cutoff:
|
||||
name: (OPTIONAL) Illuminance cutoff value
|
||||
description: This input_number will be used to compare to the current illumination
|
||||
to determine if it is low.
|
||||
default:
|
||||
selector:
|
||||
entity:
|
||||
domain: input_number
|
||||
blocker_entity:
|
||||
name: (OPTIONAL) Blocking entity
|
||||
description: If this entity's state is on, it will prevent the automation from
|
||||
running. E.g. sleepmode or away mode.
|
||||
default:
|
||||
selector:
|
||||
entity: {}
|
||||
time_limit_after:
|
||||
name: (OPTIONAL) Only run after time.
|
||||
description: Automation will only run when time is later than this input_datetime
|
||||
value.
|
||||
default:
|
||||
selector:
|
||||
entity:
|
||||
domain: input_datetime
|
||||
time_limit_before:
|
||||
name: (OPTIONAL) Only run before time.
|
||||
description: Automation will only run when time is earlier than this input_datetime
|
||||
value.
|
||||
default:
|
||||
selector:
|
||||
entity:
|
||||
domain: input_datetime
|
||||
no_motion_wait:
|
||||
name: (OPTIONAL) Turn off wait time (minutes)
|
||||
description: Time in minutes to leave the target entity on after last motion
|
||||
is detected. If not used entity will not auto turn off.
|
||||
default:
|
||||
selector:
|
||||
entity:
|
||||
domain: input_number
|
||||
turn_off_blocker_entity:
|
||||
name: (OPTIONAL) Turn-off Blocking entity
|
||||
description: If this entity's state is on, it will prevent the target entity
|
||||
from turning off after the set delay.
|
||||
default:
|
||||
selector:
|
||||
entity: {}
|
||||
target_off_entity:
|
||||
name: (OPTIONAL) Turn-off entity
|
||||
description: If defined, this entity will be turned off instead of the default
|
||||
target entity. This can be helpful when using target entities of type scene
|
||||
or script.
|
||||
default:
|
||||
selector:
|
||||
entity: {}
|
||||
source_url: https://gist.github.com/freakshock88/2311759ba64f929f6affad4c0a67110b
|
||||
mode: restart
|
||||
max_exceeded: silent
|
||||
variables:
|
||||
target_entity: !input 'target_entity'
|
||||
illuminance_currently: !input 'illuminance_sensor'
|
||||
illuminance_cutoff: !input 'illuminance_cutoff'
|
||||
blocker_entity: !input 'blocker_entity'
|
||||
time_limit_before: !input 'time_limit_before'
|
||||
time_limit_after: !input 'time_limit_after'
|
||||
no_motion_wait: !input 'no_motion_wait'
|
||||
entity_domain: '{{ states[target_entity].domain }}'
|
||||
turn_off_blocker_entity: !input 'turn_off_blocker_entity'
|
||||
target_off_entity: !input 'target_off_entity'
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: !input 'motion_sensor'
|
||||
to: 'on'
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ (states[target_entity].state == ''on'') or (illuminance_currently
|
||||
== none) or (illuminance_cutoff == none) or (states[illuminance_currently].state
|
||||
| int < states[illuminance_cutoff].state | int) }}'
|
||||
- condition: template
|
||||
value_template: '{{ (blocker_entity == none) or (states[blocker_entity].state ==
|
||||
''off'') }}'
|
||||
- condition: template
|
||||
value_template: "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before\
|
||||
\ == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before\
|
||||
\ != none and time_limit_after == none %} {% set current_time_is_before_limit\
|
||||
\ = current_time < states[time_limit_before].state %} {{ current_time_is_before_limit\
|
||||
\ }} {% elif time_limit_before == none and time_limit_after != none %} {% set\
|
||||
\ current_time_is_after_limit = current_time > states[time_limit_after].state\
|
||||
\ %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before !=\
|
||||
\ none and time_limit_after != none %} {% set before_limit_is_tomorrow = states[time_limit_before].state\
|
||||
\ < states[time_limit_after].state %} {% set current_time_is_before_limit = current_time\
|
||||
\ < states[time_limit_before].state %} {% set current_time_is_after_limit = current_time\
|
||||
\ > states[time_limit_after].state %} {% set time_window_spans_midnight = states[time_limit_after].state\
|
||||
\ > states[time_limit_before].state %}\n {% if time_window_spans_midnight !=\
|
||||
\ none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit\
|
||||
\ or current_time_is_before_limit }}\n {% elif time_window_spans_midnight !=\
|
||||
\ none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit\
|
||||
\ and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n"
|
||||
action:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: !input 'target_entity'
|
||||
- condition: template
|
||||
value_template: '{{ no_motion_wait != none }}'
|
||||
- wait_for_trigger:
|
||||
platform: state
|
||||
entity_id: !input 'motion_sensor'
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
- delay:
|
||||
minutes: '{{ states[no_motion_wait].state | int }}'
|
||||
- condition: template
|
||||
value_template: '{{ (turn_off_blocker_entity == none) or (states[turn_off_blocker_entity].state
|
||||
== ''off'') }}'
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: '{{ (target_off_entity != none) }}'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: !input 'target_off_entity'
|
||||
default:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: !input 'target_entity'
|
||||
@@ -0,0 +1,288 @@
|
||||
blueprint:
|
||||
name: Zigbee2MQTT - Aqara Magic Cube (MFKZQ01LM)
|
||||
description: 'This blueprint allows you to make automations for the Aqara Magic
|
||||
Cube, connected to Zigbee2MQTT.
|
||||
|
||||
|
||||
Limitations (these are by design):
|
||||
|
||||
- There is just one trigger for flip to a side, separate actions for flip90 and
|
||||
flip180 aren''t possible.
|
||||
|
||||
- For fall there are no separate actions for the side, due to the nature of falling
|
||||
it becomes random what will happen.
|
||||
|
||||
- For shake there are no separate actions for the side, due to the nature of shaking
|
||||
it isn''t always clear which side is up.
|
||||
|
||||
'
|
||||
domain: automation
|
||||
source_url: https://github.com/golles/Home-Assistant-Blueprints/blob/9a63ee03f1d0cf10448fb89a28528ac4105461ac/zigbee2mqtt_aqara_magic_cube.yaml
|
||||
input:
|
||||
remote:
|
||||
name: Remote
|
||||
description: Aqara Magic Cube to use, entity should end with _action
|
||||
selector:
|
||||
entity:
|
||||
integration: mqtt
|
||||
domain: sensor
|
||||
fall:
|
||||
name: Drop the cube
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_side_0:
|
||||
name: Flip the cube to side 0
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_side_1:
|
||||
name: Flip the cube to side 1
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_side_2:
|
||||
name: Flip the cube to side 2
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_side_3:
|
||||
name: Flip the cube to side 3
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_side_4:
|
||||
name: Flip the cube to side 4
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
flip_side_5:
|
||||
name: Flip the cube to side 5
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left_side_0:
|
||||
name: Rotate cube left with side 0 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left_side_1:
|
||||
name: Rotate cube left with side 1 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left_side_2:
|
||||
name: Rotate cube left with side 2 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left_side_3:
|
||||
name: Rotate cube left with side 3 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left_side_4:
|
||||
name: Rotate cube left with side 4 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_left_side_5:
|
||||
name: Rotate cube left with side 5 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right_side_0:
|
||||
name: Rotate cube right with side 0 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right_side_1:
|
||||
name: Rotate cube right with side 1 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right_side_2:
|
||||
name: Rotate cube right with side 2 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right_side_3:
|
||||
name: Rotate cube right with side 3 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right_side_4:
|
||||
name: Rotate cube right with side 4 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
rotate_right_side_5:
|
||||
name: Rotate cube right with side 5 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
shake:
|
||||
name: Shake the cube
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_side_0:
|
||||
name: Slide the cube with side 0 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_side_1:
|
||||
name: Slide the cube with side 1 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_side_2:
|
||||
name: Slide the cube with side 2 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_side_3:
|
||||
name: Slide the cube with side 3 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_side_4:
|
||||
name: Slide the cube with side 4 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
slide_side_5:
|
||||
name: Slide the cube with side 5 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
tap_side_0:
|
||||
name: Tap the cube with side 0 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
tap_side_1:
|
||||
name: Tap the cube with side 1 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
tap_side_2:
|
||||
name: Tap the cube with side 2 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
tap_side_3:
|
||||
name: Tap the cube with side 3 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
tap_side_4:
|
||||
name: Tap the cube with side 4 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
tap_side_5:
|
||||
name: Tap the cube with side 5 up
|
||||
default: []
|
||||
selector:
|
||||
action: {}
|
||||
mode: queued
|
||||
max: 5
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: !input 'remote'
|
||||
attribute: action
|
||||
to:
|
||||
- fall
|
||||
- flip180
|
||||
- flip90
|
||||
- rotate_left
|
||||
- rotate_right
|
||||
- shake
|
||||
- slide
|
||||
- tap
|
||||
action:
|
||||
- variables:
|
||||
event: '{{ trigger.to_state.attributes.action }}'
|
||||
side: '{{ trigger.to_state.attributes.side }}'
|
||||
- choose:
|
||||
- conditions: '{{ event == "fall" }}'
|
||||
sequence: !input 'fall'
|
||||
- conditions: '{{ event == "flip180" or event == "flip90" }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ side == 0 }}'
|
||||
sequence: !input 'flip_side_0'
|
||||
- conditions: '{{ side == 1 }}'
|
||||
sequence: !input 'flip_side_1'
|
||||
- conditions: '{{ side == 2 }}'
|
||||
sequence: !input 'flip_side_2'
|
||||
- conditions: '{{ side == 3 }}'
|
||||
sequence: !input 'flip_side_3'
|
||||
- conditions: '{{ side == 4 }}'
|
||||
sequence: !input 'flip_side_4'
|
||||
- conditions: '{{ side == 5 }}'
|
||||
sequence: !input 'flip_side_5'
|
||||
- conditions: '{{ event == "rotate_left" }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ side == 0 }}'
|
||||
sequence: !input 'rotate_left_side_0'
|
||||
- conditions: '{{ side == 1 }}'
|
||||
sequence: !input 'rotate_left_side_1'
|
||||
- conditions: '{{ side == 2 }}'
|
||||
sequence: !input 'rotate_left_side_2'
|
||||
- conditions: '{{ side == 3 }}'
|
||||
sequence: !input 'rotate_left_side_3'
|
||||
- conditions: '{{ side == 4 }}'
|
||||
sequence: !input 'rotate_left_side_4'
|
||||
- conditions: '{{ side == 5 }}'
|
||||
sequence: !input 'rotate_left_side_5'
|
||||
- conditions: '{{ event == "rotate_right" }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ side == 0 }}'
|
||||
sequence: !input 'rotate_right_side_0'
|
||||
- conditions: '{{ side == 1 }}'
|
||||
sequence: !input 'rotate_right_side_1'
|
||||
- conditions: '{{ side == 2 }}'
|
||||
sequence: !input 'rotate_right_side_2'
|
||||
- conditions: '{{ side == 3 }}'
|
||||
sequence: !input 'rotate_right_side_3'
|
||||
- conditions: '{{ side == 4 }}'
|
||||
sequence: !input 'rotate_right_side_4'
|
||||
- conditions: '{{ side == 5 }}'
|
||||
sequence: !input 'rotate_right_side_5'
|
||||
- conditions: '{{ event == "shake" }}'
|
||||
sequence: !input 'shake'
|
||||
- conditions: '{{ event == "slide" }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ side == 0 }}'
|
||||
sequence: !input 'slide_side_0'
|
||||
- conditions: '{{ side == 1 }}'
|
||||
sequence: !input 'slide_side_1'
|
||||
- conditions: '{{ side == 2 }}'
|
||||
sequence: !input 'slide_side_2'
|
||||
- conditions: '{{ side == 3 }}'
|
||||
sequence: !input 'slide_side_3'
|
||||
- conditions: '{{ side == 4 }}'
|
||||
sequence: !input 'slide_side_4'
|
||||
- conditions: '{{ side == 5 }}'
|
||||
sequence: !input 'slide_side_5'
|
||||
- conditions: '{{ event == "tap" }}'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: '{{ side == 0 }}'
|
||||
sequence: !input 'tap_side_0'
|
||||
- conditions: '{{ side == 1 }}'
|
||||
sequence: !input 'tap_side_1'
|
||||
- conditions: '{{ side == 2 }}'
|
||||
sequence: !input 'tap_side_2'
|
||||
- conditions: '{{ side == 3 }}'
|
||||
sequence: !input 'tap_side_3'
|
||||
- conditions: '{{ side == 4 }}'
|
||||
sequence: !input 'tap_side_4'
|
||||
- conditions: '{{ side == 5 }}'
|
||||
sequence: !input 'tap_side_5'
|
||||
@@ -3,15 +3,13 @@ blueprint:
|
||||
description: Turn on a light when motion is detected.
|
||||
domain: automation
|
||||
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
||||
author: Home Assistant
|
||||
input:
|
||||
motion_entity:
|
||||
name: Motion Sensor
|
||||
selector:
|
||||
entity:
|
||||
filter:
|
||||
device_class: motion
|
||||
domain: binary_sensor
|
||||
domain: binary_sensor
|
||||
device_class: motion
|
||||
light_target:
|
||||
name: Light
|
||||
selector:
|
||||
|
||||
@@ -3,27 +3,23 @@ blueprint:
|
||||
description: Send a notification to a device when a person leaves a specific zone.
|
||||
domain: automation
|
||||
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
|
||||
author: Home Assistant
|
||||
input:
|
||||
person_entity:
|
||||
name: Person
|
||||
selector:
|
||||
entity:
|
||||
filter:
|
||||
domain: person
|
||||
domain: person
|
||||
zone_entity:
|
||||
name: Zone
|
||||
selector:
|
||||
entity:
|
||||
filter:
|
||||
domain: zone
|
||||
domain: zone
|
||||
notify_device:
|
||||
name: Device to notify
|
||||
description: Device needs to run the official Home Assistant app to receive notifications.
|
||||
selector:
|
||||
device:
|
||||
filter:
|
||||
integration: mobile_app
|
||||
integration: mobile_app
|
||||
|
||||
trigger:
|
||||
platform: state
|
||||
@@ -38,9 +34,7 @@ variables:
|
||||
|
||||
condition:
|
||||
condition: template
|
||||
# The first case handles leaving the Home zone which has a special state when zoning called 'home'.
|
||||
# The second case handles leaving all other zones.
|
||||
value_template: "{{ zone_entity == 'zone.home' and trigger.from_state.state == 'home' and trigger.to_state.state != 'home' or trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}"
|
||||
value_template: "{{ trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}"
|
||||
|
||||
action:
|
||||
- alias: "Notify that a person has left the zone"
|
||||
|
||||
Reference in New Issue
Block a user