Hi there,
I have a number helper I created, which stores the minutes the closing of a chicken hen door should be delayed after sunset. That helper is input_number.klappe1_offset_su_helper. That number is stored as a string, I believe. At least that’s what most forum entries say.
I’m trying to add those minutes to the next sunset time. I tried to to create a template like this:
- trigger:
- platform: time
at: '00:00:00'
- platform: event
event_type: event_template_reloaded
- platform: homeassistant
event: start
sensor:
- name: "Klappe1 mit Offset"
unique_id: "klappe1_sunrise_with_offset"
state: "{{ state_attr('sun.sun', 'next_setting') | as_datetime + (states('input_number.klappe1_offset_su_helper')|int * 60))|timestamp_custom('%H:%M:%S', false)}}"
This throws me an error: “TypeError: can only concatenate str (not “int”) to str”. I tried to find a solution in the forums, but after a day I’m stuck. Does anyone have an idea and can point me in the right direction? How do i convert the string to an integer and add it to the datetime?
Any help would be greatly appreciated, thanks in advance!
Jan