Really stuck here and pulling my hair that now think I need to start from scratch as everything I have tried does not seem to work
So, I currently use HACS and Octoblock to get the best 1hour time slot for my electricty which produces a sensor with the following:
sensor name: sensor.best1hourslot
state: 2020-10-11T14:30:00 BST
I want to automate my dishwasher to come on at the time of this sensor which dynamically changes. The dishwsher is on a smart plug and the automation works fine when I trigger it manually
I have tried setting up a binary_sensor, a sensor and a trigger in the automation but will not trigger
The sensor i created have the following as the value_template
Iām wanting to do something similar but I also want to do something else after a period of time. i.e. having used octoblock to work out that at 2200 there is a cheap 1hr , then I want to switch something on at that time for 1 hour. Iām new to HA so Iām not sure if the format of automations.yaml has changed as many of the code fragments I have seen in the forum throw an error so I am trying to do this via the automations wizard ( Configurations\Automations ) : I have a couple of entities
sensor.date_time_iso = 2020-11-12T13:55:00 and
sensor.octopus_1hour_time = 2020-11-12T22:00:00Z .
The automations.yaml currently looks like this :
- id: '1605184438058'
alias: Switch on Light for 1 hour
description: ''
trigger:
- platform: template
value_template: '{% if (states("sensor.date_time_iso") + "Z") == (states("sensor.octopus_1hour_time"))
%}true{% endif %}'
condition: []
action:
- service: switch.turn_on
data: {}
entity_id: switch.sonoff_xxxxxyyyyy
mode: single
this was created with the wizard , can anyone advise how to modify this to include the switch_off after 1 hour piece ( ideally using the wizard since Iāve had as much luck modifying the yaml code directly as buying a lottery ticket )