Assuming your lock is setup and tested to work, that’s likely because your item definition is bad.
I’ve never seen that use of profiles so can’t tell if it’s supposed to work, but the common way would be
Number Office_frontdoor_state "Voordeur [MAP(nuki.map):%s]" <nukisl> (gNukiOfficeState) { channel="nuki:smartlock:NB_OFFICE_BACK_AND_FRONT_DOOR:SL_OFFICE_FRONT:lockState" }
For testing purposes, create another Number Item and link to the same channel (to get confidence in your setup).
So far as I know, your profile should work … transform profile currently only works with String target Item, thats fine, it’s what you are doing.
You have to install the MAP service, but you’d have seen an error message if you hadn’t.
However, Markus’idea is sound. (Except you should use a Number Item)
Don’t transform the Item actual state - who cares if its numeric. You only need the conversion if/when you display it in the UI. Transform the displayed state.
I wanted to map it to a boolean (ON / OFF) so I could use a widget I’ve created. The OpenHab widget shows a selected icon for the ON value and another icon for the OFF value.
But because the native Nuki binding returns more values than ON or OFF, I wanted to map them.
But apparently, this isn’t the correct way. Can I accomplish the same with a rule?
You cannot map data types. It’s a matter of fact that it has more values than 0 and 1 (ON/OFF).
What you probably want is to map the display. That’s what my code above does. You should be able to use your widget there.
Upps, missed that in the first place.
Of course it should be a number (assuming that’s the data type your device uses).