I am using openHAB 3 and try to migrate all files in /etc/openhab to the GUI. Yesterday I migrated a Shelly 3EM thing to the GUI. Now I see the following warning (which appears every few seconds) in openhab.log:
2021-03-08 12:25:27.740 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '0' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.0
The channel in the new thing looks like this:
- id: Relay
channelTypeUID: mqtt:switch
label: Relay
description: ""
configuration:
commandTopic: shellies/shellyem3-8CAAB561D930/relay/0/command
stateTopic: shellies/shellyem3-8CAAB561D930/relay/0
off: off
on: on
And the relay of the Shelly 3EM looks like this in MQTT Explorer:
I also can use the switch to turn the relay on and off. This works without a problem.
Well, I do not get it. I am lost somewhere in between. And hope for help.
It looks like the device is sending 0 to mean OFF and presumably 1 to mean ON. You’s set up the off parameters to look for “off” and the on parameter to look for “on”. Try using 0 and 1.
it was something different. A different channel of a different Shelly thing which I also migrated from a things-file to the GUI. This new Shelly 2.5 thing has a channel “OverTemperature”, which can be 0 and 1. This is how it looks in the MQTT Explorer:
Yes, "1" is not the same thing as 1 and either one can be delivered as an MQTT message. However, almost all the time the string "1" is sent instead of the number 1.
The thing works as it should, but I always get these warnings in my log file:
2021-12-20 21:24:48.483 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'ALLOFF' not supported by type 'OpenCloseValue': No enum constant org.openhab.core.library.types.OpenClosedType.ALLOFF
2021-12-20 21:24:50.495 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'GLOW' not supported by type 'OpenCloseValue': No enum constant org.openhab.core.library.types.OpenClosedType.GLOW
How can I change the configuration to get rid of these warnings?
Tried to put the commands into quotes, but this didn’t change anything.
This would the suggest the warning is coming from something other than a Switch Channel. A Switch Channel would usually complain about OnOffValue. Is your screenshot really of a Switch? Or have you setup another type of Channel somewhere else with almost identical information? Or another a Channel which is processing the same MQTT message?
Interesting point!
I had another channel subscribing to the same MQTT topic. Aim was to catch a periodic alive signal from the device. And this was linked to a contact item.
Have removed this channel now as I actually do not use it anyway.
So let’s see whether the messages will still come now.
But thank you! I was probably looking at the completely wrong point!!