MQTT format for Temp & humidity

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

MQTT format for Temp & humidity

Post by Andrex » Wednesday 12 October 2016 23:06

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: 64
Joined: Thursday 18 February 2016 10:11
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Andrex » Thursday 13 October 2016 15:20

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: 64
Joined: Thursday 18 February 2016 10:11
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Andrex » Sunday 16 October 2016 14:55

No one knows??? Come on, I don't believe it!

Toyman
Posts: 35
Joined: Wednesday 31 August 2016 16:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Toyman » Monday 24 October 2016 8:56

{ "idx" : 74,
"nvalue" : 0,
"svalue" : "21;35;1"}

Andrex
Posts: 64
Joined: Thursday 18 February 2016 10:11
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Andrex » Saturday 29 October 2016 12:53

YES YES YES!
Thanks Toyman!!!
Though it was really elementary... :oops:

Toyman
Posts: 35
Joined: Wednesday 31 August 2016 16:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: MQTT format for Temp & humidity

Post by Toyman » Sunday 30 October 2016 17:14

You are welcome. Actually, it's all in Domoticz wiki

ben53252642
Posts: 524
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: MQTT format for Temp & humidity

Post by ben53252642 » Sunday 19 August 2018 20:30

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

viewtopic.php?f=68&t=23607&start=40#p189095

ben53252642
Posts: 524
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: MQTT format for Temp & humidity

Post by ben53252642 » Wednesday 19 September 2018 0:12

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest