Integration Solutions using MQTT

I’m not positive I’m reading your MQTT trace correctly, but it looks like there are two different kinds of messages being published.

  • One is a simple text message of "online’.
  • Another is a JSON-formatted object with various key/value items.

So the question would be what field are you wanting to trigger off of, and what action do you want to take.

I’m guessing by the data this is a status of your iphone presence. So one thing you could do is use the HTTP Devices driver and create a virtual presence device. Then you could configure that device to go into ‘present’ state when the string ‘online’ is received.

If you are trying to key off of something in the JSON-formatted messages, you need to set the “Expected Message Format” device Setting value to ‘JSON’. Then you could base the ‘present’ and ‘not present’ state off of one of the key-values in the JSON message. For example, if you are using the ‘confidence’ field, then your PRESENT value setting would be ‘confidence’, because that’s the key of the value you want.