With the MQTT1 binding the only thing I can think of is to switch to the JavaScript transform and do the mapping and swapping in the one transform.
Or you can use a proxy Item and as rule to calculate correct percentage.
With the MQTT2 binding, you can chain transforms so you’d only need a simple JavaScript to calculate the correct percent and continue to use the map transform.
Thank you very much for your script. It solved to me some problems on the event.log jejej
Do You know how can i control the % of the roller shutter. I mean to send “open 20%”
I see that if you set in the official app of shelly a 20% it send by mqtt the toppic: shellies/shellyswitch25-E59E6D/roller/0/pos 20
But i cant do it in openhab directly.
I want to do that because i am trying that when the sun is on a certain position the roller shutter open or close some porcentaje
i use this to close the blinds at mid day if door is closed and not much clouds and not already closed more deep
rules/shelly.rule
// Current cloudiness < 50%
if ( myCloudiness < 50 )
{
// nur herunterfahren, nicht wieder hochfahren!
if (Rollladen_wz_westen_pos.state < (100 - 50) ) # inverted state in shelly
{
Rollladen_wz_westen_pos.sendCommand(50) # send inverted POS% to shelly
so the old commands
Rollladen_wz_westen.sendCommand(“UP”)
Rollladen_wz_westen.sendCommand(“DOWN”)
are equal to
Rollladen_wz_westen_pos.sendCommand(0)
Rollladen_wz_westen_pos.sendCommand(100)