How to invert switch

Tell me please.I have Motion Sensor. when there is movement it is disabled and when there is no movement it is on. I need invert switch in openhab. How to do when switch on and openhab looks off.

Just create a second item for your motion sensor.
Then create a rule like:
When motion sensor changed to OFF then send ON to „your_second_item“ and vica versa.

Though I actually never used this I think the more elegant solution for this problem would be to use a map transform between the things channel and the item:

What is your motion sensor, and how are you getting its data into openHAB?

I had the same issue (Aeontec 4-in-1 ZWave sensor). Here is a working example with transform. Curious how the quotation mark and the bracket can’t have spaces between them:


Switch  MotionSensor "Motion sensor [%s]" {channel="zwave:device:ZwaveController:node23:sensor_binary"[profile="transform:MAP", function=""]}