Question: Does DirecTV crash Home Assistant? I think my living room logic keeps crashing the entire system

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

  1. Safety: If Smoke/CO detected, STOP.
  2. TV OFF Schedule:
  • Day (4am - 10pm): Lights 100%
  • Night (10pm - 4am): Lights 30%
  1. TV ON Schedule:
  • Day (4am - 9pm): Lights 100%
  • Night (9pm - 4am): Lights 30%
  1. Motion Logic:
  • If TV is ON → Motion is IGNORED (lights won’t change).
  • If TV is OFF → Motion triggers “TV OFF Schedule”.
  1. 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

  1. It can’t do the tracing thing the bulk of the time. Like the tracer flat out doesn’t work.
  2. 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

it crashes when you manually trigger it?

The motion, and other bits no. And having the directv off the rule doesn’t. But having it on does sometimes. This is the part that is confusing me and is making me iffy if directv is the true problem.

did you look at logs during/after?

HA >> developer tools >> actions >> run the same action here. You get same result?

1 Like

Thanks for pointing it out. I haven’t done that. I would now, but I have a smart plug coming in and I mostly posted this wondering if anyone can see any thing in the logic that could cause this issue with that and if this is a known issue with directv.

My plug is coming in Sunday. And until I get that setup I’m keeping this automation off. If this happens again, then I know it isn’t this. If it doesn’t happen, then lets hope

no command ever run in an automation or in any other manner should cause HA to reboot or crash. Maybe a command line script that executes command on host but NO, nothing causes crashes.

Green has SD card?
I would look at power and storage.
A hanging command can cause this but this will not occur with wifi/ethernet. I had it occur with zwave.

2 Likes

Green has SD card?

No it uses 32GB of eMMC storage. I actually need to get a SD card for it now that I’m thinking of that, but from my understanding the SD card is only used for recovery and diagnostic.

Anyways, what I’m thinking is there is some DirecTV polling, it gets hangged up, and IDK it goes to 100%.

I added some code in another automation and turned on the ability for me to chart out the processor and RAM. This should at least give me some clues on what is going on.

Polling itself won’t generally do it…

Tight unconstrained loops absolutely will.

I didn’t see an infinite loop possible in your script but a potential flap if your PIR gets chatter while the TV is off.

Get the log from before the crash and see what the last thing logged was.

If nothing disable the DTV integration and see if it stops.

I tried to find the logs for before the crash happens. If you can let me know where to look, that would be a big help. I only had home assistant for a few weeks now so I might be missing the obvious. But all the resources point to some log file that doesn’t show up because I think a home assistant update this past November got rid of it.

And I tried to sit there and watch it but it is too random or a clear enough pattern hasn’t shown.

Anyways, I disabled all the DirecTV integrations