Multiple similar sensors to one MySensors node

Moderator: leecollings

miljume
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

Post by miljume »

This change worked like a charm, now the humidity and temp is split up into two sensors which was exactly what I wanted

One question though, If I use the update function and upgrade Domoticz to a newer version, will I need to do this change again or will the upgrade process not affect the edited source?
User avatar
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

Post by gizmocuz »

They will be overwritten
It is better to make an option in the mysensors hardware setup page to 'Combine Sensors (temp+hum)', default enabled.
So the user can choose what he/she wants, maybe on node instead of global?
Then submit a git pull request.... so changes are merged in the code
Quality outlives Quantity!
miljume
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

Post by miljume »

That sounds like a really good feature, unfortunately my coding skills are not good enough to create that so I will have to hope that someone else takes this as a development task

Setting on a node level is absolutely the best as you sometimes might like Temp & Hum to go together
Goulou
Posts: 2
Joined: Friday 27 February 2015 22:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by Goulou »

I once created a bug for this issue on the bug tracker, but cannot find it anymore : did I miss the deletion of the bug tracker??
The solution I provided at that time relied upon sensor ids : I only allowed combination of sensors on the same node when ID_Hum=ID_Temp+1, ID_Baro=IDHum+1, and so on.
This let the user combine or not combine any sensors in a node.
In my case, this is a really useful feature since I have a node in the basement, where the freezer resides : I use it to read the temperature + humidity of the area, the temperature inside the freezer, and even the temperature+humidity outside of the house, since there is a small basement window...
Unfortunately, my patch has aged and does not apply anymore, since I had not the time to update it I dropped it... (and I have bad readings for the humidity sensor now...)

Goulou
mvdbro
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

Post by mvdbro »

Is there any news on this topic?
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by franzelare »

having the same trouble, now runing mysensor 2.0 and i want to have multiple BMP180 and DHT22 to sense pressure, temperature and humidity in the in and outlet of my fanbox, mainly to see the pressure drop over the fan box and exhaust pipe and know when I have to clean it out...
miljume
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

Post by miljume »

Totally agree, this feature would be very useful!
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by franzelare »

worked my way around it by adding a virtual switch to the mysensor node indicating what temp/hum sensor is send
i first send the dummy switches, than wait 0.5 seconds before sending the sensor data
than i use a lua script to copy the send value into dummy sensors....
vicho
Posts: 6
Joined: Tuesday 09 August 2016 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by vicho »

Hi to all and first sorry for my bad English.
Maybe have the similar problem, but with two flow sensors.
I link a node with some ds18b20, some relays and two flow sensors (G3/4 ; 0-60l/m) to my Domoticz with ethernet gateway. All work well without one of two flow sensors. When I look at the node setup - I see both flow sensors , but the Domoticz add just one of it to the devices. My node send the flow for both (make a pulse generator and link both to the different flow and the node send all two flows with the right value to the GW.
In the pictures some of the DS18B20 are not connected to the node (node send only 2 for now, but all work with the temp sensors when they are connected to it). Try to change the child_id, node_id, new GW, new node, install domoticz on linux and windows 7 - the same problem, find two flow sensors in the node, but add just one.
Will be happy to get any ideas about the problem.
Image
Image
User avatar
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

Post by gizmocuz »

@vinco, dont think this is the same problem... i think i already found it.
The problem was that the flow sensor was only using the NodeID and not the ChildID
I changed this in the new beta version (#5481), you should now have 2 sensors after this update (actualy 3, the old one)
If you press edit on the flow sensor, you can press the 'replace' button to transfer the data to the correct one
Quality outlives Quantity!
vicho
Posts: 6
Joined: Tuesday 09 August 2016 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by vicho »

gizmocuz wrote:@vinco, dont think this is the same problem... i think i already found it.
The problem was that the flow sensor was only using the NodeID and not the ChildID
I changed this in the new beta version (#5481), you should now have 2 sensors after this update (actualy 3, the old one)
If you press edit on the flow sensor, you can press the 'replace' button to transfer the data to the correct one
Right, maybe this is the problem. Now I update with beta and all work!
Thank you very much! This sensors are importent for me , I need to know how my Heat Pump work :)

half a day no problems with the node respond to domoticz, all is OK.
Something else, can I change l/min to the l/h or no way?
vaibhav
Posts: 16
Joined: Tuesday 27 September 2016 0:45
Target OS: Windows
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by vaibhav »

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)

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;
then working

in DomoticzHardware.cpp

Code: Select all

void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity)
replaced by

Code: Select all

void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity, const std::string &defaultname)
in the same function

Code: Select all

sDecodeRXMessage(this, (const unsigned char *)&tsen.HUM, NULL, BatteryLevel);
replaced by

Code: Select all

sDecodeRXMessage(this, (const unsigned char *)&tsen.HUM, defaultname.c_str(), BatteryLevel);
in DomoticzHardware.h

Code: Select all

void SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity);
replaced by

Code: Select all

void SendHumiditySensor(const int NodeID, const int BatteryLevel, const int humidity, const std::string &defaultname);
in RFLinkBase.cpp

Code: Select all

SendHumiditySensor(ID, BatteryLevel, humidity);
replaced by

Code: Select all

std::string tmp_Name = results[2]; 
SendHumiditySensor(ID, BatteryLevel, humidity, tmp_Name);
Снимок экрана 2016-01-17 в 13.42.16.png
Снимок экрана 2016-01-17 в 13.41.39.png
Where can I find the MySensorsBase.cpp? I am running domoticz on windows and in the installation folder I can't find the file. I can see the file on GitHub but how do I install domoticz from GitHub?
gohan
Posts: 36
Joined: Monday 13 February 2017 23:42
Target OS: Windows
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by gohan »

Is there a new way to split sensors or prevent them from combining? I played around with some nodes and most of the time they are grouped and once they were split in single sensors without my intervention.
gohan
Posts: 36
Joined: Monday 13 February 2017 23:42
Target OS: Windows
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by gohan »

yesterday I noticed that my sensors where not updating anymore, I reboot the sensor and nothing happened, then I checked the devices and noticed that Domoticz on it own rearranged the sensors and created new devices from the same HW and now only temp and humidity are combined while earlier it was combining also pressure into a weather device. How is that possible?
mhko
Posts: 13
Joined: Wednesday 13 January 2016 20:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by mhko »

is this the feature we have been asking for?

https://forum.mysensors.org/topic/6965/ ... f-child-id
denis
Posts: 1
Joined: Wednesday 21 February 2018 20:32
Target OS: Linux
Domoticz version:
Contact:

Re: Multiple similar sensors to one MySensors node

Post by denis »

Dear all,

is there any news on this topic?

I'm trying to make my MySensors Node (consisting on an Arduino Uni with Ethernet Shield and MySensors Ethernet GW) work, on which I have connected two DHT22 (to measure inside and outside temperature. The Node is sending correct values, the hardware page indicate the four children (with separeate ChildID), but I do not manage to control the link between those correct data and the automatically created Devices, which mix up temperature and humidity values. It's mixed up in "real time", so new value update sometimes one or the other device.

I tried the trick of having child ID either being ChildID(Hum) = childID(temp)+1 or not, but nothing is working.

I even found finally the way to send a sensor name when the child is presented, such names are shown on the hardware page, but does not have an influence on the device, created by Domoticz.

I would like to avoid to change the source files and compile it on my Raspberry. not only for the work but also to avoid problems when Domoticz is updated in the future.

As I did not find any new message on this forum since 6 months (or I have tomatoes on my eyes), I was expecting that the topic is solved, but I can't find the solution.

I thank you in advance !

Denis
pj-r
Posts: 140
Joined: Wednesday 17 December 2014 17:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: Multiple similar sensors to one MySensors node

Post by pj-r »

Searching for this? https://github.com/domoticz/domoticz/pull/847
Perhaps the childID and presentation order could help?
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests