I have a seemingly basic question, what is the best way to make the first letter(s) of an item value upper case? The “Weather Condition” values are lower-case as provided by the OpenWeatherMap API. For example: I have “clear sky” currently but would like it to show “Clear Sky”. Based on what I’ve read under the Transformations documentation I’m inclined to take the Regex approach (RegEx - Transformation Services | openHAB).
Is there a more elegant solution?
Here is the relevant block from my .sitemap:
Frame label="Weather" {
Text item=LocalWeatherandForecast_StationName icon="house"
Text item=LocalWeatherandForecast_Location icon="marker"
Text item=LocalWeatherandForecast_ObservationTime icon="time"
Text item=LocalWeatherandForecast_WeatherCondition
Text item=LocalWeatherandForecast_OutdoorTemperature
Text item=Sun_SunPhaseName icon="time"
Text item=Sunrise_Time icon="sunrise" visibility=[Night_State == ON]
Text item=Sunset_Time icon="sunset" visibility=[Night_State == OFF]
Text item=Moon_MoonPhaseName icon="moon"
Text item=ntp_ntp_local_string icon="time"
}
- Platform information:
- Hardware: armv7l/1GB RAM/32GB SD
- OS: Openhabian (Raspbian GNU/Linux 11 (bullseye))
- Java Runtime Environment: openjdk 11.0.16 2022-07-19
- openHAB version: 3.3