I am confronted to a strange problem (OpenHab 1.6).
I am sending an MQTT message to an OPENHAB item
String SESKEY “Session Key Option (0-05) [REGEX(TEST=On,OFF=Off ):%S]” { mqtt="<[mymosquitto:Home/RF/nb/+/0/05:state:default]" }
The message I am sending is ‘ON’ or ‘OFF’ (uppercase) which is not accepted, however ‘on’, ‘On’, ‘oN’ and ‘Off’, ‘OFf’ are well accepted.
Other strings with uppercase or lowercase are always accepted, the issue is only with ON and OFF
Using the map file (en.map)
Site map includes
Text item=SESKEY label=“Session Key Option (0-05) [MAP(en.map):%S]”
CLOSED=closed
OPEN=open
undefined=unknown
ON=On
OFF=Off
Doesn’thelp
Neither a regular expression
Text item=SESKEY label=“Session Key Option (0-05) [REGEX(ON=on,OFF=off):%S]”
However using a Switch Item, I have to use ‘ON’ of ‘OFF’ uppercase to activate the inbound binding(<[mymosquitto:Home/RF/nb/040/0/44:state:default]”).
Now reading the documentation I see that the actual syntax should be ‘Off’ or ‘On’.
So a bunch of questions:
- Why is it a test done for the upper / lowercase on a string On or Off only?
- Why is the translation service not working (or what did I wrong)?
- Why is the syntax ON/OFF uppercase for a switch and not On/Off as defined in the documentation (because I have to make exception between a switch to be ON or OFF an a variable that is ON or OFF?
Thanks in advance
Robert
FYI
ITEMS FILE
Group Ground_Floor “”
Group Living “”
Switch Living_Light_Street “” { mqtt=">[mymosquitto:Home/RF/sb/040/0/44:command:ON:default],>[mymosquitto:Home/RF/sb/040/0/44:command:OFF:default],<[mymosquitto:Home/RF/nb/040/0/44:state:default]" }
Number Temperature_Living “Temperature_Living_Street_Side” (Ground_Floor,Living) { mqtt="<[mymosquitto:Home/RF/nb/040/2/40:state:default]" }
Number Humidity_Living “Humidity_Living_Street_Side” (Ground_Floor,Living) { mqtt="<[mymosquitto:Home/RF/nb/040/2/42:state:default]" }
Group Overview “”
Switch Living_KAKU “” { mqtt=">[mymosquitto:home/HA_gateway/sb/node016/dev17:command:ON:1_D],>[mymosquitto:home/HA_gateway/sb/node016/dev17:command:OFF:0_01332798_0_00]", mqtt="" }
String Coordinator_90 “Coordinator Error Messages (3-90) [%S]” { mqtt="<[mymosquitto:Home/RF/nb/251/3/90:state:default]" }
String Coordinator_91 “Coordinator Event Messages (3-91) [%S]” { mqtt="<[mymosquitto:Home/RF/nb/251/3/04:state:default]" }
String Mote_92 “Mote Error Messages (3-92) [%S]” { mqtt="<[mymosquitto:Home/RF/nb/251/3/92:state:default]" }
String Mote_93 “Mote Event Messages (3-93) [%S]” { mqtt="<[mymosquitto:Home/RF/nb/251/3/93:state:default]" }
Group Network_Messages “”
Group Configuration_ACK “Configuration Acknowledgement” { binding="" }
Number NETWID “Network Identification (1-01) [%d]” { mqtt="<[mymosquitto:Home/RF/nb/+/1/01:state:default]" }
Number NODEID “Node Identification (1-02) [%d]” { mqtt="<[mymosquitto:Home/RF/nb/+/1/02:state:default]" }
Number COORID “Coordinator Identification (1-03) [%d]” { mqtt="<[mymosquitto:Home/RF/nb/+/1/03:state:default]" }
String ENCKEY “Encrypted Key (3-04)” { mqtt="<[mymosquitto:Home/RF/nb/+/3/04:state:default]" }
String SESKEY “Session Key Option (0-05) [REGEX(TEST=On,OFF=Off ):%S]” { mqtt="<[mymosquitto:Home/RF/nb/+/0/05:state:default]"
SITEMAP FILE
sitemap Home label=“Home Automation”
{
Frame item=Ground_Floor label=“Ground_Floor” {
Text item=Ground_Floor label=“Ground_Floor” {
Text item=Living label=“Living” {
Switch item=Living_Light_Street label=“Lamp (Street Side)”
Text item=Temperature_Living label=“Temperature (Street Side) [%.1f °C]”
Switch item=Living_KAKU label=“Living_KAKU”
Text item=Humidity_Living label=“Humidity (Street Side) [%.1f %%RH]”
}
}
}
Frame item=Overview label=“Status_Overview” {
Text item=Overview label=“Recordings” {
Frame item=Living {
Text item=Overview label=“Living”
Chart item=Temperature_Living label=“Last Hour Temp [%.1f °C]” icon=“temperature” period=hrefresh
Chart item=Humidity_Living label=“Last Hour Humidity [%d %%RH]” icon=“humidity” period=hrefresh
Webview label=“Graph” icon=“chart” url=“https://192.168.0.253:8443/habmin/chart.html?chart=Living1&service=rrd4j&period=30000&refresh=15” height=10
}
}
}
Frame item=Network_Messages label=“Network Errors and Events” {
Text item=Network_Messages label=“Network Messages” {
Text item=Coordinator_90 label=“Coordinator Error Messages (3-90) [%s]”
Text item=Coordinator_91 label=“Coordinator Event Messages (3-91) [%s]”
Text item=Mote_92 label=“Mote Error Messages (3-92) [%s]”
Text item=Mote_93 label=“Mote Event Messages (3-93) [%s]”
}
Text item=Configuration_ACK label=“Configuration Acknowledge” {
Text item=NETWID label=“Network Identification (1-01) [%d]”
Text item=NODEID label=“Node Identification (1-02) [%d]”
Text item=COORID label=“Coordinator Identification (1-03) [%d]”
Text item=ENCKEY label=“Encryption key (3-04) [%s]”
Text item=SESKEY label=“Session Key Option (0-05) [MAP(en.map):%S]”
}
}
}