Virtual sensor in Domoticz for BME680

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Virtual sensor in Domoticz for BME680

#1 Post by mackowiakp » 02 May 2021, 06:50

I have a BME680 connected to the ESP. The BME680 gives 4 parameters. In order: temperature, humidity, pressure and air quality index.
I would like to have a virtual sensor in Domoticz that shows only information about temperature and humidity, based on data from the BME860.
For this purpose, I have created a virtual temperature and humidity senator idx=143 and I enter the ESP data into it with the command:

Code: Select all

SendToHTTP 192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=143&nvalue=0&svalue=[BME680#Temperature];[BME680#Humidity]
In the device list, this sensor "created" as

Code: Select all

THGN122/123/132,
THGR122/228/238/268
In the same list you can see that the above command sends data from BME but as received data something like this is shown:

Code: Select all

0,
12.15 C, 72.16%
Just like that. With '0' in first line and the rest of the measurements in the second.
The debug in ESP shows that measurements are passed correctly, without any leading "0" or so.
However, the sensor indications on the list in the dashboard are empty. Not zero, but just no values are displayed.
How can I correctly display the temperature and humidity data, as is the case with sensors such as DTH22?

TD-er
Core team member
Posts: 4931
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Virtual sensor in Domoticz for BME680

#2 Post by TD-er » 02 May 2021, 15:21

Domoticz is very strict on the order of parameters along with the sensor type.
For example there are sensor types like TEMP_HUM, TEMP_HUM_BARO, TEMP_BARO.
So you have to check what exact sensor type you assigned to the dummy sensor you added in Domoticz and make sure you send the values exactly in that order and it also matters if a sensor type expects a value as "nvalue" or "svalue".
For example, I know ESPEasy does send the values in the wrong field for when you define a type "CO2 sensor", so for this reason you need to use a "custom" sensor for CO2 in Domoticz.

See here for specific info on how values should be formatted per sensor type in Domoticz: https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Virtual sensor in Domoticz for BME680

#3 Post by mackowiakp » 02 May 2021, 16:05

OK. So in my case should be:

Code: Select all

/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP;HUM;HUM_STAT
where HUM_STAT should be 0=Normal 1=Comfortable 2=Dry 3=Wet

Have You ready routine how to count HUM_STAT from TEMP and HUM?

TD-er
Core team member
Posts: 4931
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Virtual sensor in Domoticz for BME680

#4 Post by TD-er » 02 May 2021, 17:41

https://github.com/letscontrolit/ESPEas ... pp#L19-L37

It is not present as a single command to be used in the rules.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

[SOLVED]Re: Virtual sensor in Domoticz for BME680

#5 Post by mackowiakp » 02 May 2021, 20:54

THX - Solved !

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests