Showing results for 
Search instead for 
Did you mean: 

Script Editor Does Not Allow Turning Midea AC Unit Off

Community Member

Has anybody else run into this?

I'm attempting to automate a temperature schedule for my Midea U-Shaped AC Unit via the Script Editor.

Everything works great except the Script Editor complains that setting device.command.OnOff to false (I'm pretty sure that's how you turn off this device) throws an error that [OnOff] with action.devices.types.AC_UNIT is not currently supported - screenshot below.


Screenshot 2023-06-22 104731.png

Setting device.command.OnOff to true works perfectly & throws no errors.


I'm not really sure if this is a bug in the Script Editor, a problem with the Midea API / integration, or something I'm doing wrong. It's not the end of the world, but I'd love to use Google Home's presence detection to turn this AC unit off when we leave the house, as it's not natively supported in the Away Presence Sensing routine.


Troubleshooting steps I completed:

  • Confirmed turning the device on via device.command.OnOff works (I literally am only changing the on: value from true to false)
  • Confirmed setting temperature, mode, and fan speed works via Script Editor
  • Confirmed turning AC unit off via Google Home app on my Pixel 6 Pro works (not using Script Editor)
  • Unlinked & re-linked my "msmarthome" account - I did not try linking the old "Midea Air" account, but I'll try in a bit.
  • Confirmed this error occurs on multiple computers from multiple ISPs all using the latest(ish) version of Chrome

Community Member

The same is happening with heater device types unfortunately and seems to be intentional for now. I really hope that there will not be any limitations in the future. Otherwise it can not become a one-stop solution for all automations (like Home Assistant).

Community Member

Did you manage to get it working?

I have the same problem with my Gree AC. Can turn it on via automation, but no luck setting on: false

Community Member

I have found the solution at least for ambi climate controlled aircon units. Try use the following:

type: device.command.ThermostatSetMode
thermostatMode: heat,cool,on,off

I just select off and the automation turned off the aircons

Community Member

My midea unit sadly doesn't support the "off" value under device.command.ThermostatSetMode.

Nothing works yet for me. Anybody else have any luck?

Community Member

I ran into the same issue. Worked around it by running an OK Google command on my smart speaker:

    - type: assistant.command.OkGoogle
      okGoogle: Turn off the airconditioning
      devices: Google Home - Living Room


Please note that my AC device is called "airconditioning", so you may need to adjust the device name. 

I also tried this before, but it turns out that OkGoogle command makes the home switched the presence state from Away to Home again with the below reason:

"Because a device was voice controlled: [my speaker name]"


For a workaround, I first set up a scene ("Power off Air" in my case) in the third-party app for my universal remote controller and activated the scene by device.command.ActivateScene

  - type: device.command.ActivateScene
    activate: true
    devices: Power off Air


It worked. I thought your solution was very clever.

Hi could you help me? I use the broadlink app to create scenes to disable the AC unity and the device works on the broadlink app and in the google home app, but i cant seam to integrate the scenes in the google script? how exatly did you create the scene and how did you integrate the scene in the google script? i tried to do exatcly as you explained, but the script says that my scene name is not a valid device.


In my case, I created a Tap-to-Run scene in the Smart Life app. The name of the scene is "Turn on the Air".

On the Google Home side, my exact script is:

  name: Turn on the Air
  description: Helper functions of Air

    - type: assistant.event.OkGoogle
      eventData: query
      is: turn_on_the_air

    - type: assistant.event.OkGoogle
      eventData: query
      is: Turn on the Air

    - type: device.command.ActivateScene
      activate: true
      devices: Turn on the air

You can safely ignore that turn_on_the_air. I placed that to make this look like a library function with an entry point. Thus, other scripts can trigger this function with that entry point.

Hi Rafael.
I did exactly as Eric mentioned.

Follow my script, my scene is in Portuguese (BRAZIL).

- type: device.command.ActivateScene # Activate or deactivate a scene.
activate: true
devices: Desligar o A.C. da sala

When you type this command to activate scenes, Google Home will already show the scenes that are available.
If they didn't appear, try going to Google Home Configuration, Google Compatible Services and linking Broadlink again on Google Home.

that work for me. thank you.

It worked!!!

Community Member

Community Member

Same isue!

Community Member

I'm also having the same problem, when the device is an air conditioner, when it's a button or smart socket it accepts the command without a problem.
Captura de tela 2024-02-09 083459.png

Community Member

I do not see the logic that the turn on command is supported and the turn off function is not. Right now I made it turn off with the help of an unused smart switch channel. I turn that switch on in the script where I turn on the AC. And made another automation in the google home app if that switch is turned off then turn off the AC (because the app allows you to turn it off for some reason :D).

I hope they will allow to turn off these devices in the future, because right now it is kinda strange to say at least

For a workaround, I first set up a scene ("Power off Air" in my case) in the third-party app for my universal remote controller and activated the scene by device.command.ActivateScene

Yea I saw that but unfortunately I could not find any good universal remote app that is capable to make scene and integrate it into google home. At least that's what I understood in your solution correct me if I am wrong 🙂

I understood. I use broadlink to control my devices via infrared, with it I can create scenes and overcome this problem. If your air conditioning already has WiFi, you may have this function in the manufacturer's app...

Unfortunately Gree doesn't have any automation editor in its app or I didn't find it yet even if it has wifi module. The maximum that the app can do is turn on/off based on time.

If I am not mistaken to make your solution work you have to be in the same area with the machines to infared make its magic right? Unfortunately my phone does not have any infrared blaster to use these apps

Thank you for your reply it is now clear what you did 🙂

Community Member

hi guys the workaround for the AC from EricTsengTy works really well, but in the broadlink app you need to create a scene or retrato(in portguese) not a routine!