Conditional / If-Then-Else ? How to proceed

Hi. I am very new to HA and have no coding experience at all. I have created several automations that run well, but others do not. I have hit a problem with one task…

Basically I want my kitchen lights (as a ZHA group) to turn on at a certain level when motion is detected and certain criteria are met, and another level when other criteria are met. I have created a ZHA group for the lights and created two scenes.

When motion is detected by either of two sensors AND when the sun elevation is below -3 AND time is before 23:59hrs then I want Scene 1 activated.

When motion is detected by either of two sensors AND when the sun elevation is below -3 AND time is before 05:30hrs then I want Scene 2 activated.

(I have another automation that turns the ZHA group off after no sensing for a certain time.)

Can this be done using Visual Editor? It seems like it ought to be fairly simple but I cannot get anything to work for me.

When getting to the ‘Choose between Actions’ stage I get messages like: “Key ‘service’ is not expected or not supported by the visual editor. You can still edit your config in YAML.” And I cannot save what I have created.

Hello DorsetLad,
The best way to learn is to just try. Run thru the docs on getting started with the automation editor. If you get stuck, come back with what you have done.

and
The Home Assistant Cookbook - Index.

How to help us help you - or How to ask a good question.

Yes.

From what you have described you have 1 trigger (motion state), 1 general condition (sun elevation), and 1 condition (time) that branches the actions. Whether you use a If/Then action or Choose action for the branching in this case is up to you, both will work.

The error you mentioned is likely due to the key service either being used in addition to the new action key, or it being indented incorrectly. Without being able to see the YAML, we cannot help determine which it is.