Now I've tried all day...I can't get it to work.
Trying to follow your advice @mfalkvidd but only made small steps with "presentation". Very thankful for your help but unfortunately I don't get it right.
I've specified 5 sensors to the node but Domoticz sees 6 . The only working child is child 255. There I see the temperature.
The code looks like this now:
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
#include <SPI.h>
#include <MySensors.h>
#include "max6675.h"
#define MY_NODE_ID AUTO
#define CHILD_ID_TEMP AUTO
#define TEMP_SENSOR_DIGITAL_PIN 4
#define MAX_ATTACHED_SENSORS 5
#define NUMBER_OF_SENSORS 5 // Change this depending on how many sensors you connect.
MyMessage msg(CHILD_ID_TEMP, V_TEMP);
int gndPin = 2;
int vccPin = 3;
int thermoDO = 4;
int thermoCLK = 6;
int thermoCS1 = 5;
int thermoCS2 = 7;
int thermoCS3 = 8;
int thermoCS4 = 8;
int thermoCS5 = 8;
MAX6675 thermocouple1(thermoCLK, thermoCS1, thermoDO);
MAX6675 thermocouple2(thermoCLK, thermoCS2, thermoDO);
MAX6675 thermocouple3(thermoCLK, thermoCS3, thermoDO);
MAX6675 thermocouple4(thermoCLK, thermoCS4, thermoDO);
MAX6675 thermocouple5(thermoCLK, thermoCS5, thermoDO);
void presentation() {
// Send the sketch version information to the gateway and Controller
sendSketchInfo("Temp Sensor", "0.1");
// Present all sensors to controller
for (int i=0; i<NUMBER_OF_SENSORS && i<MAX_ATTACHED_SENSORS; i++) {
present(i, S_TEMP);
// Register all sensors to gateway (they will be created as child devices)
present(CHILD_ID_TEMP, S_TEMP);
}
}
void setup() {
Serial.begin(115200);
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
//basic readout test, just print the current temp
int tempCelsius1 = thermocouple1.readCelsius();
int tempCelsius2 = thermocouple2.readCelsius();
int tempCelsius3 = thermocouple3.readCelsius();
int tempCelsius4 = thermocouple4.readCelsius();
int tempCelsius5 = thermocouple5.readCelsius();
Serial.print("prob1---C = ");
Serial.println(thermocouple1.readCelsius());
Serial.print("prob2---C = ");
Serial.println(thermocouple2.readCelsius());
Serial.print("prob3---C = ");
Serial.println(thermocouple3.readCelsius());
send(msg.set(tempCelsius1));
send(msg.set(tempCelsius2));
send(msg.set(tempCelsius3));
send(msg.set(tempCelsius4));
send(msg.set(tempCelsius5));
//for (int i=0; i<NUMBER_OF_SENSORS && i<MAX_ATTACHED_SENSORS; i++) {
// Send in the new temperature
// send(msg.setreadCelsius(i));}
delay(5000);
}
And the serial log:
prob1---C = 0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.0
3 TSM:INIT
4 TSF:WUR:MS=0
11 TSM:INIT:TSP OK
13 TSF:SID:OK,ID=10
14 TSM:FPAR
51 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
2058 !TSM:FPAR:NO REPLY
2060 TSM:FPAR
2096 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
3083 TSF:MSG:READ,0-0-10,s=255,c=3,t=8,pt=1,l=1,sg=0:0
3087 TSF:MSG:FPAR OK,ID=0,D=1
3228 TSF:MSG:READ,5-5-10,s=255,c=3,t=8,pt=1,l=1,sg=0:1
3686 TSF:MSG:READ,8-8-10,s=255,c=3,t=8,pt=1,l=1,sg=0:1
3775 TSF:MSG:READ,1-1-10,s=255,c=3,t=8,pt=1,l=1,sg=0:1
4104 TSM:FPAR:OK
4105 TSM:ID
4106 TSM:ID:OK
4108 TSM:UPL
4145 !TSF:MSG:SEND,10-10-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
4152 TSF:MSG:READ,0-0-10,s=255,c=3,t=25,pt=1,l=1,sg=0:1
4157 TSF:MSG:PONG RECV,HP=1
4159 TSM:UPL:OK
4161 TSM:READY:ID=10,PAR=0,DIS=1
4165 TSF:MSG:SEND,10-10-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
4179 TSF:MSG:READ,0-0-10,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
4205 TSF:MSG:SEND,10-10-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
4213 TSF:MSG:SEND,10-10-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
4229 TSF:MSG:READ,0-0-10,s=255,c=3,t=6,pt=0,l=1,sg=0:M
4236 TSF:MSG:SEND,10-10-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:Temp Sensor
4245 TSF:MSG:SEND,10-10-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:0.1
4282 TSF:MSG:SEND,10-10-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
4325 !TSF:MSG:SEND,10-10-0-0,s=255,c=0,t=6,pt=0,l=5,sg=0,ft=0,st=NACK:2.1.0
4334 TSF:MSG:SEND,10-10-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=1,st=OK:
4354 TSF:MSG:SEND,10-10-0-0,s=255,c=0,t=6,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
4362 TSF:MSG:SEND,10-10-0-0,s=2,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
4370 TSF:MSG:SEND,10-10-0-0,s=255,c=0,t=6,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
4378 TSF:MSG:SEND,10-10-0-0,s=3,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
4386 TSF:MSG:SEND,10-10-0-0,s=255,c=0,t=6,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
4397 TSF:MSG:SEND,10-10-0-0,s=4,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
4425 TSF:MSG:SEND,10-10-0-0,s=255,c=0,t=6,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
4432 MCO:REG:REQ
4435 TSF:MSG:SEND,10-10-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
4445 TSF:MSG:READ,0-0-10,s=255,c=3,t=27,pt=1,l=1,sg=0:1
4450 MCO:PIM:NODE REG=1
4452 MCO:BGN:STP
MAX6675 test
4954 MCO:BGN:INIT OK,TSP=1
prob1---C = 2.00
prob2---C = nan
prob3---C = 21.50
5227 TSF:MSG:SEND,10-10-0-0,s=255,c=1,t=0,pt=2,l=2,sg=0,ft=0,st=OK:0
5235 TSF:MSG:SEND,10-10-0-0,s=255,c=1,t=0,pt=2,l=2,sg=0,ft=0,st=OK:56
5245 TSF:MSG:SEND,10-10-0-0,s=255,c=1,t=0,pt=2,l=2,sg=0,ft=0,st=OK:21
5254 TSF:MSG:SEND,10-10-0-0,s=255,c=1,t=0,pt=2,l=2,sg=0,ft=0,st=OK:21
5273 TSF:MSG:SEND,10-10-0-0,s=255,c=1,t=0,pt=2,l=2,sg=0,ft=0,st=OK:21