I have a weird issue, where my Samsung tv will automatically turn on and off again once every night, usually around 12:30 am.
Unfortunately, I have an automation that gets triggered by the TV.
The simplest solution was to add a time condition to my automation. However the automation still gets triggered every night.
Is there an error in the config?
id: chillout_when_tv_on
alias: Chilloutmodus aktivieren wenn abends TV an
trigger:
platform: state
entity_id: media_player.fernseher
to: "on"
condition:
- condition: time
after: "19:30:00"
before: "23:00:00"
action:
- service: script.chilloutmodus
I take it the script works fine inside those hours ? What system are you running, as I’m Ubuntu box didn’t ‘spring’ forward this year. I didn’t notice till one late night, and was most confused that it was before my bedtime, but I’d been asleep…
The cause for your Tv turning on without interaction is probably the automatic search for firmware updates.
The reason for the condition not working is probably that you are providing a (single item) list of conditions, whereas the documentation does only allow this nested below „or“ and „and“ condition. Try this:
condition:
condition: time
after: "19:30:00"
before: "23:00:00"
Also, check time and timezone, especially when running HA inside a Docker container.
I am running Home Assistant (hass.io) on a RPi3. The time seems to be correct, judging by the timestamps in the log files. Not sure where else I could check the system time.
I will try changing the condition entry to a single item. There are however examples in the documentation for lists of conditions: