HA Trigger IOS Shortcuts

Hey guys,

I’m currently developing an automation that alerts me when my car is connected for charging. My intention is, to receive a notification if I’m parked at a charging station for more than 4 hours, so I can avoid incurring additional fees. HA should trigger a IOS Shortcut which setups a timer.

alias: e-Auto Laden - Blockiergebühr
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.id_4_pro_performance_150_kw_204_ps_remaining_charging_time
condition:
  - condition: template
    value_template: >-
      {{ not
      is_state('sensor.id_4_pro_performance_150_kw_204_ps_remaining_charging_time',
      'unavailable') }}
action:
  - service: notify.mobile_app_iphone_von_daniel
    data:
      message: Trigger a Shortcut!
      data:
        shortcut:
          name: Test23
          input: "{{ states('sensor.id_4_pro_performance_150_kw_204_ps_remaining_charging_time') }}"
mode: single

My actual problem is that IOS Shortcuts is only accepting strings, thatswhy i tried to send my sensor value as string. But that doesn’t work.

I tried it also in that following way with no success:

alias: e-Auto Laden - Blockiergebühr
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.id_4_pro_performance_150_kw_204_ps_remaining_charging_time
condition:
  - condition: template
    value_template: >-
      {{ not
      is_state('sensor.id_4_pro_performance_150_kw_204_ps_remaining_charging_time',
      'unavailable') }}
action:
  - service: input_text.set_value
    target:
      entity_id: input_text.test
    data:
      value: >-
        {{states('sensor.id_4_pro_performance_150_kw_204_ps_remaining_charging_time')}}
  - service: notify.mobile_app_iphone_von_daniel
    data:
      message: Trigger a Shortcut!
      data:
        shortcut:
          name: Test23
          input: "{{states('input_text.test')}}"
mode: single

HA sends the notification successfully but is not triggering my shortcut except if i type the input variable value manually like “210” or let it completly away.

Anyone a idea how i could get that fixed?

Greetings

Dany

why wouldn’t you run the timer within HA? Or check how long you are charging and send a notification if state changed to charging for 4 hours.

Because i like it to have a timer on my iPhone what i can directly see on my homescreen or also in the dynamic island. I can stop it also immediately if i charge on a place where it not matters if i charge there longer.

I wonder if “input” is reserved, maybe try a new name for the key value?

I think not that Input is reserved as I can send a value with the key input in a manual way.