J'ai réalisé un capteur pour ma consommation d'eau.
J'ai un problème pendant l'inclusion dans jeedom, les types de valeurs ne correspondent pas à mon type de capteur S_WATER.
Voilà une copie d'écran sous Jeedom du problème et un extrait de mon arduino.
Avez-vous une idée ?
Code : Tout sélectionner
#define CHILD_ID_FLOW 0 // Id of the sensor child flow
#define CHILD_ID_PULSE 1 // Id of the sensor child pulse
#define CHILD_ID_VOLUME 2 // Id of the sensor child volume
#define CHILD_ID_PULSE_FACTOR 3 // Id of the sensor child pulse factor
#define CHILD_ID_LEAK_THRESHOLD 4 // Id of the sensor child leak threshold
#define CHILD_ID_LEAK 5 // Id of the sensor child leak
MyMessage flowMsg(CHILD_ID_FLOW, V_FLOW); // l/mn
MyMessage volumeMsg(CHILD_ID_VOLUME, V_VOLUME); // liter by day
MyMessage lastCounterMsg(CHILD_ID_PULSE, V_VAR1); // pulse
MyMessage pulseFactor(CHILD_ID_PULSE_FACTOR, V_VAR2); // pulse_factor
MyMessage leakThreshold(CHILD_ID_LEAK_THRESHOLD, V_VAR3); // leak_threshold
MyMessage leak(CHILD_ID_LEAK, V_VAR4); // leak
void presentation()
{
// Send the sketch version information to the gateway and Controller
sendSketchInfo("FB Water Meter", "1.2.1");
// Register this device as Water flow sensor
present(CHILD_ID_FLOW, S_WATER);
present(CHILD_ID_PULSE, S_WATER);
present(CHILD_ID_VOLUME, S_WATER);
present(CHILD_ID_PULSE_FACTOR, S_WATER);
present(CHILD_ID_LEAK_THRESHOLD, S_WATER);
present(CHILD_ID_LEAK, S_WATER);
}
void setup()
{
// initialize our digital pins internal pullup resistor so one pulse switches from high to low (less distortion)
pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP);
loadConfig();
Serial.print(F("Pulse factor: "));
Serial.println(storage_config.pulse_factor);
Serial.print(F("Leak threshold: "));
Serial.println(storage_config.leak_threshold);
pulseCount = oldPulseCount = 0;
// Fetch last known pulse count value from gw
request(CHILD_ID_PULSE, V_VAR1);
setSyncProvider(requestSync);
//setTime(1357041600); // Jan 1 2013);
lastSend = lastPulse = millis();
attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, FALLING);
}