[SOLVED] Exception while formatting value 'OFF' of item xxx with format '%.0f': f != java.lang.String

  • openHAB version: 2.4.0~M6-1 (Milestone Build)

I keep getting strange warnings in the log file:

[WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value 'OFF' of item xxx with format '%.0f': f != java.lang.String

The item, a Z-Wave keypad, is defined as:

Switch xxx "RFID Keypad Armed" <alarm> (GF_Hallway, Home)   {channel="zwave:device:512:node12:notification_access_control"}

It’s shown fine in the mobile app, except for the status which is ‘Err’:

I’m not formatting the value myself, my only usage in rules is like:

when                                                      
    Item xxx changed to ON

How can I get rid of that warning and why is it there?

Try defining it as a Number instead of a Switch.

The notification_access_control channel is defined as type Number.

1 Like

Thanks, at least that’s explained now. I have some further questions then:

  1. Why does it work properly as a switch (with ON/OFF), for example, I don’t need to cast it to OnOffType?
  2. How should I declare a switch that I can use instead to turn access control on/off?

But it wasn’t working properly as a switch. :wink:

This is a zwave device, right? Is there a config parameter to enable/disable access control? If so, a channel can be declared in the device database on the CONFIGURATION command class that sends the proper config parameter and value to enable/disable access control.