Hello fellow Home Assistant enthusiasts! I wanted to share my experience and a small challenge I encountered while setting up an automation to track my car’s charging status. I thought it might be helpful for others who are working on similar projects.
I recently purchased a smart zigbee plug to monitor the power consumption of my electric car charger. My goal was to create an automation that updates an input_select helper entity to reflect whether my car is charging or fully charged. This way, I can easily check the status from the dashboard or integrate it into other routines.
I set up an input_select called ‘voiture’ with two states: ‘Charge en cours’ (charging) and ‘Charge terminée’ (fully charged). The automation is triggered when the power detected by the zigbee plug exceeds 10W, indicating that the car is charging. Here’s the YAML code I used:
yaml
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
However, I encountered 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’].” It was a bit frustrating, but I realized that the ‘entry_id’ parameter might not be the correct one to use here. After some research, I found that using ‘entity_id’ instead of ‘entry_id’ should resolve the issue. Here’s the corrected code:
yaml
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:
entity_id: input_select.voiture
option: Charge en cours
mode: single
I hope this helps anyone who might be facing a similar issue. It’s a great feeling to have this automation working smoothly, and now I can keep track of my car’s charging status effortlessly. If anyone has tips or alternative approaches, I’d love to hear them! Happy automating! ![]()