But it always fails, “unknown input”
Am I doing something wrong, or is it really only possible to use objects like input_text in the templates in scripts ?
Though, I think the double single quote counts as escaping it and it’s just how the UI mode does things. So probably not the problem.
Are you sure that attribute exists at the time of the call? A lot of media players are polling devices and the attributes you expect to be there will be delayed.
Open up Developer Tools in your browser, go to states, and find ‘media_player.pioneer’. In the attributes field, look at ‘source’. Does it match what you expect? Try manually doing whatever you are trying to do and see how long it takes that value to update.
Thanks Jocnnor & Tom ! Well, those quotes were automatically changed by the script engine.
It has a value, I want to change the source of another media_player to the source of the pioneer. The sources have the same name. When I try this in the template editor, the output is ok.
But it seems I can’t use it in the script editor. I’ve also used in a data block, but no luck !
See if the result matches what is available as sources for the pioneer player in the developer tools states menu. Including capitalisation - that’s important.
If it all checks out try putting the entity id in the data block too: