Hi There,
I am new with OpenHab2. I am trying get date from an UDP generic object (ESP8266 that sends UDP packets).
This object sends a JSON message, as below :
{
"NodeID" : "8bf619a620a0",
"NodeName" : "node12",
"IPAddress" : "192.168.0.69",
"Temperature" : "21.00",
"Humidity" : "33.00%",
"ButtonState" : "0"
}
I would like to define a Things with multiple channels. I don’t knows if this is the best way but I thought a definition like this in the .things
file :
Thing network:device:buttonbox117 "Bouton117" @ "Salle 117" {
Channels:
Number : Temperature [ udp="<[192.168.0.69:*:JSONPATH($.Temperature)"]
Switch : ButtonState [ udp="<[192.168.0.69:*:JSONPATH($.ButtonState)"]
}
… And then I have defined these Items in .items
file :
// Don't erase this line : bug on UDP service. We need at least a UDP configuration to launch UDP Listener
Number X "Ignore" <temperature> {udp="<[192.168.0.254:6060:default]"}
Switch UDP_Boitier_button "Présence" <switch> ["Salle 117"] { Channel="network:device:buttonbox117#ButtonState" }
Number:Temperature UDP_Boitier "Température boitier" <temperature> ["Salle 117"] { Channel="network:device:buttonbox117#Temperature" }
Finally, I wrote a debug rule, of course in a .rules
file :
rule "UDP Test"
when
Item UDP_Boitier changed
then
var myState = getThingStatusInfo("network:device:buttonbox117#temperature")
if (myState != Null) {
logInfo("UDP_Boitier sent ===========> ", myState)
} else {
logWarn("UDP_Boitier sent No value ?? ", myState)
}
end
When I take a look at the logs, I have some warning :
...
2019-01-28 17:46:10.697 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
2019-01-28 17:46:10.703 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
2019-01-28 17:46:10.709 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
2019-01-28 17:46:10.714 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
2019-01-28 17:46:10.719 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
2019-01-28 17:46:10.725 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
2019-01-28 17:46:10.730 [WARN ] [ing.tcp.protocol.internal.UDPBinding] - No provider could be found for the item 'UDP_Boitier'
I suppose these line are generated because of the thing
declaration ?
I don’t know what I am doing wrong for now ?
Is there a complete tutorial to set a multiple channels Thing by configuration (i.e. writing in `/etc/openhab2/[things, Items, rules])