Good day all! I’m trying to update my conditions to use the state or numeric_state of the velux shade covers. The goal is to use whether the skylight shades are open or closed to dictate the brightness of the lights in the kitchen.
First, I tried using:
- condition: numeric_state
entity_id: "cover.velux_left"
below: 51
- condition: numeric_state
entity_id: "cover.velux_right_2"
below: 51
It gave an error when executing:
Error: In ‘and’ (item 4 of 5): In ‘numeric_state’: In ‘numeric_state’ condition: entity cover.velux_left state ‘open’ cannot be processed as a number In ‘and’ (item 5 of 5): In ‘numeric_state’: In ‘numeric_state’ condition: entity cover.velux_right_2 state ‘open’ cannot be processed as a number
So, I tried as a state:
- condition: state
entity_id: "cover.velux_left"
state: closed
- condition: state
entity_id: "cover.velux_right_2"
state: closed
Unfortunately, I get errors reloading the automation configuration:
2022-05-23 11:34:09 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->state. (See /config/configuration.yaml, line 9).
This is an example of an automation that I’m trying:
- id: '1899958999003'
alias: Kitchen lights on with lots of cloud cover
trigger:
platform: state
entity_id:
- group.kitchen
to: 'on'
condition:
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_cloud_coverage
above: 49
- condition: sun
before: sunset
before_offset: -01:30:01
- condition: state
entity_id: "cover.velux_left"
state: open
- condition: state
entity_id: "cover.velux_right_2"
state: open
action:
- parallel:
- service: light.turn_on
target:
entity_id: light.kitchen_main_lights
data:
brightness_pct: 50
- service: light.turn_on
target:
entity_id: light.kitchen_under_cabinet
data:
brightness_pct: 70
- service: switch.turn_off
target:
entity_id: switch.kitchen_sink_light
Any advice is appreciated much.