"entity" as an action in an automation

Hello, I have a beginner question.
How can I run an “entity” as an action in an automation.
Because I have Homematic switches (on/off) that show up under entity.

As an example, this switch should be set to on at 16:30.

1 Like

Thanks.
How do I get here to switch the device mentioned below ?

This entity/device is to be switched in the above automation?

You want to use a service as an action. The service to turn on a switch is switch.turn_on.

Whether this is correct, I don’t know… sorry beginner question … come from ioBroker, Homematic …

My intention, at a certain time to turn on the Christmas lights, which consists of various devices and at a certain time to turn them off again.

The lighting consists partly of Devices and some Homematic switches are shown as an entity.

You can

  • add several actions. One for each entity.
  • or make a script that turns on all the devices and set the script as the action
  • or work with scenes or light groups
alias: example 1
trigger:
  - platform: time
    at:
      - '16:30:00'
      - '22:50:00'
action:
  - service: "switch.turn_{{ 'on' if now().hour == 16 else 'off' }}"
    target:
      entity_id: switch.terrasse_steckdose
2 Likes

wow great … thanks thanks thanks

1 Like