nielsfaber / scheduler-card

HA Lovelace card for control of scheduler entities
GNU General Public License v3.0
880 stars 111 forks source link

Changing timeslots via service "Scheduler: Edit" leads to "invalid date" #801

Closed LukasSolf closed 5 months ago

LukasSolf commented 6 months ago

Checklist

Card Version

v3.2.12

Component Version

v3.3.0

Bug description

Changing timeslots of an existing schedule via the service "Scheduler: Edit" with a datetime variable leads to an "invalid date" note (see attached screenshots below), although the timeslots are added at the correct time. Screenshot_20240310-163148_annotated Screenshot_20240310-163152_annotated

Steps to reproduce

Call the service "Scheduler: Edit" with the following code:

service: scheduler.edit
metadata: {}
data:
  entity_id: switch.schedule_automatisierung_kaffeemaschine_wecker_lukas
  timeslots:
    - start: >-
        {{(states('sensor.status_wecker_lukas') |as_datetime | as_local
        -timedelta(minutes = 15)).strftime('%H:%M') }}
      stop: >-
        {{(states('sensor.status_wecker_lukas') |as_datetime | as_local
        +timedelta(minutes = 30)).strftime('%H:%M') }}
      actions:
        - service: switch.turn_on
          entity_id: switch.kaffeemaschine
    - start: >-
        {{(states('sensor.status_wecker_lukas') |as_datetime | as_local
        +timedelta(minutes = 30)).strftime('%H:%M') }}
      stop: >-
        {{(states('sensor.status_wecker_lukas') |as_datetime | as_local
        +timedelta(minutes = 60)).strftime('%H:%M') }}
      actions:
        - service: switch.turn_off
          entity_id: switch.kaffeemaschine
  repeat_type: pause
  start_date: >-
    {{(states('sensor.status_wecker_lukas') |as_datetime | as_local
    -timedelta(minutes = 15)).strftime('%Y-%m-%d') }}
  end_date: >-
    {{(states('sensor.status_wecker_lukas') |as_datetime | as_local
    -timedelta(minutes = 15)).strftime('%Y-%m-%d') }}

Additional info

No response

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days