Last active
July 6, 2022 12:13
-
-
Save TheQue42/b959d6ed3412b8d947fa3d03e4e6babb to your computer and use it in GitHub Desktop.
Revisions
-
TheQue42 revised this gist
Jul 6, 2022 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,10 +25,9 @@ blueprint: Only entities are supported, devices must be expanded default: [] selector: target: entity: device_class: temperature exclude_regexp: name: Excluded Sensors, RegExp description: > -
TheQue42 revised this gist
Jul 6, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ blueprint: name: BP-Battery Temp Checker description: Regularly test any entity with the "battery" string, for high temp! domain: automation input: -
TheQue42 revised this gist
Jul 6, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,7 +49,7 @@ variables: sensors: >- {%- set result = namespace(sensors=[]) -%} {%- for s in states.sensor | selectattr('attributes.device_class', '==', 'temperature') -%} {%- if (s.entity_id is search("battery") and (not s.entity_id in exclude and not s.entity_id is search(exclude_regexp))) and s.state|float > max_value|float -%} {%- set result.sensors = result.sensors + [s.entity_id] -%} {% endif -%} {%- endfor -%} -
TheQue42 revised this gist
Jul 6, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ blueprint: name: BP: Battery Temp Checker description: Regularly test any entity with the "battery" string, for high temp! domain: automation input: -
TheQue42 revised this gist
Jul 6, 2022 . No changes.There are no files selected for viewing
-
TheQue42 revised this gist
Jul 6, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,8 +48,8 @@ variables: max_value: !input 'max_temp' sensors: >- {%- set result = namespace(sensors=[]) -%} {%- for s in states.sensor | selectattr('attributes.device_class', '==', 'temperature') -%} {%- if (s.entity_id is search("battery") and (not s.entity_id in exclude and not s.entity_id is search(exclude_regexp))) and s.state|float > max_temp|float -%} {%- set result.sensors = result.sensors + [s.entity_id] -%} {% endif -%} {%- endfor -%} -
TheQue42 revised this gist
Jul 6, 2022 . 1 changed file with 13 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ blueprint: name: Battery temperatur checker description: Regularly test any entity with the "battery" string, for high temp! domain: automation input: repetition: @@ -10,6 +10,14 @@ blueprint: selector: text: multiline: false max_temp: name: Max Temp description: Temperature at which alarm is generated default: '40' selector: number: min: 20 max: 80 exclude: name: Excluded Sensors description: > @@ -20,7 +28,6 @@ blueprint: entity: multiple: true domain: - sensor exclude_regexp: name: Excluded Sensors, RegExp @@ -32,24 +39,20 @@ blueprint: multiline: false actions: name: Actions description: 'Notifications or similar to be run. {{sensors}} is replaced with the names[] of devices indicating high temp' selector: action: {} variables: exclude: !input 'exclude' exclude_regexp: !input 'exclude_regexp' max_value: !input 'max_temp' sensors: >- {%- set result = namespace(sensors=[]) -%} {%- for s in states.sensor -%} {%- if (s.entity_id is search("battery") and state_attr(s.entity_id, "device_class") == "temperature" ) and (not s.entity_id in exclude and not s.entity_id is search(exclude_regexp)) and s.state|float > max_temp|float -%} {%- set result.sensors = result.sensors + [s.entity_id] -%} {% endif -%} {%- endfor -%} {{result.sensors}} trigger: - platform: time_pattern -
TheQue42 created this gist
Jul 6, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ blueprint: name: Unavailability Detector description: Regularly test all sensors for unavailability or "unknown"-ness. domain: automation input: repetition: name: How often to run description: Test is run at this intervall, in minutes. You MUST use the slash notation; 0-59 minutes. default: '/30' selector: text: multiline: false exclude: name: Excluded Sensors description: > There are some weird sensors out there, we might want to ignore. Only entities are supported, devices must be expanded default: [] selector: entity: multiple: true domain: - binary_sensor - sensor exclude_regexp: name: Excluded Sensors, RegExp description: > There are some weird sensors out there, we might want to ignore. default: 'DontMatchAnySensorsAtAll' selector: text: multiline: false actions: name: Actions description: 'Notifications or similar to be run. {{sensors}} is replaced with the names[] of devices indicating a problem.' selector: action: {} variables: exclude: !input 'exclude' exclude_regexp: !input 'exclude_regexp' sensors: >- {%- set result = namespace(sensors=[]) -%} {%- for s in states.sensor -%} {%- if s.state is search("unavail|unknown") and (not s.entity_id in exclude and not s.entity_id is search(exclude_regexp)) -%} {%- set result.sensors = result.sensors + [s.entity_id] -%} {% endif -%} {%- endfor -%} {%- for s in states.binary_sensor -%} {%- if s.state is search("unavail|unknown") and (not s.entity_id in exclude and not s.entity_id is search(exclude_regexp)) -%} {%- set result.sensors = result.sensors + [s.entity_id] -%} {%- endif -%} {%- endfor -%} {{result.sensors}} trigger: - platform: time_pattern minutes: !input 'repetition' condition: - '{{ sensors|length != 0 }}' action: - choose: [] default: !input 'actions' mode: single