amitfin / retry

Home Assistant Integration with Retry Service
MIT License
104 stars 4 forks source link

I would like to be able to add a different entity to check if a retry is necessary #46

Closed narfotic closed 10 months ago

narfotic commented 10 months ago

Checklist

Is your feature request related to a problem? Please describe.

I use Adaptive Lighting to adjust my lights to the time of day. Sometimes this plugin switches some lights back on after they have switched of. To be able to distinguish between some lights being switched on by motion or all lights by a switch, I need my light groups to only be 'On' when all members are 'On'. For Retry to work in this case, I would create a separate group which will be 'On' when any members are 'On' and have Retry check for this group.

Describe the solution you'd like

I would like to be able to define a different entity to check if an automation has worked. Don't know if this is possible in the way Retry is currently implemented.

Describe alternatives you've considered

I just live with some lights switching on randomly.

Additional context

No extra context.

amitfin commented 10 months ago

It's possible using the validation parameter.

service: retry.call
data:
  service: light.turn_on
  validation: "[[ is_state('light.group1', 'on') ]]"
target:
  entity_id: light.light1
amitfin commented 10 months ago

BTW, you don't need to use YAML for that. retry.actions (which is UI friendly) also supports the validation parameter.