Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105651

Automation not triggering sub-automation as expected

$
0
0

Fighting with this for a couple days now, hopefully someone can quickly point out my mistake …

I have a ‘stateless’ projector control - power toggle. Obviously I don’t want things turning off when they’re already on and the desired state is on, etc.

I thought, or read something somewhere (don’t recall, it’s been so much time and I’ve read so many things) that the best way to achieve that would be to check the state via either the media player integraion (which can’t control power), or the homekit integration (which also can’t control power), and then take action only if it is in the wrong state.

I can’t apply this logic to my ‘top level’ automation though as there are other things that I do want to fire every time, as they’re explicit and/or I don’t have the means of checking their current state - i.e. if the projector screen is already ‘down’, sending a ‘down’ command isn’t going to break anything - so I send it every time, which is a million times easier than trying to track the state of a ‘dumb’ device.

So anyway, I have the top level automation checking for any time my Harmony Hub switches to one of my ‘on projector’ activities -

alias: Start activity on Projector
description: ""
triggers:
  - trigger: state
    entity_id:
      - select.harmony_hub_activities
    to: Fibe on Projector
  - trigger: state
    entity_id:
      - select.harmony_hub_activities
    to: Shield on Projector
conditions: []
actions:
  - action: webostv.command
    metadata: {}
    data:
      entity_id: media_player.lg_webos_tv_oled77cxpua
      command: system/turnOff
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 25
      delay_secs: 0.4
      hold_secs: 0
      device: elunevision-screen
      command: screen-down
    target:
      device_id: e76896659d07d11e411bc04d122a463f
  - action: automation.trigger
    metadata: {}
    data:
      skip_condition: false
    target:
      entity_id: automation.projector_on
mode: single

and it is then calling the sub-automation ‘projector_on’ where the “check if it is already on” condition lives -

alias: projector-on
description: ""
triggers: []
conditions:
  - condition: device
    device_id: dacaeb4f2ff12afe156ac2a254408044
    domain: media_player
    entity_id: 4f593f3f36eec4b7e8d1eea77ebfa460
    type: is_off
actions:
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: lg-tv
      command: power-toggle
    target:
      device_id: e76896659d07d11e411bc04d122a463f
mode: single

the ‘top level’ automation is firing, but the ‘lower level’ one is not.

I know there is the ‘ignore condition’ toggle on the ‘top level’ automation - but that reads as though “we will do the action of this automation, regardless of the condition checks you have set up in it”, i.e. “even if the projector is already on, we’ll send an on, and end up turning it off” … sooooo, I’m stumped. Please advise <3

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105651

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>