 #endif
 
 	last = tmp;
-	gw.send( msg.set( last ) );
+	gw.send( msg.setSensor( SENSOR_ID ).set( last ) );
 
 	return true;
 }
-bool atoiTI( char *label, char *searchLabel, char *value, uint8_t &last, MyMessage &msg ) {
+bool compareTI( char *label, char *searchLabel, char *value, uint8_t &last, MyMessage &msg, int SENSOR_ID ) {
 	uint8_t tmp;
 
 	if ( strcmp( label, searchLabel ) != 0 )

	return tiSerial.read() & 0x7F;
}

bool atolTI( char *label, char *searchLabel, char *value, uint32_t &last, MyMessage &msg ) {
	uint32_t tmp;

	if ( strcmp( label, searchLabel ) != 0 )

// infos générales
///////////////////////////////////
#define CHILD_ID_ADCO 0
MyMessage msgVAR1( 0, V_VAR1 );

#define CHILD_ID_OPTARIF 1
MyMessage msgVAR2( 0, V_VAR2 );

#define CHILD_ID_ISOUSC 2
MyMessage msgCURRENT( 0, V_CURRENT );

#define CHILD_ID_PTEC 3
MyMessage msgVAR3( 0, V_VAR3 );

#define CHILD_ID_IINST 4
#define CHILD_ID_ADPS 5
#define CHILD_ID_IMAX 6
#define CHILD_ID_PAPP 7

MyMessage msgWATT( 0, V_WATT ); // pas vrai c'est des VA!

// infos tarif BASE
///////////////////////////////////
#define CHILD_ID_BASE 10
MyMessage msgKWH( 0, V_KWH ); // en fait c'est des WH

// infos tarif HC/HP
///////////////////////////////////
#define CHILD_ID_HC_HC 20
#define CHILD_ID_HC_HP 21

// infos EJP
#define CHILD_ID_EJP_HN 30
#define CHILD_ID_EJP_HPM 31
#define CHILD_ID_PEJP 32

// infos tarif BBR (tempo)
///////////////////////////////////
#define CHILD_ID_BBR_HC_JB 40
#define CHILD_ID_BBR_HP_JB 41
#define CHILD_ID_BBR_HC_JW 42
#define CHILD_ID_BBR_HP_JW 43
#define CHILD_ID_BBR_HC_JR 44
#define CHILD_ID_BBR_HP_JR 45
#define CHILD_ID_DEMAIN 46

MyMessage msgVAR5( 0, V_VAR5 );

// sert à EJP/BBR
///////////////////////////////////
#define CHILD_ID_HHPHC 50
MyMessage msgVAR4( 0, V_VAR4 );

// connexion série avec le compteur EDF
SoftwareSerial tiSerial( TI_RX, TI_RX ); // dans les faits, le TX ne sert pas

void setup() {
#ifdef DEBUG_ENABLED
