No need to convert to dict using json.loads when PyYAML will do that automatically.
When events are fired with matching data, the automation.event module executes the corresponding action for automation rules.