Need help for scripts for activate/deactivate devices in ha

Please clarify your question…