For those who have dozens of similar ESP’s, and dislike to go through a Youtube video and put it on pause to see the code: here are some convenience scripts.
Note that you need to use the ESPHome addon for this, otherwise you won’t have the update entities. I took s slightly different approach from the video and made sure to exclude updating ESPHome itself, should you have a reason not to want to do that.
Also note: there is no need, nor is it wise, to update your ESP every time. So maybe use the skip script more often, and the update script less.
Remember to test updating one ESP of each type first, before you update all, to avoid Crowdstriking all devices you depend on all at once
alias: Skip all ESP updates
sequence:
- service: update.skip
metadata: {}
data: {}
target:
entity_id: >-
{{ states.update | selectattr('attributes.title','eq','ESPHome') |
selectattr('state','eq','on') | map(attribute='entity_id') |
reject('eq','update.esphome_update') | list }}
description: ""
icon: mdi:memory
alias: Unskip all ESP updates
sequence:
- service: update.clear_skipped
metadata: {}
data: {}
target:
entity_id: >-
{{ states.update | selectattr('attributes.title','eq','ESPHome') |
map(attribute='entity_id') | reject('eq','update.esphome_update') | list
}}
description: ""
icon: mdi:memory
alias: Install all non-skipped ESP updates
sequence:
- service: update.install
metadata: {}
data: {}
target:
entity_id: >-
{{ states.update | selectattr('attributes.title','eq','ESPHome') |
selectattr('state','eq','on') | map(attribute='entity_id') |
reject('eq','update.esphome_update') | list }}
description: ""
icon: mdi:memory