 
   StaticJsonDocument<192> doc;
 
-  doc["ac_ok"] = digitalRead(AC_OK);
-  doc["battery_low"] = digitalRead(BAT_LOW);
+  // Because the pinup is set to pullup we read high for off.
+  doc["ac_ok"] = !digitalRead(AC_OK);
 
   JsonArray relays = doc.createNestedArray("relays");
   relays.add(is_relay_on(RELAY_0));

}


/************************************
  Utility Methods
*************************************/

bool is_relay_on(int pin_num) {
  return digitalRead(pin_num) != LOW;

  pinMode(IS_2, INPUT);

  // Setup AC and Battery pins
  pinMode(AC_OK, INPUT_PULLUP);
  pinMode(BAT_LOW, INPUT_PULLUP);

  // Setup diagnosis enable pins
  pinMode(DEN_0, OUTPUT);
