[SOLVED] postUpdate Switch with Off instead of OFF


I bet I saw this somewhere, but i don’t find it anymore.

Currently I use a code like (fr is a string, CarDrFrRght a contact):

		if(fr == "Closed") {
		if(fr == "Open") {

Shouldn’t it be possible to use:

But I get:

Cannot convert 'Open' to a state type which item 'CarDrFrRght' accepts: [OpenClosedType, UnDefType].

Have tried to use something like:

Thanks - I just found the solution:

1 Like

I just recognized that average CPU load went from 20 up to 45-50 after the change.
Is that even thinkable or just a coincidence?

I would say it depends a bit on how often you run that code.

Good Morning :wink:

Same like the original code with 6 LOC - every 5 minutes

Although I’m having no knowledge about what this method does in the backgound I would relate that to such a change in the AVERAGE load.

You would or wouldn’t?

Sorry, wouldn’t. It’s a bit early!


That would have been my first guess as well.
I will revert back and see what happens.

i changed back to the previous setup, but the Cpu load is the same.
So there must be something else wrong.