How to translate a property value

I have a weather device in HomeSeer that has a property for wind direction. The property values look like this:

image

I’d like to display the short form version of the direction (NNE, NE, ENE, for example) but I’m new enough to HR that I don’t really know the best way to go about this. It’s something that would be easy to do in a scripting language (have a function that accepts the long form string and returns the short form one), but I don’t yet know anything about scripts in HR or what they are capable of.

Whatever I do, it would ideally be reusable, as I’ll need to apply this to multiple different devices. I’m happy to do research on this myself, so even just pointers of things to read or search for would be helpful. Suggestions?

1 Like

Add a DataTrigger with a Setter that updates the Text property when your HomeSeer device is of a certain value. See screenshot below.

Thanks Bill. That will certainly work and I had thought about that already, but that will require something like 16 triggers, and I will need to apply them in a number of places (sadly, the weather device I’m using in HomeSeer works isn’t very HR friendly, making the use of an overall weather tile and a device browser likely not workable - I may post a separate topic on this later to see if anyone has ideas for that).

I work in IT, and I’m used to editing json/yaml/etc. I don’t believe I can bulk copy multiple triggers at once in DESIGN mode, but I’m guessing if I change to XAML mode, I could. True?

Correct, you can switch to XAML mode & copy exactly what you want.