[SOLVED] Mqtt recieves data but it does not show

hey i am using a pir sensor on a esp8266 which sends a the pin state of a pin to which a motion sensor is attached to. i receives “MOTION-DETECTED” or it receives"STILL" depending upon the pi state. i can see the mqtt msg on mqttfx but it does not update on the basic UI.
here is the items file. sorry i am very new to openhab. i found some other post but i was not able to under stand as to what they were saying.
Contact MKDoorSensor1 "Motion [%s]" <motion> { mqtt="<[broker:MK-SmartHouse/security/MK-DoorSensor1:state:*]" }

however if i manually send"OPEN" or “CLOSED”, it does shows up on the display on basic UI. can someone WRITE an example line

1 Like

As the item is a contact this makes sense. If the PIR device is sending something different you would need to map the values to OPEN or CLOSED. I would assume you’d have to do something like this…

Contact MKDoorSensor1 "Motion [%s]" <motion> { mqtt="<[broker:MK-SmartHouse/security/MK-DoorSensor1:state:MAP(pir.map)]" }

Where pir.map is a file you would create in the transform directory that may contain…

MOTION-DETECTED=OPEN
STILL=CLOSED

Still a bit new to openhab myself but maybe someone more experienced can direct you if this doesn’t help.

2 Likes