Hey everyone, I wanted to share a quick solution I found for mapping sensor values to text. I was reading through the documentation and searching the forum, but it wasn’t entirely clear how to set this up. Let me walk you through my experience!
I have an MQTT sensor that returns a value of 1 or 2, representing different tariff levels. I wanted to display this as ‘Low’ or ‘High’ on my sitemap. At first, I thought about using the mapping parameter, but that didn’t quite fit since it’s not a switch or selection.
After some digging, I found that the map transformation service could work. I created a simple .map file with the mappings:
1=Low
2=High
Then, I set up the channel configuration in my items file. It took a bit of trial and error, but I finally got it working! The key was figuring out the correct syntax for the channel parameter and ensuring the sourceFormat was set properly.
This setup now displays the tariff status clearly on my dashboard. It’s a neat way to make sensor data more user-friendly without needing complex rules or scripts. I hope this helps someone else who’s tackling a similar problem!
Happy automating! ![]()