Sharing a weird experience with Item names, but I got it working

This is not a question, just sharing an experience :slight_smile:
Recently, with help of the forum, I added the time my doorbell was pressed to my application. Once you know how, that is very simple.
So i felt confident I could now also add the time my motionsensor was last triggered.

I copied the code for items file, sitemap and rules, changed the name of the items where necessary and… nothing.
In slight disbelief I checked and rechecked my code, seemed OK, checked my MQTT commands, yes, all looked fine.
In more disbelief I redid the code, now placed it right under the doorbell code, checked it letter for letter and all looked OK, with exception ofcourse that instead of:
“Doorbell_Update” and “Doorbell” in the working code, I had:
“MotionSensor_Update” and “MotionSensor” in the code that was not working.
Checked my eventlog and I saw that exact trigger as defined in my rules, took place, but there was no action.

Programming is (usually) not magic, if the only difference between a non working code and a working code appears to be the name of the item(s), maybe that is the cause.

So I checked every file I had for the occurrance of ‘MotionSensor’. Nope, had not defined it anywhere else. Yet, I didnt have a good feeling about it, when using English words, it is easy to maybe unknowingly use a reserved word.
At these times I like to quote supersleuth Sherlock Holmes: "Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth."
So, I did the only thing that at that moment was left as option: I changed the name of the items into their dutch equivalents. So “MotionSensor” became “Bewegingssensor”.
Low and behold, it worked right away.
As said, programming is not magic. No doubt there is a good reason for it, maybe somewhere I overlooked that I already had used the item name somewhere else (dont think so) but it worked

“rules not triggering” have also been reported where the actual rule name has been accidentally duplicated i.e.

rule "this must be unique"
when
    .. blah ..

Thanks. yes, I had changed that too, sorry, forgot to mention that :slight_smile:
But indeed it is good to state that.
it is one of those small things one tends to forget when copying code sections.
Anyway, it will probably remain a mystery, but “going dutch” solved it :wink: