import again as i updated the function the edit was to tell you i edited it.
My input in the inject nodes are set to json and the values are Intergers not strings, i copied and pasted your json.
also if you say something is not working after you edited it, it would be best to post the changed code. Then we could see what you did, rather than guess.
Ok, it works if when I it ''Deploy''
If I change something in my input from Lovelace, I saw the value of my even state changing, but it seem the data doesn't updated in the function, I presume I have to do something in my joint node...
Join nodes can be tricky as the messges may not come in the sequence you think, I find it better to store the values in context when they update, then when a trigger (value or time) updates you just read all current values from context.