Firstly I really appreciate all the help, the community here is very active and helpful which is a massive positive. But I’m beginning to think that my trial from Smartthings to HA is a non-starter. Everything is so much more involved a simple use of sunset being so overly complex, this is kinda the last straw…
Please give my example a shot and just change the “actions”
It works and I suspect you have some sort of weird typo or special character inserted somehow. YAML is not so forgiving so also having a good editor that validates helps. Microsoft Code editor works really well with the YAML plugin. Prior to this I used textpad and life was miserable.
I know HA has a steep learning curve; I came from Wink; but it is well worth it as once you get the basics sorted it has so much power and potential. Also the community is excellent to help out as we’ve all been in your shoes at some point trying to get doing.
Personally, I think you should reconsider. HA does have a steep learning curve with yaml but the benefits of HA outweigh the benefits of a company driven hub in my opinion.
HA pros:
Works without internet
Will be faster becuase logic is local vrs cloud based
Will never be discontinued and you won’t be forced to purchase a new hub
HA cons:
Steep learning curve for yaml
Anyways you should be able to copy and paste this yaml and it will work:
- alias: Turn on Xmas tree
trigger:
- platform: sun
event: sunset
action:
- service: switch.turn_on
entity_id: switch.power
- alias: Turn Off Christmas Tree
trigger:
- platform: time
at: '22:30:00'
action:
- service: switch.turn_off
entity_id: switch.power
it should, but it doesn’t always at least that what I was experiencing also, and why I changed to ‘state’, see my example few posts above. Any ideas why that would be?
no conditions in my automation… and others have reported issues with the same component not triggering.
Anyways, I will test again, to see what happens.
well, back again.
It simply doesn’t work with sunset or sunrise.I can see it is triggered, but the automation doesn’t change the theme, based on this sensor:
- platform: template
sensors:
sun_based_theme:
friendly_name: Sun based theme
value_template: >
{% if is_state('sun.sun','above_horizon') %}
{{states('input_select.set_sunrise_theme')}}
{% else %}
{{states('input_select.set_sunset_theme')}}
{% endif %}
icon_template: >
{% if is_state('sun.sun', 'above_horizon') %}
mdi:weather-sunny
{% else %}
mdi:weather-night
{% endif %}
could this be a timing issue? If I use above_horizon and below_horizon, it immediately works