I have a proxy item and I want to update this item with the status changed by another item
rule "PROXY state changed test"
Item DoorSensor18_TamperAlarm changed
If the item has the same type this is working well. But if the item types are different I want to use the map to convert it.
But this does not work, syntac error.
content of convert_contact_switch.map:
I’m not sure where you got that code but it is all kinds of wrong.
To call a transform from a rule use the transform action:
transform("transform name", "transform argument", "string to transform")
So in your case you would use:
val trans = transform("MAP", "convert_contact_switch.map", DoorSensor18_TamperAlarm.state.toString)
Ah, I understand, in my case?
DoorSensor18_TamperAlarmProxy = transform(“MAP”, “convert_contact_switch.map”, DoorSensor18_TamperAlarm.state.toString)
It is not working:
Rule ‘PROXY state changed test’: An error occured during the script execution: null
now it is working without any changes. I only opened the map file once and closed it. looks like the map file was not read into openhab.
Thanks, works perfect now.