MQTT format for Temp & humidity

Moderator: leecollings

Post Reply
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

MQTT format for Temp & humidity

Post by Andrex »

Hi guys,
I've created a "Temp + Humidity" device from a dummy hardware.
I want to sent to it the value from Node-Red from another machine. I've tried sending this data in multiple ways with MQTT to domoticz/in, but without any luck.
How do I need to format the MQTT to send the temp and humidity?
Thanks!!!
Andrea
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Andrex »

Using this format
{
"Battery" : 100,
"RSSI" : 12,
"dtype" : "Temp + Humidity",
"id" : "13825",
"idx" : 93,
"name" : "Badkamer",
"nvalue" : 0,
"stype" : "WTGR800",
"svalue1" : "22.5",
"svalue2" : "58",
"svalue3" : "1",
"unit" : 0
}
from this post http://www.domoticz.com/forum/viewtopic ... ure#p93407, I see the temperature updating with the nvalue, not svalue1 and just the temperature not the humidity :(

If I listen to all the MQ

Code: Select all

domoticz/in {"idx" : 23,"nvalue" : 11,"svalue1" : 21.2,"svalue2" : 52.5}
domoticz/out {
   "Battery" : 255,
   "RSSI" : 12,
   "dtype" : "Temp + Humidity",
   "id" : "82022",
   "idx" : 23,
   "name" : "Temp+Hum",
   "nvalue" : 11,
   "stype" : "THGN122/123, THGN132, THGR122/228/238/268",
   "unit" : 1
}
Domoticz doesn't read the svalues
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Andrex »

No one knows??? Come on, I don't believe it!
Toyman
Posts: 23
Joined: Wednesday 31 August 2016 16:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Toyman »

{ "idx" : 74,
"nvalue" : 0,
"svalue" : "21;35;1"}
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Andrex »

YES YES YES!
Thanks Toyman!!!
Though it was really elementary... :oops:
Toyman
Posts: 23
Joined: Wednesday 31 August 2016 16:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Toyman »

You are welcome. Actually, it's all in Domoticz wiki
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: MQTT format for Temp & humidity

Post by ben53252642 »

Solution for sending Temp + Hum + Baro to a single sensor in Domoticz via MQTT

viewtopic.php?f=68&t=23607&start=40#p189095
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: MQTT format for Temp & humidity

Post by ben53252642 »

To send only Humidity to a Humidity Sensor in Domoticz via MQTT, I spent over an hour trying to get this to work (solution):

It's sensitive to quotes "", this is what I use in a Node-Red function:

msg.payload.idx = 1211;
msg.payload.nvalue = humidity;
msg.payload.svalue = "0";

The nvalue cannot be sent as a string.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest