Tesla EV charging automation with Amber (Australia)

I have a very simple automation that used to work, however it hasn’t worked for a long time so I have to ask for some help. I have the following:

Tesla model 3 and Tesla wall charger
Tesla Custom Component in HA
Amber electric integration in my HA. That gives me the real time pricing data that I can use to turn on/off my devices(mainly with Shelly relays) depending on the electricity price

My not working automation looks like this:

  alias: Tesla Charge AUTO
  description: ""
  trigger:
    - platform: state
      entity_id:
        - sensor.tanunda_old_general_price
      for:
        hours: 0
        minutes: 0
        seconds: 0
  condition: []
  action:
    - choose:
        - conditions:
            - condition: numeric_state
              entity_id: sensor.tanunda_old_general_price
              below: input_number.max_cost_tesla
          sequence:
            - type: turn_on
              device_id: b5f4422cc20ef2a36eeca3cb790fd264
              entity_id: 7e663da291f61e0e138f9d2a2a953b94
              domain: switch
        - conditions:
            - condition: numeric_state
              entity_id: sensor.tanunda_old_general_price
              above: input_number.max_cost_tesla
          sequence:
            - type: turn_off
              device_id: b5f4422cc20ef2a36eeca3cb790fd264
              entity_id: 7e663da291f61e0e138f9d2a2a953b94
              domain: switch
  mode: single

Like I mentioned before. It used to work with that exact yaml-code but at some point it has stopped working and I haven’t been able to figure out why

Is it generating traces?

Actually. Looks like no traces except from today when I logged in to my HA and copied the code to paste here.

Now the traces are coming every 5 min (Amber price update frequency)

Also under trace timeline each step shows: “Stopped because an error was encountered at March 19, 2025 at 11:54:22 AM (runtime: 31.30 seconds)”

Under Step Details it shows: “Error: TeslaException
Result:
choice: 0”

Saying that. I don’t have the car here right now. Maybe that’s causing the error :thinking:

Check Settings → System → Logs to see if there is more related error information.

Thanks Tom for pointing me in the right direction. When looking at the logs I realised something is wrong. So I found this: Tesla Custom Integration seems to have stopped working - #5 by AllHailJ

I ended up signing up for Teslemetry (free trial 7 days) and it works with that without any issues. I probably will end up paying for it as getting it working via custom integration seems a bit too tricky for someone with my skills