Multiple similar sensors to one MySensors node
Moderator: leecollings
-
- Posts: 24
- Joined: Saturday 31 January 2015 19:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Multiple similar sensors to one MySensors node
I'm experimenting with an ESP module using the MySensors library (1.6.0 beta). I have these devices attached to the ESP module:
Dallas DS18B20
BMP085
BH1750
DHT11
SI7021
Input Switch
In Domoticz i get this child list for this MySensors gateway node: So this seems to work fine, but Domoticz seems to try to make combined devices from these child id's:
262 Lux sensor with id 0000 and unit 0
263 TempHumBaro with id 0000 and unit 8
264 TempHumBaro with id 0005 and unit 5
266 TempHumBaro with id 0011 and unit 17
267 TempHumBaro with id 000D and unit 13
And it looks like humidity values are mixed up. I can image that Domoticz has no way to tell how these child id's should be combined, because I think that the MySensors protocol has no support for this?
Or can I configure somehow which child id's belong to a certain device in Domoticz?
Dallas DS18B20
BMP085
BH1750
DHT11
SI7021
Input Switch
In Domoticz i get this child list for this MySensors gateway node: So this seems to work fine, but Domoticz seems to try to make combined devices from these child id's:
262 Lux sensor with id 0000 and unit 0
263 TempHumBaro with id 0000 and unit 8
264 TempHumBaro with id 0005 and unit 5
266 TempHumBaro with id 0011 and unit 17
267 TempHumBaro with id 000D and unit 13
And it looks like humidity values are mixed up. I can image that Domoticz has no way to tell how these child id's should be combined, because I think that the MySensors protocol has no support for this?
Or can I configure somehow which child id's belong to a certain device in Domoticz?
Re: Multiple similar sensors to one MySensors node
But why would you connect more than one sensor that reads the same thing?
Re: Multiple similar sensors to one MySensors node
Why would you like to read multiple temperature... Et cetera...Timdgr wrote:But why would you connect more than one sensor that reads the same thing?
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Multiple similar sensors to one MySensors node
Possible answer is in the original postTimdgr wrote:But why would you connect more than one sensor that reads the same thing?
The word experimenting gives the clueI'm experimenting with an ESP module using the MySensors library
Sometimes a part is giving 2 outputs, a DHT11 part is giving Temp and Humidity , a BMP05 baro is giving Hpa and Temp
So 2 times a temp on the same ESP
Sometimes you have 1 ESP and a temp-sensor outside and 1 temp-sensor inside
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
Re: Multiple similar sensors to one MySensors node
Ok I understand now why this could be useful. Is there any news on this? Is it a real issue and how to get around this?NietGiftig wrote:The word experimenting gives the clue
Sometimes you have 1 ESP and a temp-sensor outside and 1 temp-sensor inside
I think that no one has done before with the Arduino/NRF versions of MySensors otherwise it would have been reported earlier. Maybe the only way to support inside and outside temp reading is by using two nodes.
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Multiple similar sensors to one MySensors node
thats what i like...
One arduino or my esp with multiple sensors...
Only i wil have more pushbuttons, for my pelletstove.
Please do you have a simple how to..[ or some thing ]
I got the stuff, only i do not get it to work.
The tutorials i can find, are for one gateway/sensor..
How do you make this..
Or when you have time..
A wiki....
One arduino or my esp with multiple sensors...
Only i wil have more pushbuttons, for my pelletstove.
Please do you have a simple how to..[ or some thing ]
I got the stuff, only i do not get it to work.
The tutorials i can find, are for one gateway/sensor..
How do you make this..
Or when you have time..
A wiki....

Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 31
- Joined: Monday 21 September 2015 16:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Multiple similar sensors to one MySensors node
same problem. MySensors library 1.5.1 NRF24L01
incorrect values humidity sensors DHT22, when several devices
incorrect values humidity sensors DHT22, when several devices
Last edited by Sevift on Tuesday 29 December 2015 10:23, edited 1 time in total.
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Multiple similar sensors to one MySensors node
I'm using EspeasyDerik wrote:thats what i like...
The tutorials i can find, are for one gateway/sensor..
How do you make this..
http://www.esp8266.nu/index.php/Main_Page#Firmware
Works good with Domoticz
I think it's from the topic starter

RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 24
- Joined: Saturday 31 January 2015 19:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple similar sensors to one MySensors node
So it seems that I'm not the only one facing this issue.Sevift wrote:same problem. MySensors library 1.5.1 NRF24L01
incorrect values humidity sensors DHT22, when several devices
So either:
1) We both don't know how to build this properly

2) The MySensors gateway support in Domoticz does not support what we're trying to accomplish

Would be nice to learn which of them is true. I've launched a new ESP project that would be rather useless if this is not supported. So development is on hold as long as this remains unclear.
Last edited by mvdbro on Thursday 31 December 2015 9:24, edited 1 time in total.
-
- Posts: 49
- Joined: Thursday 17 December 2015 22:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5877
- Location: Norway
- Contact:
Re: Multiple similar sensors to one MySensors node
I would just like to vote for this feature as I plan to make one refrigerator node that would have two separate dht22 sensors (one for fridge and one for freezer).
I am waiting for parts to arrive, it would be a bummer if we are limited to one sensor per node
I am waiting for parts to arrive, it would be a bummer if we are limited to one sensor per node
Raspberry Pi 2 B - MySensors (dimmers, switches, motion, temperature, lux, humidity sensors)
zWave (220v switches)
various 433 via RFLink
zWave (220v switches)
various 433 via RFLink
-
- Posts: 31
- Joined: Monday 21 September 2015 16:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Multiple similar sensors to one MySensors node
In MYSController displaying the correct values.mvdbro wrote:So it seems that I'm not the only one facing this issue.Sevift wrote:same problem. MySensors library 1.5.1 NRF24L01
incorrect values humidity sensors DHT22, when several devices
So either:
1) We both don't know how to build this properly![]()
2) The MySensors gateway support in Domoticz does not support what we're trying to accomplish![]()
Would be nice to learn which of them is true. I've launched a new ESP project that would be rather useless if this is not supported. So development is on hold as long as this remains unclear.
-
- Posts: 46
- Joined: Tuesday 10 December 2013 22:27
- Target OS: Linux
- Domoticz version: beta
- Contact:
Re: Multiple similar sensors to one MySensors node
It's Domoticz that is mixing the values from different sensors on one node.
I was reporting this bug earlier.
I was reporting this bug earlier.
Orange Pi (@ Debian) / MySensors Serial / GPIO / Custom Serial 433 MHz Transmitter (for plug switches and livolo wall switches) / JSON&Bash API scripts
-
- Posts: 31
- Joined: Monday 21 September 2015 16:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Multiple similar sensors to one MySensors node
Maybe write it in the topic of bugs? This is a serious error. 3 sensors lie idle. They confuse the sensor reading in the bathroom.
-
- Posts: 31
- Joined: Monday 21 September 2015 16:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Multiple similar sensors to one MySensors node
In MySensorsBase.cpp
void MySensorsBase::SendSensor2Domoticz(_tMySensorNode *pNode, _tMySensorChild *pChild, const _eSetType vType)
Errors in the code for multi devices.
If you make a single device (Replace on this code)
then working
in DomoticzHardware.cpp
replaced by
in the same function
replaced by
in DomoticzHardware.h
replaced by
in RFLinkBase.cpp
replaced by
void MySensorsBase::SendSensor2Domoticz(_tMySensorNode *pNode, _tMySensorChild *pChild, const _eSetType vType)
Errors in the code for multi devices.
If you make a single device (Replace on this code)
Code: Select all
case V_TEMP:
{
float Temp = 0;
_tMySensorChild *pChildTemp = FindChildWithValueType(pChild->nodeID, V_TEMP);
if (pChildTemp) {
bool bHaveTemp = pChild->GetValue(V_TEMP, Temp);
if (bHaveTemp) {
SendTempSensor(cNode, pChild->batValue, Temp, (!pChild->childName.empty()) ? pChild->childName : "Temp");
}
}
}
break;
case V_HUM:
{
int Humidity = 0;
_tMySensorChild *pChildHum = FindChildWithValueType(pChild->nodeID, V_HUM);
if (pChildHum) {
bool bHaveHum = pChild->GetValue(V_HUM, Humidity);
if (bHaveHum){
SendHumiditySensor(cNode, pChild->batValue, Humidity, (!pChild->childName.empty()) ? pChild->childName : "Hum");
}
}
}
break;
in DomoticzHardware.cpp
Code: Select all
void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity)
Code: Select all
void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity, const std::string &defaultname)
Code: Select all
sDecodeRXMessage(this, (const unsigned char *)&tsen.HUM, NULL, BatteryLevel);
Code: Select all
sDecodeRXMessage(this, (const unsigned char *)&tsen.HUM, defaultname.c_str(), BatteryLevel);
Code: Select all
void SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity);
Code: Select all
void SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity, const std::string &defaultname);
Code: Select all
SendHumiditySensor(ID, BatteryLevel, humidity);
Code: Select all
std::string tmp_Name = results[2];
SendHumiditySensor(ID, BatteryLevel, humidity, tmp_Name);
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Multiple similar sensors to one MySensors node
@Sevift,
you want a default name for the humidity sensor ?
I will add support for this in the next commit, done, and also for all other sensors
It is better to create a git pull request next time, because we can not read all forum posts
you want a default name for the humidity sensor ?
I will add support for this in the next commit, done, and also for all other sensors
It is better to create a git pull request next time, because we can not read all forum posts
Quality outlives Quantity!
-
- Posts: 31
- Joined: Monday 21 September 2015 16:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Multiple similar sensors to one MySensors node
This is secondary.gizmocuz wrote:@Sevift,
you want a default name for the humidity sensor ?
I will add support for this in the next commit, done, and also for all other sensors
It is better to create a git pull request next time, because we can not read all forum posts
It is important that humidity sensors begin to transmit the correct values. You have the code, written for multisensor - wrong. Confused values of humidity sensors, if there are several
I did that several sensors are not joined together into one.
p.s.
TempHumSensor - > TempSensor and HumSensor
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Multiple similar sensors to one MySensors node
Thats not how domoticz work, we want to combine all when possible
there is a github issue already, and we working on this (will take some time)
there is a github issue already, and we working on this (will take some time)
Quality outlives Quantity!
-
- Posts: 31
- Joined: Monday 21 September 2015 16:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Multiple similar sensors to one MySensors node
Thank you for your work.
Will wait. But now DHT22 sensors are useless if they are more than one. And with my patch work correctly, and as a temporary solution is suitable for those who are important.
Will wait. But now DHT22 sensors are useless if they are more than one. And with my patch work correctly, and as a temporary solution is suitable for those who are important.
- Spoiler: show
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Multiple similar sensors to one MySensors node
this is no patch !? (no offence taken!)
It is just sending individually the sensor data
if possible have a look at the github issue page, and make a correct patch
It is just sending individually the sensor data
if possible have a look at the github issue page, and make a correct patch
Quality outlives Quantity!
-
- Posts: 62
- Joined: Thursday 03 December 2015 21:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v3.8742
- Contact:
Re: Multiple similar sensors to one MySensors node
@Sevift: When looking in MySensorsBase.cpp there is more code than you listed in your code (forecasting etc)Sevift wrote:In MySensorsBase.cpp
void MySensorsBase::SendSensor2Domoticz(_tMySensorNode *pNode, _tMySensorChild *pChild, const _eSetType vType)
Errors in the code for multi devices.
If you make a single device (Replace on this code)then workingCode: Select all
case V_TEMP: { float Temp = 0; _tMySensorChild *pChildTemp = FindChildWithValueType(pChild->nodeID, V_TEMP); if (pChildTemp) { bool bHaveTemp = pChild->GetValue(V_TEMP, Temp); if (bHaveTemp) { SendTempSensor(cNode, pChild->batValue, Temp, (!pChild->childName.empty()) ? pChild->childName : "Temp"); } } } break; case V_HUM: { int Humidity = 0; _tMySensorChild *pChildHum = FindChildWithValueType(pChild->nodeID, V_HUM); if (pChildHum) { bool bHaveHum = pChild->GetValue(V_HUM, Humidity); if (bHaveHum){ SendHumiditySensor(cNode, pChild->batValue, Humidity, (!pChild->childName.empty()) ? pChild->childName : "Hum"); } } } break;
in DomoticzHardware.cppreplaced byCode: Select all
void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity)
in the same functionCode: Select all
void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity, const std::string &defaultname)
replaced byCode: Select all
sDecodeRXMessage(this, (const unsigned char *)&tsen.HUM, NULL, BatteryLevel);
in DomoticzHardware.hCode: Select all
sDecodeRXMessage(this, (const unsigned char *)&tsen.HUM, defaultname.c_str(), BatteryLevel);
replaced byCode: Select all
void SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity);
in RFLinkBase.cppCode: Select all
void SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity, const std::string &defaultname);
replaced byCode: Select all
SendHumiditySensor(ID, BatteryLevel, humidity);
Code: Select all
std::string tmp_Name = results[2]; SendHumiditySensor(ID, BatteryLevel, humidity, tmp_Name);
Have you deleted these lines or just left them out?
See actual code in MysensorsBase.cpp below
Code: Select all
case V_TEMP:
{
float Temp = 0;
pChild->GetValue(V_TEMP, Temp);
_tMySensorChild *pChildHum = FindChildWithValueType(pChild->nodeID, V_HUM);
_tMySensorChild *pChildBaro = FindChildWithValueType(pChild->nodeID, V_PRESSURE);
if (pChildHum && pChildBaro)
{
int Humidity;
float Baro;
bool bHaveHumidity = pChildHum->GetValue(V_HUM, Humidity);
bool bHaveBaro = pChildBaro->GetValue(V_PRESSURE, Baro);
if (bHaveHumidity && bHaveBaro)
{
int forecast = bmpbaroforecast_unknown;
_tMySensorChild *pSensorForecast = FindChildWithValueType(pChild->nodeID, V_FORECAST);
if (pSensorForecast)
{
pSensorForecast->GetValue(V_FORECAST, forecast);
}
if (forecast == bmpbaroforecast_cloudy)
{
if (Baro < 1010)
forecast = bmpbaroforecast_rain;
}
//We are using the TempHumBaro Float type now, convert the forecast
int nforecast = wsbaroforcast_some_clouds;
if (Baro <= 980)
nforecast = wsbaroforcast_heavy_rain;
else if (Baro <= 995)
{
if (Temp > 1)
nforecast = wsbaroforcast_rain;
else
nforecast = wsbaroforcast_snow;
}
else if (Baro >= 1029)
nforecast = wsbaroforcast_sunny;
switch (forecast)
{
case bmpbaroforecast_sunny:
nforecast = wsbaroforcast_sunny;
break;
case bmpbaroforecast_cloudy:
nforecast = wsbaroforcast_cloudy;
break;
case bmpbaroforecast_thunderstorm:
nforecast = wsbaroforcast_heavy_rain;
break;
case bmpbaroforecast_rain:
if (Temp>1)
nforecast = wsbaroforcast_rain;
else
nforecast = wsbaroforcast_snow;
break;
}
SendTempHumBaroSensorFloat(cNode, pChild->batValue, Temp, Humidity, Baro, nforecast, (!pChild->childName.empty()) ? pChild->childName : "TempHumBaro");
}
}
else if (pChildHum) {
int Humidity;
bool bHaveHumidity = pChildHum->GetValue(V_HUM, Humidity);
if (bHaveHumidity)
{
SendTempHumSensor(cNode, pChild->batValue, Temp, Humidity, (!pChild->childName.empty()) ? pChild->childName : "TempHum");
}
}
else
{
SendTempSensor(cNode, pChild->batValue, Temp, (!pChild->childName.empty()) ? pChild->childName : "Temp");
}
}
break;
case V_HUM:
{
_tMySensorChild *pChildTemp = FindChildWithValueType(pChild->nodeID, V_TEMP);
_tMySensorChild *pChildBaro = FindChildWithValueType(pChild->nodeID, V_PRESSURE);
int forecast = bmpbaroforecast_unknown;
_tMySensorChild *pSensorForecast = FindChildWithValueType(pChild->nodeID, V_FORECAST);
if (pSensorForecast)
{
pSensorForecast->GetValue(V_FORECAST, forecast);
}
if (forecast == bmpbaroforecast_cloudy)
{
if (pChildBaro)
{
float Baro;
if (pChildBaro->GetValue(V_PRESSURE, Baro))
{
if (Baro < 1010)
forecast = bmpbaroforecast_rain;
}
}
}
float Temp;
int Humidity;
pChild->GetValue(V_HUM, Humidity);
if (pChildTemp && pChildBaro)
{
float Baro;
bool bHaveTemp = pChildTemp->GetValue(V_TEMP, Temp);
bool bHaveBaro = pChildBaro->GetValue(V_PRESSURE, Baro);
if (bHaveTemp && bHaveBaro)
{
cNode = (pChildTemp->nodeID << 8) | pChildTemp->childID;
//We are using the TempHumBaro Float type now, convert the forecast
int nforecast = wsbaroforcast_some_clouds;
if (Baro <= 980)
nforecast = wsbaroforcast_heavy_rain;
else if (Baro <= 995)
{
if (Temp > 1)
nforecast = wsbaroforcast_rain;
else
nforecast = wsbaroforcast_snow;
}
else if (Baro >= 1029)
nforecast = wsbaroforcast_sunny;
switch (forecast)
{
case bmpbaroforecast_sunny:
nforecast = wsbaroforcast_sunny;
break;
case bmpbaroforecast_cloudy:
nforecast = wsbaroforcast_cloudy;
break;
case bmpbaroforecast_thunderstorm:
nforecast = wsbaroforcast_heavy_rain;
break;
case bmpbaroforecast_rain:
if (Temp > 1)
nforecast = wsbaroforcast_rain;
else
nforecast = wsbaroforcast_snow;
break;
}
SendTempHumBaroSensorFloat(cNode, pChildTemp->batValue, Temp, Humidity, Baro, nforecast, (!pChild->childName.empty()) ? pChild->childName : "TempHumBaro");
}
}
else if (pChildTemp) {
bool bHaveTemp = pChildTemp->GetValue(V_TEMP, Temp);
if (bHaveTemp)
{
cNode = (pChildTemp->nodeID << 8) | pChildTemp->childID;
SendTempHumSensor(cNode, pChildTemp->batValue, Temp, Humidity, (!pChild->childName.empty()) ? pChild->childName : "TempHum");
}
}
else
{
SendHumiditySensor(cNode, pChild->batValue, Humidity, (!pChild->childName.empty()) ? pChild->childName : "Hum");
}
}
break;
Who is online
Users browsing this forum: No registered users and 0 guests