Hi,
I am running OpenHab in version 2.5.0~S1669-1 and was trying to configure my Yeelight Color Bulb (yeelink.light.color1) using the Xiaomi Mi IO Binding. I have successfully configured the thing and some items (power, rgbColor, brightness) which work fine from PaperUI and from BasicUI.
Here is my configuration.
Thing miio:basic:color6 "Yeelight Color Bulb" @ "Sonstiges" [ host="192.168.43.130", token="xxx", deviceId="xxx", refreshInterval="1" ]
Switch FF_Guestroom_Standlamp_Power "Power" {channel="miio:basic:color6:power"}
Number FF_Guestroom_Standlamp_Brightness "Brightness" {channel="miio:basic:color6:brightness"}
String FF_Guestroom_Standlamp_Delayoff "Shutdowm Timer" {channel="miio:basic:color6:delayoff"}
Number FF_Guestroom_Standlamp_ColorTemperature "Color Temperature" {channel="miio:basic:color6:colorTemperature"}
String FF_Guestroom_Standlamp_ColorMode "Color Mode [%s]" {channel="miio:basic:color6:colorMode"}
Switch FF_Guestroom_Standlamp_Toggle "toggle" {channel="miio:basic:color6:toggle"}
Color FF_Guestroom_Standlamp_RgbColor "RGB Color" {channel="miio:basic:color6:rgbColor"}
String FF_Guestroom_Standlamp_Name "Name" {channel="miio:basic:color6:name"}
My problem now is about the item FF_Guestroom_Standlamp_ColorMode. I can change the color mode in the Yeelight App and see that the values changes in the OH2 log.
2019-08-27 16:20:01.933 [vent.ItemStateChangedEvent] - FF_Guestroom_Standlamp_ColorMode changed from 1 to 2
2019-08-27 16:20:02.975 [vent.ItemStateChangedEvent] - FF_Guestroom_Standlamp_ColorMode changed from 2 to 1
When I want to change the value from PaperUI or BasicUI, the following appears in the log.
2019-08-27 16:09:47.427 [ome.event.ItemCommandEvent] - Item 'FF_Guestroom_Standlamp_ColorMode' received command 2
2019-08-27 16:09:47.432 [nt.ItemStatePredictedEvent] - FF_Guestroom_Standlamp_ColorMode predicted to become 2
2019-08-27 16:09:47.470 [vent.ItemStateChangedEvent] - FF_Guestroom_Standlamp_ColorMode changed from 1 to 2
2019-08-27 16:09:47.572 [vent.ItemStateChangedEvent] - FF_Guestroom_Standlamp_ColorMode changed from 2 to 1
I have played around with the item type (number, number:dimensionless), but did not have any success.
While having the item configured as String the Yeelight App changes are showed in the OH2 log. When having configured the item as Number, the App doesn’t change the value in OH2 anymore.
So I got a bit stuck at this point and need some help.
Update #1:
I was thinking about the problem an was playing a bit around. When removing the [%s] from the label and looking at the logs, I see the following line.
Exception while formatting value '2' of item FF_Guestroom_Standlamp_ColorMode with format '%.0f': f != java.lang.String