Added support for automatisms activation conditions/actions.
Also fixed clearJSONFile.