Set an input_select in automation

Hello there,

I try to set a helper in order to know when my car is fully charged.
For that I create an input_select helper name: Voiture with 2 states:

  • Charge en cours
  • Charge terminée

I tried to create an automation that set the input_select to “Charge en cours” when my zigbee plug detect power above 10W, but itdoes not working

The YAML code is

alias: Voiture en charge
description: Positionne la liste déroulante voiture à "Charge en cours"
trigger:
  - type: power
    platform: device
    device_id: 084b3e4ba4d3ccb5629da0e9c80197e6
    entity_id: sensor.tz3000_cehuw1lw_ts011f_active_power
    domain: sensor
    above: 10
condition: []
action:
  - service: input_select.select_option
    data:
      entry_id: input_select.voiture
      option: Charge en cours
mode: single

I’ve got an error: “Stopped because an error was encountered at 3 mai 2023 à 17:59:36 (runtime: 0.01 seconds)
extra keys not allowed @ data[‘entry_id’]”

Is anybody can help me ?

You made a minor spelling mistake.
Replace entry_id with entity_id

Cool that’s was the trick

Thanks for the reply

1 Like

No another question

I want to send a message to my phone when my car is fully charged

I create this automation:

alias: Charge voiture terminée
description: ""
trigger:
  - type: power
    platform: device
    device_id: 084b3e4ba4d3ccb5629da0e9c80197e6
    entity_id: sensor.tz3000_cehuw1lw_ts011f_active_power
    domain: sensor
    below: 1
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition: []
action:
  - service: input_select.select_option
    data:
      entity_id: input_select.voiture
      option: Charge terminée
  - service: notify.mobile_app_mi_10
    data:
      title: Charge voiture terminée
      message: La recharge de la batterie de la voiture est terminée
mode: single

How Can I add the condition that the automation start only if the sensor is below 1W and the input_select value is “Charge en cours”

Add a State Condition.

alias: Charge voiture terminée
description: ""
trigger:
  - type: power
    platform: device
    device_id: 084b3e4ba4d3ccb5629da0e9c80197e6
    entity_id: sensor.tz3000_cehuw1lw_ts011f_active_power
    domain: sensor
    below: 1
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition:
  - condition: state
    entity_id: input_select.voiture
    state: Charge en cours
action:
  - service: input_select.select_option
    data:
      entity_id: input_select.voiture
      option: Charge terminée
  - service: notify.mobile_app_mi_10
    data:
      title: Charge voiture terminée
      message: La recharge de la batterie de la voiture est terminée
mode: single

thanks for the help :slight_smile: I really appreaciate