How to invert values for Chromecast binding idle state

I need to invert the value of my Chromecast idle state, so that I can add it to a group together with my PCs state from the network binding and they behave in the same way:
ON - when the device is active
OFF - when the device is in active

I know could use the proxy switch, but I thought I would try the mapping service, which unfortunately I cannot get to work. This is what I have:

I installed the mapping service in addons.cfg and saw in the logs, that it was installed:

transformation = map

In chromecast.items:

Switch Chromecast_Livingroom_Idle        "Chromecast Livingroom Idle"                     <network> (gAssistent) { channel="chromecast:chromecast:livingroom:idling" }
Switch Chromecast_Livingroom_Active        "Chromecast Livingroom Active"                     <network> (gAssistent) { channel="chromecast:chromecast:livingroom:idling", profile="transform:MAP", function="on_off_invert.map" }

In on_off_invert.map:

OFF=ON
ON=OFF

Any help would be much appreciated.

Transform profiles only work with String type Items

There’s little cost in creating a proxy Item and an update-invert rule

would you share “update-invert rule” with us? have a same chromecast issue

This is an old thread, 2 years have passed. If you are using now OH3, you could use a profile.