ok this works to toggle the light on and off,
but the state always goes to the or side of the logic,
is there a way to see what a variable / json has become so i know what value_json.properties.value is returning?
i will do so directly,
my first example was one of a dimmer,
my second one i went more basic to try and get a normal relais light working give me a sec to test
I think you misunderstood the purpose of the Solution tag. It identifies the suggestion that resolves the problem, not the post that duplicates/re-packages/summarizes someone else’s suggestion.
It’s the custom of this community to assign it to the post that resolves the original problem. Your first post clearly shows a value key in the JSON payload with a numeric value. That’s what I addressed in my first post with a template that correctly evaluates the payload’s numeric value.
Your second post introduced a different problem which was ultimately solved for you by petro in a separate topic you created. Copying that solution into this one and then tagging your own post as the Solution is, to be diplomatic, not the suggested practice in this forum.
hi just to be clear, I made this topic since I had no idea how to make mqtt lights for my solution in a yaml file, the answer i checked as solution here is the actual solution to my problem.
the second topic made was on how to extract values from a json string, which was indeed solved by the other lad.
so if people now search for mqtt to light entity they’ll get a nice solution, and in the other topic the same goes
That exactly how the Solution tag is not meant to be used.
It’s meant to identify the first post introducing the concept that fixes the issue. The post containing this information is most useful to other users because not everyone has the exact same situation.
If every user did what you’ve done here, all topics would conclude the same way where the topic’s author re-packages suggestions into their own post and crowns it the Solution. Effectively, users asking questions would appear to ultimately solve it themselves.