[SOLVED] UoM and Number:Temperature item types: missing something simple, I'm sure

Hi folks,

I’m obviously missing something very basic and probably glaringly obvious regarding UoM and Number:Temperature item types. Can you folks take a look and tell me what bonehead thing I’m not getting?

Thanks!

from my ct100.items:

Number:Temperature HVAC_HeatSetPoint "Set House Heating [%.0f %item%]" (gHVAC) {channel="zwave:device:8601bb4d:node14:thermostat_setpoint_heating", autoupdate="false" }

Changing the furnace setpoint, and then refreshing my mobile.sitemap in the openhab app on my phone displays Err on the setpoint line, and the following in the logs:

==> /var/log/openhab2/openhab.log <==
2019-10-15 20:01:08.563 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '72 ?F' of item HVAC_HeatSetPoint with format '%.0f %item%': Conversion = 'i'

==> /var/log/openhab2/events.log <==
2019-10-15 20:01:08.577 [vent.ItemStateChangedEvent] - HVAC_HeatSetPoint changed from 71 ?F to 76 ?F

mobile.sitemap:

    Text item=Temperature_HVAC label="Room Temp"
    Text item=HVAC_Operating_State label="Operating State"
    Selection item=HVAC_Mode label="Tstat Mode" mappings=[0="OFF", 1="HEAT"]
    Setpoint item=HVAC_HeatSetPoint label="Furnace Setpoint" minValue=55 maxValue=80 step=1

My sources are:

to fix my original problem:

But then I went down the UoM rabbit hole had to go and ‘make it better’:

particularly the code snippets under “NumberItem linked to QuantityType Channel”

These read like the default ‘channel’ definitions are already included in openhab, but maybe not?

Also,
since the UoM seems to be dependent on locale, I looked at locale:

root@openhab:/etc/openhab2# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
en_US.utf8

Side question: is the cannot set LC_CTYPE and LC_COLLATE a problem? I can’t see that openhab runs perl anywhere, but I dunno…?

I went ahead and ran openhabian-config set locale just to be sure

[17:52:37] root@openhab:/etc/openhab2# openhabian-config   
2019-10-15_17:53:22_AKDT [openHABian] Checking for root privileges... OK
Hit:1 https://repos.influxdata.com/debian buster InRelease                                                               
Hit:2 https://packages.grafana.com/oss/deb stable InRelease                                                              
Ign:3 https://dl.bintray.com/openhab/apt-repo2 stable InRelease                                                          
Get:4 https://dl.bintray.com/openhab/apt-repo2 stable Release [6051 B]                                                   
Hit:5 http://archive.raspberrypi.org/debian buster InRelease                               
Get:6 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Fetched 21.0 kB in 3s (7669 B/s)     
Reading package lists... Done
2019-10-15_17:53:31_AKDT [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2019-10-15_17:53:32_AKDT [openHABian] openHABian configuration tool version: [master]v1.5-524(b0beb7f)
2019-10-15_17:53:33_AKDT [openHABian] Checking for changes in origin... OK
2019-10-15_17:54:10_AKDT [openHABian] Setting locale based on user choice... 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_MESSAGES = "en_US.UTF-8",
	LANG = "en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LANGUAGE=en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.

$ update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LANGUAGE=en_US.UTF-8 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_MESSAGES = "en_US.UTF-8",
	LANG = "en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LANGUAGE=en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
2019-10-15_17:55:35_AKDT [openHABian] Checking for default openHABian username:password combination... perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_MESSAGES = "en_US.UTF-8",
	LANG = "en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LANGUAGE=en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
OK
2019-10-15_17:55:36_AKDT [openHABian] We hope you got what you came for! See you again soon ;)

Which UI are you using? There has been fairly recent work on the Android app in this setpoint/UoM area.

Hi,

the ‘about’ version says ‘2.9.0 - Sep 27, 2019 11:45:53 PM’

Thanks!

Have you tried a pattern like this: [%.1f %unit%]. I’d never seen “%item%”, but maybe it’s new :thinking:

3 Likes
Have you tried a pattern like this: **[%.1f %unit%]** .

That seems to have fixed it. Thank you!

Is the reference to ‘%item%’ in the sources mentioned a typo? or something completely different?

Don’t know which sources are meant, maybe it’s a placeholder for different purposes as in UoM-Doc described. (km, kWh, mmHg, etc.)