Closed lauraGgit closed 8 years ago
this is not resolved with the addition of entity_id: sun.sun
I fixed this in my automation by replacing -platform: sun with a numeric_state:
- platform: numeric_state entity_id: sun.sun value_template: '{{ state.attributes.elevation }}' above: 5
I used the elevation numeric_state to avoid an overlap with my regular sunset trigger, which also uses the elevation rather than a sunset offset. Plus, I am unsure how one would specify the offset as a state or numeric_state.
Also, I believe you need to use homeassistant as the service rather than switch, and assuming you are turning the lamp off when 'Rain is over', homeassistant.turn_off
This seems to have worked.
Home Assistant release (
hass --version
): 0.15.0Python release (
python3 --version
): Python 3.4.2Component/platform: homeassistant.components.automation.sun
Description of problem: In copying the automation 2 script in the "Cookbook" I am receiving the following error
ERROR (MainThread) [homeassistant.components.automation.sun] Missing if-condition configuration key before or after
Expected:
Problem-relevant
configuration.yaml
entries and steps to reproduce:Traceback (if applicable):