Add script lights_off_except
This commit is contained in:
parent
0042b62652
commit
918cfe2c88
1 changed files with 24 additions and 0 deletions
|
|
@ -126,6 +126,30 @@ in
|
|||
platform = "bluetooth_le_tracker";
|
||||
}
|
||||
];
|
||||
script = [
|
||||
{
|
||||
lights_off_except = {
|
||||
icon = "mdi:home-lightbulb";
|
||||
fields.exclude_lights.description = "Excluded lights as list";
|
||||
sequence = [
|
||||
{
|
||||
service = "logbook.log";
|
||||
data_template = {
|
||||
entity_id = "script.turn_off_lights";
|
||||
name = "Exclude log";
|
||||
message = "Turning of all lights except: {{ exclude_lights }}";
|
||||
};
|
||||
}
|
||||
{
|
||||
service = "light.turn_off";
|
||||
data_template.entity_id = ''
|
||||
{{ states.light | rejectattr('entity_id', 'in', exclude_lights) | rejectattr('state', 'in', 'off') | join(',', attribute='entity_id') }}
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue