home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

Feature Request - Add 'Or' Option for Automation UI Editor #205

Closed ghost closed 5 years ago

ghost commented 5 years ago

move[bot] commented on Apr 28, 2018, 9:36 AM UTC:

Knoxie commented on Apr 27, 2018, 3:08 PM UTC:

Home Assistant release with the issue: 0.67.1

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Docker, Unraid

Component/platform: https://www.home-assistant.io/components/automation

Description of problem: When using the Automation Builder from the UI there is no way to create 'or' conditions. They are automatically written to the automation.yaml and interpreted as 'and' conditions. I found this while trying to use the 'sun' condition and set a light to turn on with the condition that its between sunset and sunrise. But Hass uses after sunset as 'sunset to midnight' and 'midnight to sunrise' so those two things being added as an 'and' cannot be true for a specific time.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

   condition:
   - after: sunset
     after_offset: '-1:00:00'
     before: sunrise
     before_offset: '1:00:00'

Traceback (if applicable):

Additional information:

This issue was moved by fabaff from home-assistant/home-assistant/issues/14120.

This issue was moved by zsarnett from home-assistant/home-assistant-polymer#1129.

ghost commented 5 years ago

@ajdezigns commented on Apr 29, 2018, 11:58 AM UTC:

Both the sunset and sunrise conditions reset at midnight they can not both be used like your trying to do you will have to use the sun elevation setting instead

ghost commented 5 years ago

@fanaticDavid commented on Apr 29, 2018, 3:41 PM UTC:

Considering the OP is trying to add an or condition to the code above, it is perfectly possible to combine those conditions in an automation.

ghost commented 5 years ago

@ajdezigns commented on Apr 29, 2018, 4:45 PM UTC:

I tried to do the Very same thing before and spent several hours trying to get it to work even opened a issue like this one and I was informed by several that it was not possible to combine sunset and sunrise in that manner

ghost commented 5 years ago

@mf-social commented on Apr 30, 2018, 8:17 AM UTC:

You were informed incorrectly.

Before sunrise OR after sunset is a perfectly valid condition set to establish if a light should be on, and is working perfectly for many users.

ghost commented 5 years ago

@Knoxie commented on Apr 30, 2018, 11:29 AM UTC:

Yes, this can work if you enter it manually in the Automation.yaml file and include the 'or' condition. It is only not possible from the UI due to the creation of conditions not allowing for an 'or' setup.

ghost commented 5 years ago

This issue was moved by iantrich to home-assistant/home-assistant-polymer#3924.