Shelly triggers automations when becoming available/unavailable

Those keywords only work with state triggers and conditions, which are preferred over device actions (what you do) anyway: