I’m trying to set up an automation that fires whenever the luminescence of a Fibaro motion sensor changes (and then do the same with temperature).
When the automation fires, the intention is to send the entity value as part of the URL call to a rest api along with the other parameters the api is expecting.
You’re not getting the state. You just have an entity_id in there without quotes (to make it a string). See this post about templating types. This means that the template is trying to access a sensor object that doesn’t exist. You need to get the state from the state machine using one of the template functions, like states().
You will find the majority of examples on this forum (not all but go figure) to have " as outers and ’ as inners. I think this is mainly because it is often the case that there are multiple inner quotes and thus it makes the template shorter (and easier to read in my opinion too).
Regardless if you stick to one or the other it will make cutting and pasting less fraught with ‘wrong quotes’
Edit: And just to make matters worse. the GUI editor may step in and say "Nah ! I don’t like that, I’ll change everything to singles quoutes and double single quotes - Just to mess with your head ! "