{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://prestomation.github.io/ha-home-keeper/schema/home-keeper-1.schema.json",
  "title": "Home Keeper portable document",
  "$comment": "Generated from custom_components/home_keeper by ci/generate_schema.py — do not edit, and do not commit. Unknown fields and unknown sections are allowed on purpose: an import reports one as a named warning and carries on, so a schema that refused them would send people to fix files that import cleanly.",
  "type": "object",
  "properties": {
    "home_keeper": {
      "type": "object",
      "properties": {
        "format": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1
        },
        "version": {
          "type": "string"
        },
        "exported_at": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "appliances": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "device_id": {
            "type": "string"
          },
          "area_id": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "serial_number": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "cost": {
            "type": "number"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "filename": {
                  "type": "string"
                },
                "content_type": {
                  "type": "string"
                },
                "size": {
                  "type": "integer"
                },
                "created": {
                  "type": "string"
                }
              }
            }
          },
          "metadata": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "track": {
                  "type": "boolean"
                }
              },
              "required": [
                "label"
              ]
            }
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "part_number": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "vendor": {
                  "type": "string"
                },
                "cost": {
                  "type": "number"
                },
                "url": {
                  "type": "string"
                },
                "notes": {
                  "type": "string"
                },
                "replace_interval": {
                  "type": "integer"
                },
                "replace_unit": {
                  "type": "string"
                },
                "last_replaced": {
                  "type": "string"
                },
                "stock": {
                  "type": "number"
                },
                "reorder_at": {
                  "type": "number"
                },
                "stock_unit": {
                  "type": "string"
                },
                "consume_quantity": {
                  "type": "number"
                },
                "create_buy_task": {
                  "type": "boolean"
                },
                "restock_quantity": {
                  "type": "number"
                },
                "action": {
                  "type": "string"
                },
                "use_noun": {
                  "type": "string"
                },
                "use_task_name": {
                  "type": "string"
                },
                "replace_also_every": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "interval": {
                          "type": "integer"
                        },
                        "unit": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "carried_uses": {
                  "type": "integer"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "parent_asset_id": {
            "type": "string"
          },
          "related_device_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "area": {
            "type": "string"
          },
          "archived": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      }
    },
    "tasks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "recurrence_type": {
            "type": "string"
          },
          "interval": {
            "type": "integer",
            "minimum": 1
          },
          "unit": {
            "type": "string"
          },
          "freq": {
            "type": "string"
          },
          "anchor": {
            "type": "string"
          },
          "due": {
            "type": "string"
          },
          "sensor": {
            "type": "object",
            "additionalProperties": true
          },
          "last_completed": {
            "type": "string"
          },
          "device_id": {
            "type": "string"
          },
          "area_id": {
            "type": "string"
          },
          "labels": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "card_links": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "asset_id": {
                    "type": "string"
                  },
                  "entry_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "asset_id",
                  "entry_id"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "asset_id": {
                      "type": "string"
                    },
                    "entry_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "asset_id",
                    "entry_id"
                  ]
                }
              }
            ]
          },
          "completion_detail": {
            "type": "string"
          },
          "completion_required_fields": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "tag_id": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ]
          },
          "require_tag_scan": {
            "type": "boolean"
          },
          "active_season": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "start": {
                    "pattern": "^\\d{2}-\\d{2}$",
                    "type": "string"
                  },
                  "end": {
                    "pattern": "^\\d{2}-\\d{2}$",
                    "type": "string"
                  }
                },
                "required": [
                  "start",
                  "end"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "pattern": "^\\d{2}-\\d{2}$",
                      "type": "string"
                    },
                    "end": {
                      "pattern": "^\\d{2}-\\d{2}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                }
              }
            ]
          },
          "task_chips": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "icon": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "label"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "icon": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "label"
                  ]
                }
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "area": {
            "type": "string"
          },
          "appliance": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "completed_at": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "cost": {
                  "type": "number"
                },
                "photo": {
                  "type": "string"
                },
                "who": {
                  "type": "string"
                },
                "reading": {
                  "type": "number"
                }
              },
              "required": [
                "completed_at"
              ]
            }
          },
          "skips": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "skipped_at": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "who": {
                  "type": "string"
                },
                "reading": {
                  "type": "number"
                }
              },
              "required": [
                "skipped_at"
              ]
            }
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": true
      }
    }
  },
  "required": [
    "home_keeper"
  ],
  "additionalProperties": true
}
