This is my first attempt with home assistant (Please be gentle) I have it running on a dedicated server. It has picked up many of my devices on the home network and appears functional. I have the the latest update:
Installation method
Home Assistant OS
Core
2025.12.3
Supervisor
2025.12.3
Operating System
16.3
Frontend
20251203.2
I am trying to automate a couple of KAUF smart plugs for some outdoor Christmas lights and my tree they are connected to my network and seen by HA. I can manually turn them on and off in the interface. I have created 2 automations one from sunrise to sunset and another 7:00am to 11:00pm
screen print
It looks like they are triggering (one 5 hours ago and one 15 hours ago) but the switches didn’t respond
It’s easier for us to diagnose issues if you don’t share screenshots. Instead, follow Community Questions Guideline #14 by posting the, properly formatted, YAML configuration for the automation. This can be found by clicking the breadcrumb menu (3 dots) at the top right and selecting “Edit in YAML”. Copy that and paste it, using 3-ticks ``` on the line above and the line below the configuration code.
Based on what is in the screenshots you have posted, your actions currently turn the lights on and then immediately turn them off.
If that is not your goal, you have two options:
Use separate automations for turning on and turning off the targeted entities.
Use an If/Then or Choose action so that a specific trigger causes a specific action. One way to do this is to use Trigger IDs.
OK I I like the YAML views much easer to see what’s going on (once I figure out the syntax)! I have created 2 separate automations here are the YAML files:
alias: Christmas Tree On
description: ""
triggers:
- trigger: time
at: "07:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- sat
- fri
conditions: []
actions:
- action: switch.turn_on
metadata: {}
target:
entity_id: switch.kauf_plug_christmas_tree_kauf_plug
data: {}
mode: single
alias: Christmas Tree Off
description: ""
triggers:
- trigger: time
at: "23:00:00"
weekday:
- thu
- wed
- tue
- mon
- sun
- fri
- sat
conditions: []
actions:
- type: turn_off
device_id: 90322ce08e1838d28ce8ac145e71c0ce
entity_id: e9f1955950cbb0ff32ada27aaba40903
domain: switch
mode: single
I used the UI to create these I wonder why the entity ID’s are different shouldent they both say entity_id: switch.kauf_plug_christmas_tree_kauf_plug
and why does one have a device id
Looking more closely there are a lot of differences
What you shared now is two different automations, one for turning on in the morning, one for turning off in the evening. On your screenshots you had different thing, one automation that would trigger twice a day and then turn on and immediately turn off lights each time.
What your shared now should in general work.
The reason it looks different is that one uses entity as a target and there other one uses device as target. In HA device is just of a container for entities, usually it equals to the actual physical device. While entities are different parts of that device, usually one used for the main function (in this case it’s the switch that can switch the plug on or off) and often plenty others, for example to provide some data (like power or energy values).
Anyway, both targeting entity and device work, yes just that there device method uses this long ugly id of the device and is in general not recommended here on the forum for various reasons.
Those automations should work.
If you instead want one automation to do both then this is also possible.
alias: Christmas Tree On and Off
description: ""
triggers:
- trigger: time
at: "07:00:00"
id: on
weekday:
- sun
- mon
- tue
- wed
- thu
- sat
- fri
- trigger: time
at: "23:00:00"
id: off
weekday:
- thu
- wed
- tue
- mon
- sun
- fri
- sat
conditions: []
actions:
- action: "switch.turn_{{ trigger.id }}"
metadata: {}
target:
entity_id: switch.kauf_plug_christmas_tree_kauf_plug
data: {}
mode: single
This uses a variable called id which is something you can edit in the ui.
And all we do is say at 7 the id should be on, and therefor the action is turn_on.
The weekdays can actually be omitted (deleted) since you have all days listed.