For those still wanting to accomplish this without jumping through too many hoops.
You can make use of scenes to save the state beforehand and then reapply it when you want to revert back to the previous state. Better than creating many inputs in the config. Can save the state of many entities in one go.
- id: 'doorbell_pressed'
alias: 'Doorbell Pressed'
description: 'Flash lights light blue when someone presses the doorbell'
trigger:
- entity_id: binary_sensor.doorbell_button
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
scene_id: doorbell_notification_revert
snapshot_entities: 'light.living_room,light.kitchen'
service: scene.create
- data:
effect: Facebook
entity_id: light.living_room
service: light.turn_on
- data:
effect: Facebook
entity_id: light.kitchen
service: light.turn_on
- delay: 00:00:04
- data:
entity_id: scene.doorbell_notification_revert
service: scene.turn_on