Hello everyone,
Ik am struggeling all night to get this to work but i must do something wrong but i don’t see what,
What i want is in a script for the dutch energy prices to bring them in so i can automate like charging a car,
- resource: https://mijn.easyenergy.com/nl/api/tariff/getapxtariffs?startTimestamp={{now().strftime('%Y-%m-%d')}}&endTimestamp={{as_datetime(as_timestamp(now())+172800).strftime('%Y-%m-%d')}}
and this goes wrong but it is designed for home assitant.
So i tried to create sensors with time and i succeeded but i cant get de future day running
In unix format it works but the conversion back from unix to iso does not work
- sensor:
- name: "date_now"
state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%Y-%m-%d') }}"
icon: "mdi:calendar-clock"
- sensor:
- name: "date_time_delta"
state: "{{ as_timedelta('P2DT0H00M00S') | timestamp_custom('%Y-%m-%d') }}"
icon: "mdi:calendar-clock"
- sensor:
- name: "date_day_after_tomorrow_unix"
state: "{{ as_timestamp(states('sensor.date_time_iso'))+172800 }}"
icon: "mdi:calendar-clock"
- sensor:
- name: "date_day_after_tomorrow"
state: "{{ (as_timestamp(sensor.date_time_utc) + 3600)|timestamp_custom ('%Y/%m/%d %H%M') }}"
icon: "mdi:calendar-clock"
has someone an idea what i am doing wrong?