i am trying to get the trigger.id from a automation as variable to a script.
When i am trying to compare if the trigger.id is like the text from the trigger in the automation it works. When i send the trigger.id as variable to the script. The script see the the right text but i am not able to compare. its never true.
If you are using trigger.id in the automation, then use “AlleSekunden” in the script, but you need to fix the script call too. When calling directly you don’t have to use variables. If you want to have trigger in the script you need to include it in the values that are passed…
You may run into some issues passing triggers. IIRC, the trigger is going to be passed as a JSON string. But many triggers contain objects that are not JSON-serializable like datetime objects. If there are particular parts of the trigger you want access to, it may be better to just pass them explicitly.
Review my post above, I think I was editing it when you copied that… one variable in the automation was missing and one was under the variables key when it didn’t need to be.
okay understand. i tryed it like you showed, but the compare isn´t working in the script. I see that the trigger object is now complete in the script. But i am didn´t able to compare the trigger.id with the text.
are you tried this in your system? or you only write the correcting?