Onewire Dallastemperature low and high alarm separate

johnwasser:
It looks like there is only one alarm flag per device. To determine if the alarm is a HIGH alarm or a LOW alarm you have to read the current temperature and compare it to the two alarm temperatures. Something like this:

if (sensors.hasAlarm(deviceAddress)) {

float tempC = sensors.getTempC(deviceAddress);
    if (tempC != DEVICE_DISCONNECTED) {
        if (tempC >= sensors.getHighAlarmTemp(deviceAddress)) {
           // HIGH alarm
      }  
        if (tempC <= sensors.getLowAlarmTemp(deviceAddress)) {
           // LOW alarm
       }
    }
}

Johnwasser
Yes i thought that it might be something like that - the one flag pr. device. So i guess i will have to work around that, with some help :slight_smile:
Thank you for the code. I will now go to bed, bringing with me "the book" and your code. I will not rest until my brain is wrapped around this, and I am so looking forward to all the eurekas coming up (hopefully).

I will try and formulate a question, might get the terminology a bit off. If i want each sensor to perform different tasks (one sensor controlling one set of cooling and heating devices, another sensor controlling a different set), will I have to "spell it out" using temp1, temp2 etc. instead of deviceAddress? If my question is totally nonsense - just ignore :smiley:

regards and goodnight