I need a little help in receiving MQTT from a simple implementation of an esp8266. I am able to communicate with the esp-01 and can control an LED using the following item:
You’ve not supplied your switch.map so I can’t see how you’re handling the mapping. You’ve also not said what errors if any you receive so at the moment I can only say the following:
Contact items only allow states OPEN and CLOSED, not 0 or 1, so there may lie your problem. Maybe your item should be defined as a Switch, or maybe you need to map 1 and 0 to OPEN and CLOSED.
2015-12-10 21:22:38.542 [ERROR] [i.internal.GenericItemProvider] - Binding configuration of type ‘mqtt’ of item ?MQTBTN1? could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: Configuration ‘mymosquitto:/esp01/switch/button:state:default)’ is not a valid outbound configuration: Configuration requires 5 parameters separated by ‘:’
2015-12-10 21:22:38.520 [ERROR] [i.internal.GenericItemProvider] - Binding configuration of type ‘mqtt’ of item ?MQTBTN? could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: Configuration ‘mymosquitto:/esp01/switch/button:state:MAP(switch.map)’ is not a valid outbound configuration: Configuration requires 5 parameters separated by ‘:’
Here is the switch.map which works for my zwave contacts.
My setup:
EasyESP firmware on nodemcu.
Openhab2
Raspberry pi running openhab2 with mosquito mqtt broker.
In openhab2, i have install mqtt binding and MAP transformation.