So for a few weeks now I’ve been trying to trace down what keeps crashing my home assistant green so horribly bad that I have to unplug it since it completely stops working. I strongly suspect it is due to my living room automation. And the only thing I can figure on there is the directv box.
Currently what happens (or what should happen) is
- Safety: If Smoke/CO detected, STOP.
- TV OFF Schedule:
- Day (4am - 10pm): Lights 100%
- Night (10pm - 4am): Lights 30%
- TV ON Schedule:
- Day (4am - 9pm): Lights 100%
- Night (9pm - 4am): Lights 30%
- Motion Logic:
- If TV is ON → Motion is IGNORED (lights won’t change).
- If TV is OFF → Motion triggers “TV OFF Schedule”.
- Shutdown:
- If Room Clear + TV Off for 2 mins → Lights OFF.
After it runs for a bit it hard crashes the entire greenbox when trigger. I’m having a smart outlet come in Sunday and that away instead of triggering it on the box itself it will be trigger on the TV being on/off.
I’ve tried rewriting this many ways and it is somewhat random when it happens. So this is the only reason why I am not 100% sure. I only think it is the livingroom because
- It can’t do the tracing thing the bulk of the time. Like the tracer flat out doesn’t work.
- During prior test it seems to happen when the living room activity happens. But it is also completely random so I’m not 100% sure. More like 90%.
My average idle is around 10% to 5% Processor and Memory is 1.6 GB / 4 GB. So I don’t think I have it doing too much.
alias: Living room logic
description: |
LOGIC RULES:
1. Safety: If Smoke/CO detected, STOP.
2. TV OFF Schedule:
- Day (4am - 10pm): Lights 100%
- Night (10pm - 4am): Lights 30%
3. TV ON Schedule:
- Day (4am - 9pm): Lights 100%
- Night (9pm - 4am): Lights 30%
4. Motion Logic:
- If TV is ON -> Motion is IGNORED (lights won't change).
- If TV is OFF -> Motion triggers "TV OFF Schedule".
5. Shutdown:
- If Room Clear + TV Off for 2 mins -> Lights OFF.
triggers:
- trigger: state
entity_id: binary_sensor.livingroom_motion
to: "on"
id: activity_motion
- trigger: state
entity_id: media_player.living_room_directv
to: "on"
id: activity_tv
for: "00:00:02"
- trigger: state
entity_id: binary_sensor.livingroom_motion
to: "off"
id: check_clear
- trigger: state
entity_id: binary_sensor.lwr01_occupancy
to: "off"
id: check_clear
- trigger: state
entity_id: media_player.living_room_directv
to: "off"
id: check_clear
for: "00:00:02"
- trigger: state
entity_id: timer.living_room_timer
to: idle
id: timer_done
- trigger: state
entity_id: input_boolean.livingroom_motion
to: "off"
id: shutdown
conditions:
- condition: state
entity_id: input_boolean.smoke_or_co_detected
state: "off"
actions:
- choose:
- conditions:
- condition: trigger
id: activity_motion
- condition: state
entity_id: media_player.living_room_directv
state: "off"
sequence:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.livingroom_motion
- action: timer.cancel
target:
entity_id: timer.living_room_timer
- choose:
- conditions:
- condition: time
after: "04:00:00"
before: "22:00:00"
sequence:
- action: light.turn_on
target:
entity_id: light.living_room_group
data:
transition: 2
brightness_pct: 100
default:
- action: light.turn_on
target:
entity_id: light.living_room_group
data:
transition: 2
brightness_pct: 30
- conditions:
- condition: trigger
id: activity_tv
sequence:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.livingroom_motion
- action: timer.cancel
target:
entity_id: timer.living_room_timer
- choose:
- conditions:
- condition: time
after: "04:00:00"
before: "21:00:00"
sequence:
- action: light.turn_on
target:
entity_id: light.living_room_group
data:
transition: 2
brightness_pct: 100
default:
- action: light.turn_on
target:
entity_id: light.living_room_group
data:
transition: 2
brightness_pct: 30
- conditions:
- condition: trigger
id: check_clear
- condition: state
entity_id: binary_sensor.livingroom_motion
state: "off"
- condition: state
entity_id: binary_sensor.lwr01_occupancy
state: "off"
- condition: state
entity_id: media_player.living_room_directv
state: "off"
sequence:
- action: timer.start
target:
entity_id: timer.living_room_timer
data:
duration: "00:02:00"
- conditions:
- condition: trigger
id: timer_done
- condition: state
entity_id: binary_sensor.livingroom_motion
state: "off"
- condition: state
entity_id: binary_sensor.lwr01_occupancy
state: "off"
- condition: state
entity_id: media_player.living_room_directv
state: "off"
sequence:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.livingroom_motion
- conditions:
- condition: trigger
id: shutdown
sequence:
- action: light.turn_off
target:
entity_id: light.living_room_group
data:
transition: 7
mode: restart