#template help

1 messages ยท Page 1 of 1 (latest)

strong dome
#

Let's get out of the main channel...

neat sequoiaBOT
lucid echo
#

That screen shows you all your entities

strong dome
#

Tinkerer is right, though

lucid echo
#

I always am, except when I'm not ๐Ÿ˜›

ember pendant
#

sec

strong dome
#

Now you have some expert help

ember pendant
#

number.tcv_badezimmer_external_measured_room_sensor

strong dome
#

He can 'see' the template where I have to works thru it...

lucid echo
#

My template-fu is weak

ember pendant
#

๐Ÿ˜…

#

Well, i thought it was "easy" to adapt the working automation from yesterday to that blueprint

#

I think, the last puzzle is that entity id

#

problem is, i dont know, what i am looking for

lucid echo
#

ally_ext_meas_temp_id is an input, not an entity

ember pendant
#

but we need an entity there?

lucid echo
#

Yes, but no, but yes

ember pendant
#

๐Ÿ˜…

#

Okay, what i have is: the whole thing works, when i just insert the real entity id

#

alias dont work

lucid echo
#
states('ally_ext_meas_temp_id')
``` is _probably_ going to be sometingg more like 

states[!input ally_ext_meas_temp_id].state

#

You may need to set a variable to the input, and then use the variable instead

#
variables:
  ally_ext_meas_id: !input ally_ext_meas_temp_id

...

states[ally_ext_meas_id].state
ember pendant
#

variables:
device: !input ally_device
ally_ext_meas_id: !input ally_ext_meas_temp_id
temp_sensor_id: !input temp_sensor_id

#
  • condition: template
    value_template: |-
    {{
    (((states[ally_ext_meas_id].state|float(0))
#

now my automation is gone xD

#

not visible anymore in gui

strong dome
#

That gui is so annoting.

ember pendant
#

thats why i am restarting sometimes ๐Ÿ˜„

#

i am more restarting the testing changes ๐Ÿ˜„

strong dome
#

It mens when you restarted with invalid syntax it won't let you back in.

ember pendant
#

Well, another option is: i let it how it is and just make 11 automations from it

strong dome
#

Scratch writing small things the gui is OK. If you are editing and tweaking you would be better off in an editor (preferably code server)

ember pendant
#

the automation itself works, so not a big problem. I just would like have to give it back to the community

#

I need to learn coding i think

#

๐Ÿ™‚

strong dome
#

The way to learn this is to do this...
Use the template developer and work your way thru this. It will be a much bigger win for you...

ember pendant
#

template developer`?

#

you mean the gui and then convert to yaml?

ember pendant
#

ah okay, thank you. i never used it

#

UndefinedError: 'device' is undefined

strong dome
#

That's my goto. When yu nave the basics, that will get you thru the details

#

You are in a blank slate that includes all the HA entities there. Device is only in the scope of that BP, so you have to define it in the scratchpad in order for this local to see it.

ember pendant
#

ah ok

strong dome
#

Temlpates all work using Jinja2 rules with some HA tweaks, mostly Jinja2

ember pendant
#

Thank you

#

I will try to find the problem

strong dome
#
{% set dv_name = 'tarantulapro'%}

{{ states('binary_sensor.'~dv_name~'_printing') }}

#

You do thing like that in there to set a variable, then get your template to work.

ember pendant
#

I will try later ๐Ÿ™‚ I give u a resonse ๐Ÿ™‚ Thanks again for the nice help

ember pendant
#

Hello again ๐Ÿ˜„ Well, it seems, i tcouldnt be done how i wanted it ๐Ÿ˜…

#

but this is the mqtt payload: