I need help to filter output of result mqtt

from topic tele/livingroom/RESULT i get this output:


I am not interested to seeing all the output only Reachable :true and IP :
I would appreciate advice on how to set it up in the item’s channel or even through a rule

This is a JSON Object.

And this is, how it looks like, when prettified:

	"Ping": {
		"": {
			"Reachable": true,
			"IP": "",
			"Success": 4,
			"Timeout": 0,
			"MinTime": 4,
			"MaxTime": 16,
			"AvgTime": 7

I’m pretty sure that IP is fix (it’s the name of the node)
To get the Reachable information into an Item (switch would be fine?) You’ll have to change some settings for the mqtt channel.

  - id: living
    channelTypeUID: mqtt:switch
    label: Living room reachable
    description: ""
      stateTopic: tele/livingroom/RESULT
      transformationPattern: JSONPATH:$.Ping[""].Reachable
      off: "false"
      on: "true"

If the ip will change from time to time, you can use this JSONPATH instead:


And creating another channel to get the current ip is easy enough (has to be a string channel, of course).

Thank you very much, Exactly what I was looking for

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.