diff -r 0569f28b0806 -r a70527a4e56a thermferm/thermferm.c --- a/thermferm/thermferm.c Sun Nov 02 19:47:50 2014 +0100 +++ b/thermferm/thermferm.c Tue Nov 11 16:10:48 2014 +0100 @@ -829,6 +829,7 @@ int server(void) { char buf[1024], *filename, target[40], heater[40], cooler[40], fan[40], door[40]; + char use_heater[40], use_cooler[40], use_fan[40]; time_t now, last = (time_t)0; units_list *unit; profiles_list *profile; @@ -1447,6 +1448,10 @@ snprintf(cooler, 39, "NA"); snprintf(fan, 39, "NA"); snprintf(door, 39, "NA"); + snprintf(use_heater, 39, "NA"); + snprintf(use_cooler, 39, "NA"); + snprintf(use_fan, 39, "NA"); + if (unit->mode == UNITMODE_BEER) snprintf(target, 39, "%.1f", unit->beer_set); @@ -1457,20 +1462,23 @@ if (unit->heater_address) { snprintf(heater, 39, "%d", unit->heater_state); + snprintf(use_heater, 39, "%d", unit->heater_usage); } if (unit->cooler_address) { snprintf(cooler, 39, "%d", unit->cooler_state); + snprintf(use_cooler, 39, "%d", unit->cooler_usage); } if (unit->fan_address) { snprintf(fan, 39, "%d", unit->fan_state); + snprintf(use_fan, 39, "%d", unit->fan_usage); } if (unit->door_address) { snprintf(door, 39, "%d", unit->door_state); } - snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s", + snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s,%s,%s,%s", UNITMODE[unit->mode], unit->air_temperature / 1000.0, - unit->beer_temperature / 1000.0, target, heater, cooler, fan, door); + unit->beer_temperature / 1000.0, target, heater, cooler, fan, door, use_heater, use_cooler, use_fan); filename = xstrcpy(unit->name); filename = xstrcat(filename, (char *)".log"); logger(filename, buf);