Data_template use value template

Can anyone tell me why I can’t use a template with this value

NOT working is :

   value: >
       {{ states.input_slider.temp_regel.state |int }}
 AND
    value: >
       {{ states.input_slider.temp_regel.state }}
 AND
   value: '{{ states.input_slider.temp_regel.state }}'
 AND
   value: {{ states.input_slider.temp_regel.state }}

but this works fine

   value: 20

my config

 - alias: 'Kachel aan (obv aanwezigheid)'
   trigger:
     - platform: state
       entity_id: device_tracker.iphonevandonovan, device_tracker.iphonevaningelihome
       to: 'home'
   condition:
     condition: and
     conditions:
       - condition: time
         after: '08:00:00'
         before: '23:15:00'
       - condition: or
         conditions:
         - condition: state
           entity_id: device_tracker.iphonevaningelihome
           state: 'home'
         - condition: state
           entity_id: device_tracker.iphonevandonovan
           state: 'home'
   action:
     - service: input_slider.select_value
       data_template:
        entity_id: input_slider.temp_regel
        value: >
                {{ states.input_slider.temp_regel.state }}
     - service: input_boolean.turn_on
       data:
        entity_id: input_boolean.kachelauto

try…

value: ‘{{ states.input_slider.temp_regel }}’

instead and | int etc if needed

Hi keithh666.
I tried it, but unfortunately, it does not work either.
Someone else an idea?

Copy and paste your template {{ states.input_slider.temp_regel }} in Developer Tools/templates for testing it.
There you will see that it not returns the value of the slider.
You need {{ states.input_slider.temp_regel.state }} to get the value and maybe | int if it returns a string.

Btw, why do you want to set the input slider with the value of the input slider?

Hi VDRainer

Thank you for the tip of “Developer Tools / templates”. Did not I know the existence ;-). If I paste your code there, {{states.input_slider.temp_regel.state}} he returns the value neatly. (20)
But I just tried it in home assistant but unfortunately it does not work either.

Good question :wink:
I do not want the default value of my thermostat to be hardcoded in the config. That makes changing this awkward. That’s why I have two app slides with “default off” and the “default on” temp rate

Does anyone else have an idea why the Developer tool does it but home assistant does not?

SOLVED

DAMN ! ! !

I am an idiot!
I used as input_slider the same input_slider as the one I wanted to put.
I should have used {{ states.input_slider.on.state }} instead of {{ states.input_slider.temp_regel.state }}
SORRY!!!

I’m now in a corner deep, deeply ashamed!

Super thanks for the help.
I found out when I was testing the developers tool. Thanks again VDRainer

Hello. I’m a beginner. I can not get the temperature of a temparature senzor. If I do a test here image
, it reads my test completely. The name of the sensor I got from here image
. What do I have to do, do I have to activate other functions? I do not understand where “date_template:” should appear.

you can’t use templating in the service call section. Templates can only be used in the template editor or in your configuration itself.

In the service call area, you need to use numbers or strings. If you look in your posted image it says “Service Data”, not “Service Template Data”.

and just to let you know, you are using the wrong syntax (even if that were to work).

You are using:

{{ states.sensor.t_ext_485_temperature.state }}

That’s not correct because your entity_id is sensor.t_ext_485. This is:

{{ states.sensor.t_ext_485.state }}

Thanks but I can not. Can you tell me more?

I’m not sure I follow you… what else do you want me to tell you? Did you follow what I said? You cannot use data_templates in the service call area. So your service data is wrong. for it to work you need to use numbers… like so:

{"cache": False, "entity_id":"media_player.dormitor","message":"Temperature is 23.62."}

data_templates are only allowed in the template editor or your inside your configuration.

I apologize for not knowing. I just want to hear the temperature of a sensor. What settings should I do and where? Looking at the forum … too much information for a beginner. I do not even know where to start.

When? As an automation or for testing?

For testing first.

Right, so put

{“cache”: False, “entity_id”:“media_player.dormitor”,“message”:“Temperature is 23.62.”}

inside the tts.google_say service data…

Capture