Utility meter - with "conditions"?

Hi there :slight_smile:

Can I use an already existing select entity as input for a tariff?

I have the following situation:
Until now, we only had one EV Car - and therefore, I had just a total counter for the energy that was used for charging this car.

Now, we got a second one - and the Charging Station does support up to 10 different vehicle profiles.
I can select the connected car either with a select entity in homeassistant, or with an rfid tag directly on the Charging station.

Now, I would like to create a utility_meter, which is using the given information from the Select entity as a tarif… but right now, it seems, that I can only write my own tarifs into the utility meter setup.

Therefore, I now have a select* entity for the tarifs - and a select* entity for the vehicle profiles.
The only way would be an additional automation, which is setting the value from the one - based on the value of the second.

How should this automation look like?

here’s my current automation (not finished)

alias: Wechsle Fahrzeugzähler
description: Wechselt den Zähler für das angeschlossene Fahrzeug
triggers:
  - device_id: 893a6166b95256080d52fdc5511d5810
    domain: select
    entity_id: 4937c4dc554f83f1b6f294da3552e747
    type: current_option_changed
    trigger: device
conditions: []
actions:
  - action: select.select_option
    metadata: {}
    data: "<-- here should be the selected vehicle -->" // "{{ tariff }}"
    target:
      entity_id: select.openwb_carcharging
mode: single

here are the options I do have available in the selection from the Charging station:

as well as sensor value available (name and via an ID)
image

closed.

The solution / correct automation is this:

alias: change Utility Meter for Car
description: change the "Car-Tariff" based on connected car
triggers:
  - trigger: state
    entity_id:
# sensor with information of connected car
      - sensor.openwb_chargepoint_2_fahrzeug 
conditions: []
actions:
  - action: select.select_option
    metadata: {}
    data:
# entity state from trigger-sensor
      option: "{{ states('sensor.openwb_chargepoint_2_fahrzeug') }}"
    target:
# tariff-selector
      entity_id: select.openwb_carcharging
mode: single