Sending scd40 triple sensor to domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Humanoidx
New user
Posts: 9
Joined: 01 Apr 2017, 20:50

Sending scd40 triple sensor to domoticz

#1 Post by Humanoidx » 24 Apr 2023, 09:42

Not sure if I'm missing something but I can't find a way to retrieve the co2, humidity and temp data from the scd40 on domoticz.
Is there a way to send each of the data values to different idx values? Or any other tips?

User avatar
Ath
Normal user
Posts: 3508
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Sending scd40 triple sensor to domoticz

#2 Post by Ath » 24 Apr 2023, 11:14

You can do that using Rules. That feature has to be enabled in Tools/Advanced, and then you can create event handlers like this, assuming your task is named SCD40:

Code: Select all

on SCD40#CO2 do
  SendToHTTP,<domoticz-ip>,8080,/json.htm?param=udevice&type=command&idx=<CO2-idx>&nvalue=0&svalue=%eventvalue1%
endon
// ditto for SCD#Humidity and SCD40#Temperature
- You will have to fill in the <domoticz-ip>, possibly change the portnumber (8080), and fill the desired <CO2-idx>. (For some types of devices, Domoticz expects the value in nvalue instead of svalue, that is to be empirically determined)
- You will have to add similar code for Humidity and Temperature
- In the SCD40 Task the option to send all values in a single event (#All) should not be enabled! (default is off)
/Ton (PayPal.me)

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

Re: Sending scd40 triple sensor to domoticz

#3 Post by TD-er » 24 Apr 2023, 12:42

Domoticz doesn't have a sensor type for CO2, temp and hum.
However there is a type for temp/hum.

N.B. Domoticz does differentiate between "svalue" and "nvalue"
I know we are sending using the "wrong" type for the existing CO2 sensor plugins to Domoticz, so for those you need to use a "Custom" sensor type in Domoticz instead of CO2.

You can copy the temp/hum data to a dummy task and set its output type to some temp/hum type and call "taskrun" on that dummy task. This way you know the data for those is formatted correctly for Domoticz.

In the ESPEasy settings, there is only a single spot per controller for an IDX value, which makes it nearly impossible to allow a plugin to send using multiple different IDX values per task. So sending it via rules is probably the best option here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 41 guests