Help with home assistant api call

Short answer

- alias: set climate state to off when aircon turns off
  trigger:
    - platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001f38b1f
      from: 'on'
      to: 'off'
  action:
    # change the state of climate.panasonic_aircon to off

Long answer:

I have a dumb air conditioner.

I use it with the broadlink climate custom component:

If the air conditioner is turned on / off using the original IR remote then home assistant and the climate control doesn’t know that the aircon has be turned on.

I added a zigbee door / window sensor to the air conditioner to detect if it is turned on / off

I thought I might be able to use this to update home assistant to tell it what the air conditioner is doing.