Is there anyone who could help me?
What I did:
Made the lines below in folder: templates.yaml
- trigger:
- platform: time
at: '00:00:00'
- platform: event
event_type: event_template_reloaded
sensor:
- name: 'Verlichting Schutting On'
unique_id: '7781ebf3-23c6-437a-8c2f-2005de732261'
state: "{{ (today_at('13:10:00') + timedelta(minutes = range(0,1) | random)).isoformat() }}"
device_class: timestamp
- name: 'Verlichting Schutting Off'
unique_id: '842754c9-4047-48cd-8762-c2b7b8201f07'
state: "{{ (today_at('13:15:00') + timedelta(minutes = range(0,1) | random)).isoformat() }}"
device_class: timestamp
After this I made an automation like below:
alias: "Verlichting schutting automatisch "
description: Automatisch verlichting schutting aan random uit
trigger:
- id: "on"
platform: time
at: sensor.verlichting_schutting_on_2
- id: "off"
platform: time
at: sensor.verlichting_schutting_off_2
action:
- service: switch.toggle{{ trigger.id }}
target:
entity_id: switch.verlichting_schutting
I also tried switch.turn_{{ trigger.id }}
When I switch the automation manualy the light is going on so thats seems to be okay.
It looks like the custom made sensor is not being activated.
Off course I already restart Home Assistant.
Somebody who could say whats wrong?
16 posts - 4 participants