I expect the change I’d do to the sketch would work, it’s just that I can prove it on the V1 hardware but not the V2, which doesn’t actually prove very much.
I can write out the changes - it’s not at all complicated:
In https://github.com/openenergymonitor/emonth2/blob/master/firmware/src/src.ino
Change line 125:
int temp_external;
to read
int temp_external1; int temp_external2;
(or more if you wish - two statements on one line so as not to move the line numbers around - that’s all!)
similarly change line 379:
float temp=(sensors.getTempC(allAddress[0]));
to read
float temp1=(sensors.getTempC(allAddress[0])); float temp2=(sensors.getTempC(allAddress[1]));
and line 438:
Serial.print("tempex:");Serial.print(emonth.temp_external); Serial.print(",");
to read
Serial.print("tempex:");Serial.print(emonth.temp_external1); Serial.print(",");Serial.print(emonth.temp_external2); Serial.print(",");
then the last substantial change that will shift the line numbers:
change lines 381 - 384
if ((temp<125.0) && (temp>-40.0))
{
emonth.temp_external=(temp*10);
}
to read
if ((temp1<125.0) && (temp1>-40.0))
{
emonth.temp_external1=(temp1*10);
}
and replicate for temp2 as new lines immediately below:
if ((temp2<125.0) && (temp2>-40.0))
{
emonth.temp_external2=(temp2*10);
}
Then the change to emonhub.conf. The lines to change are the ones reproduced in the comment at the top of the sketch (you can replace that comment if you wish):
[[23]]
nodename = emonTH_5
firmware = V2.x_emonTH_DHT22_DS18B20_RFM69CW_Pulse
hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:OFF)
[[[rx]]]
names = temperature, external temperature1, external temperature2, humidity, battery, pulseCount
datacodes = h,h,h,h,h,L
scales = 0.1,0.1,0.1,0.1,0.1,1
units = C,C,C,%,V,p
I’ll repeat myself - I haven’t proved this, but I don’t see a reason for it not to work (unless I’ve missed something silly).
Tough. I just have. You get this as part of the service.
[Edit - 5 hours later…]
I’ve done the equivalent (almost but not quite the same) changes to the software for the emonTH V1.4, which is the one I have, and it’s giving me two external temperature readings to my emonPi, so I think it should be OK.