Thing actions are available in the default script scope (no need for imports). Which one are you trying to use?
Here is an example for MQTT…