How to compare values differing for upper/lower case?

As described in Xiaomi Air Purifier - Show all sensors and Switches in UI and HomeKit sometimes it is useful to make case-insensitive comparisons. For example, in the thread linked a device accepts status changes which are capitalised, but return states which are lowercase.

How to compare or convert strings to/with different case?

20200226_13:47:57_001

1 Like