Command '0' not supported by type 'OnOffValue'

  • Platform information:

    • Hardware: Rasperry Pi3
    • OS: Raspian Stretch
    • Java Runtime Environment: 1.8.202
    • openHAB version: 2.4
  • Issue of the topic: I am seeing “Command ‘0’ not supported by type ‘OnOffValue’: No enum constant org.eclipse.smarthome.core.library.types.OnOffType.0” Error when starting the OpenHab Service.

  • Please post configurations (if applicable):

    • Items configuration related to the issue :
      My Sample Item configuration Line is : Switch Hall_Light “Hall Light” (Lights, Hall) [ “Lighting” ] {mqtt=">[mosquitto:/home/switch1:command:ON:1],>[mosquitto:/home/switch1:command:OFF:0],<[mosquitto:/home/switch1:state:ON:1],<[mosquitto:/home/switch1:state:OFF:0],<[mosquitto:/home/switch1:state:MAP(onoff.map)]",autoupdate=“false”}
  • If logs where generated please post these here using code fences:

2019-01-23 01:27:05.559 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘default.items’
2019-01-23 01:27:09.730 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘default.rules’ has errors, therefore ignoring it: [4,5]: mismatched input ‘’ expecting ‘end’

2019-01-23 01:27:09.979 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-01-23 01:27:10.614 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘default.sitemap’
2019-01-23 01:27:12.369 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “arping” (in directory “.”): error=2, No such file or directory)
2019-01-23 01:27:12.488 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “arping” (in directory “.”): error=2, No such file or directory)
2019-01-23 01:27:13.113 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.141:8080
2019-01-23 01:27:13.116 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.141:8443
2019-01-23 01:27:14.578 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-01-23 01:27:14.785 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2019-01-23 01:27:15.397 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘192.168.1.141’ with clientid paho871353120753 and file store ‘/var/lib/openhab2/mqtt/192.168.1.141’
2019-01-23 01:27:15.693 [WARN ] [eneric.internal.generic.ChannelState] - Command ‘0’ not supported by type ‘OnOffValue’: No enum constant org.eclipse.smarthome.core.library.types.OnOffType.0

Too many inbounds, one with map should suffice:

witch Hall_Light “Hall Light” (Lights, Hall) [ “Lighting” ] {mqtt=">[mosquitto:/home/switch1:command:ON:1],>[mosquitto:/home/switch1:command:OFF:0],<[mosquitto:/home/switch1:state:MAP(onoff.map)]",autoupdate=“false”}

What is the content of onoff.map?

You have other problems:

2019-01-23 01:27:12.369 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “arping” (in directory “.”): error=2, No such file or directory)

Network binding: remove the arp parameter or install arp on your system

2019-01-23 01:27:09.730 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘default.rules’ has errors, therefore ignoring it: [4,5]: mismatched input ‘’ expecting ‘end’

Post the file, You have errors in it or use VS Code to edit your files:

1 Like

the content of onoff.map is given below.

pi@rasp141:/var/log/openhab2 $ cat /etc/openhab2/items/transform/onoff.map
0=OFF
1=ON

& For the arp issue, i tried to run 'sudo apt-get install arp" But, nothing found. Not sure how to install it.

The Package is named arping, try

sudo apt-get install arping

1 Like

Thanks JensH ! Have installed now, let me clean up the logs and try again.

Also, any example how to use MQTT 1.5.5 with OpenHab 2.4.x?

Thanks,
Siva

There are no major changes from previous version
So any example with this sort of syntax should work. But this this is the MQTTv1 binding.
Watch out. There is a new MQTT binding called MQTTv2 in the forum. And you have MQTTv1

Can you please suggest the right model of MQTT Binding i need to use?

mosquitto version 1.5.5 (MQTT 3.1)
Openhab 2.4 stable

Which one did you install?

I have installed raspian stretch full version and then installed openhab 2.4 stable manually

So is it mqttv2 or mqttv1?
I think you have mqtt v2
in which case you need to look at: