I have an automation to turn on and off a z-wave switch according to the desired hours.
I want to add also the date and try multiple way, but it’s not working.
How can I add the date?
I have the date and time component installing
create new value:
input_datetime:
boiler_start:
name: Start Time and Date
initial: 00:00
has_date: true
has_time: true
boiler_end:
name: End Time and Date
initial: 00:00
has_date: true
has_time: true
boolen value:
turbo_boiler_timer:
initial: off
and the automation for the time (when the date is false) - id: ‘xxxxxxx’
alias: Turbo Boiler Timer Stop
trigger:
- platform: template
value_template: ‘{{ states(’‘sensor.time’’) == (states.input_datetime.boiler_start.attributes.timestamp
| int | timestamp_custom(’’%H:%M’’, False)) }}’
condition:
- condition: state
entity_id: input_boolean.turbo_boiler_timer
state: ‘on’
action:
- data:
entity_id: switch.neo_coolcam_wall_switch_1_channel_switch
entity_id: switch.neo_coolcam_wall_switch_1_channel_switch
service: switch.turn_on
sensor.time_date
but it’s not working, I choose the date and the time start, for the end I chose the same date and time after one minute.
I am using the same boolean for the automation, I see on your code you have two separated boolean variable.
It’s necessary to use two different boolean?
I receive an error on the date, I don’t understand why.
What can I try to fix this?
I see, yes one boolean variable, you use the service boolean start and stop,they confuse me, because I don’t use them, I use condition to turn on the boolean instead call a service.
I try with the service call boolean to check, but the switch don’t turn on.
Maybe the date time format on the 0.88 is a little different to the old version?
The configuration check is OK, I see the automation through the gui.
When I use only the time without date, it’s working, the switch turn on/off by choosing time.
Did you also have on the date like my attached jpg the invalid date?
Checked in my V0.88.0 test environment and in addition to changing date__time change to date_time I had to adjust the the ‘timestamp_custom’ parts from timestamp_custom('%Y-%m-%d, %H:%M', True)
to timestamp_custom('%Y-%m-%d, %H:%M', False)
Thanks,
I make mistake, I write time_date, I change it to date_time and add it also to the configuration sensor, now I have the date_time and the time_date in my sensor.
In the automation I use condition on the boolean, when I turn it on manually the automation is working when I turn it off the automation don’t work.
It’s just another way to use.