Air conditioner indicator status trigger

Hello, I want to realize the linkage between the air conditioner indicator and the lighting lamp, but I have encountered a problem. He will not be triggered in the automation, now he needs the help of a master, thank !


The above is device information

alias: c
description: ''
trigger:
  - platform: state
    entity_id: climate.mt8_cloud_266066
    attribute: indicator__switch_status
    to: 'false'
condition: []
action:
  - type: turn_off
    device_id: 5aefcb733c541ed3f7f03e9be71e15fa
    entity_id: light.meshbulb1_cloud_012543
    domain: light
mode: single

Any reason not to use the state of the entity? Can you check the state of the climate entity when it is ON and when it is OFF?

trigger:
  - platform: state
    entity_id: climate.mt8_cloud_266066
    to: 'off'
condition: []
action:
  - service: light.turn_off
    target:
      entity_id: light.meshbulb1_cloud_012543

First of all, thank you very much for your reply. The entity is an air conditioner, and the indicator light of the air conditioner can be independently controlled on the remote control. As long as I judge the indicator light, this will enable me to control the bedroom light by the remote control. Simply put, it is to judge the state of an attribute in the entity

By the way, I am a smart home enthusiast from China. Not in English, the text is all from a translation, the language structure may be more complicated, thank you very much for your patience to read the reply

Does my previous answer help you solve the problem? If it doesn’t, please give more information regarding the entity (a screenshot of the state attribute as well as the states entity would help).

Thank you again. Your code can be triggered. Unfortunately, the switch of the whole air conditioner at that time. What I want is the switch of the indicator light in the air conditioner. I see that the status of the indicator light is included in the air conditioner. I need the bedroom light and the air conditioner indicator light to operate together

Can you go to Developer Tools → States (tab) → Type climate.mt8_cloud_266066 → Screenshot the whole page and post it here?

Also, does indicator__switch_status changes to TRUE when it is ON?

hvac_modes:
  - cool
  - dry
  - fan_only
  - heat
  - 'off'
min_temp: 7
max_temp: 35
target_temp_step: 0.5
min_humidity: 30
max_humidity: 99
fan_modes:
  - Auto
  - Level1
  - Level2
  - Level3
  - Level4
  - Level5
  - Level6
  - Level7
swing_modes:
  - 'Off'
  - Vertical
current_temperature: 26
temperature: 26
current_humidity: 47
humidity: 0
fan_mode: Level1
swing_mode: 'Off'
model: xiaomi.aircondition.mt8
firmware_version: 2.2.0
hardware_version: esp32
air_condit_switch_status: true
air_condit_mode: 2
air_condit_fault: none
air_condit_target_temperature: 26
air_condit_eco: false
air_condit_heater: false
air_condit_dryer: true
air_condit_sleep_mode: false
air_condit_target_humidity: 0
air_condit_un_straight_blowing: false
air_condit_speed: 1
air_condit_vertical_swing: false
environmen_temperature: 26
environmen_relative_humidity: 47
indicator__switch_status: true
electricit_electricity: 0.0708
electricit_elec_count: 1
state_value: true
friendly_name: 俊
supported_features: 45

The code comes from here

Can you try this?

alias: Turn Off Light if AC Indicator Switch False
description: ''
mode: single
trigger:
  - platform: state
    entity_id: climate.mt8_cloud_266066
    attribute: indicator__switch_status
    to: 'false'
condition: []
action:
  - service: light.turn_off
    target:
      entity_id: light.meshbulb1_cloud_012543

To try, make sure at the beginning indicator__switch_status is TRUE. Next, try turning OFF the AC so that indicator__switch_status become FALSE. It should trigger the automation.

Your code test is invalid. I tried “false”, “true”, “off” and “on” without effect. I can confirm that the problem lies in the trigger condition

When you want to test the automation, make sure-

  1. At the beginning, must begin with indicator__switch_status: true
  2. Turn off the AC, then it should change to indicator__switch_status: false

This will trigger your automation.
Last, to clarify where the problem might lies, use Troubleshooting Automation. You can also post the screenshot of the Debug Trace here.

Only thing I can think of is that HA parses the false to be boolean.

alias: Turn Off Light if AC Indicator Switch False
description: ''
mode: single
trigger:
  - platform: state
    entity_id: climate.mt8_cloud_266066
    attribute: indicator__switch_status
    to: false
condition: []
action:
  - service: light.turn_off
    target:
      entity_id: light.meshbulb1_cloud_012543

And has the attribute really two underscores?

This can be confirmed because I can see the state change in the developer tool截屏2021-08-11 下午3.31.29

Yes, you can see the properties I see in the developer tools

Ah, that’s where that close-up is from :slight_smile:

This is the entity displayed in the configuration

Have you tried Troubleshooting Automation that I mentioned earlier?

It will help us know which part of the automation causes the problem.

I don’t know if I can use this property as a trigger