- Platform information:
- Hardware: Rpi Zero W
- OS: _openhabianpi latest
- Java Runtime Environment: _openhabianpi
- openHAB version: 2.2.0-1
- mosquitto and all mqtt stuff installed and configured.
I am new to MQTT and I am struggling with the following task:
I want to create a precence detector that can identify different persons wearing a beacon and turn on different lights depending on the person that enters the room.
I have installed a happy bubbles beacon receiver. This rceiver detects the beacon I am wearing and sends a mqtt message to mosquitto. This is working - I checked it with MQTTfx. The name of my beacon is ‘Mike is here’ the name of the receiver is happy-bubbles-1
The topic and the message are as follows:
Topic: happy-bubbles/presence
Message: Mike is here is most likely in happy-bubbles-1 with average distance 0.471933
Now what I would like to do is trigger a switch when this message arrives. The distance will vary so it must not be considered. If it can be extracted than it might later be useful for extended logic. The switch should turn on a light. Thats it.
I started in my items file with this:
Switch GF_Boiler_Motion “Mike is here” (GF_Boiler, gMotion) {mqtt="<[mosquitto:happy-bubbles/presence:state"}
But then I have no clue how to transform that message into a switch. It is only neccessary to turn the switch on. The light should be turned on everytime the message is rceived. If I leave the room no more messages will arrive and I will use a timer to switch the light off.