#Okay, but my problem remains, that I

1 messages · Page 1 of 1 (latest)

rain robin
#

So I don't have a big picture here. Share your code.

visual tangleBOT
#

@woven narwhal Please use a code share site to share code or logs, for example:

Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.

rain robin
#

Take your time. I have to step away for about an hour, I'll check when I get back.

rain robin
#

@woven narwhal lets move over here... it's a longer sibject we should take off the main channel.

rain robin
rain robin
#

All right.
So what is this supposed to do, because if the action name is on or off it does the same thing...

#
      - conditions:
          - condition: template
            value_template: '{{ action_name=="on" }}'
        sequence:
          - service: automation.trigger
            target: "{{ target_automation }}"
      - conditions:
          - condition: template
            value_template: '{{ action_name=="off" }}'
        sequence:
          - service: automation.trigger
            target: "{{ target_automation }}"
#

So I'm looking at this and still don't know what you are trying to do here.

#

Did you / where is the automation you are basing this on?
You SHOULD first write an automation that does exactly what you want to achieve then plug in the stuff to make it a blueprint. Getting the logic working is not always easy, and becomes obfuscated in all that variable substitution stuff, making everything frustrating.
Get what you want working, then make the blueprint out of that by adding the !inputs and variables and such.
https://www.home-assistant.io/docs/blueprint/tutorial/

woven narwhal
#

Yeah, just ignore this, atm it should trigger the same automation (actually also a script, have to turn a few automations into scripts later..), but maybe I'll change it to different Actions later..

#

Basically I want to combine these two conditions and sequences to one with a if/else construct, based on if the "!input 'target_automation_6" is filled or not.. I bet this is easy, but I'm struggling with the syntax.. Also I need to make some inputs optional..

- conditions: - condition: template value_template: |- {{ (action_name=="scene_2") }} sequence: - service: homeassistant.turn_on target: !input 'scene_2' - conditions: - condition: template value_template: |- {{ (action_name=="scene_3") }} sequence: - service: automation.trigger target: !input 'target_automation_6'

rain robin
#

Well mock it up first, get the automation stuff working, then convert it to a BP.

#

For those above I would probably add a trigger for action name, and use the trigger data to branch me.

#

Then you write less code.

woven narwhal
#

Okay, will read some Documentation about it!

But is something like this possible?

sequence: |- {%- if target_automation_6==empty -%} - service: homeassistant.turn_on target: !input 'scene_3' {%- else -%} - service: automation.trigger target: !input 'target_automation_6' {%- endif -%}