@hub4code wrote:
I try to use a template value in a automation (action), but I do something wrong??
Action is:
entity_id: media_player.kodi media_content_id: | "{{ state_attr('media_player.kodi', 'media_content_id') + 1 | int }}" media_content_type: CHANNEL
When I test the template in the template-editor it shows me the right channel number.
When I test the service whit a number instead of the template it works also.The log shows the following error:
"ValueError: invalid literal for int() with base 10: '"{{ state_attr(\'media_player.kodi\', \'media_content_id\') + 1 | int }}"\n'"
I tried alos with data_template and service_template, but always the same error.
What do I have to chance to use the template in a action??
Thanks
Posts: 17
Participants: 4