export interface LogArray extends Array { } export interface LiveLogEntry { seq: number, text: string, } export interface LiveLogResponse { entries: LiveLogEntry[], dropped: boolean, next_seq: number, } export interface LogEntry { timestamp: string, message_id: number, a: number, b: number, txt_short: string, txt_long: string } export interface LogLocalisation extends Array { } export interface LogLocalisationEntry { msg_type: string, message: string } export interface BackupHeader { timestamp: string, size: number } export interface NetworkConfig { ap_ssid: string, ssid: string, password: string, mqtt_url: string, base_topic: string, mqtt_user: string | null, mqtt_password: string | null, max_wait: number } export interface SaveInfo { idx: number, len: number, created_at: string | null, } export interface FileList { total: number, used: number, files: FileInfo[], file_system_corrupt: string, iter_error: string, } export interface SolarState { mppt_voltage: number, mppt_current: number, is_day: boolean } export interface FileInfo { filename: string, size: number, } export interface NightLampConfig { enabled: boolean, night_lamp_hour_start: number, night_lamp_hour_end: number, night_lamp_only_when_dark: boolean, low_soc_cutoff: number, low_soc_restore: number } export interface NightLampCommand { active: boolean } export interface TankConfig { tank_sensor_enabled: boolean, tank_allow_pumping_if_sensor_error: boolean, tank_useable_ml: number, tank_warn_percent: number, tank_empty_percent: number, tank_full_percent: number, ml_per_pulse: number } export enum BatteryBoardVersion { Disabled = "Disabled", BQ34Z100G1 = "BQ34Z100G1", WchI2cSlave = "WchI2cSlave" } export enum BoardVersion { Initial = "Initial", V3 = "V3", V4 = "V4" } export interface BoardHardware { board: BoardVersion, battery: BatteryBoardVersion, pump_corrosion_protection: boolean, } export interface PlantControllerConfig { hardware: BoardHardware, network: NetworkConfig, tank: TankConfig, night_lamp: NightLampConfig, plants: PlantConfig[] timezone?: string, } export interface PlantConfig { mode: string, target_moisture: number, min_moisture: number, pump_time_s: number, pump_cooldown_min: number, pump_hour_start: number, pump_hour_end: number, pump_limit_ml: number, sensor_a: boolean, sensor_b: boolean, max_consecutive_pump_count: number, moisture_sensor_min_frequency: number | null; moisture_sensor_max_frequency: number | null; min_pump_current_ma: number, max_pump_current_ma: number, ignore_current_error: boolean, } export interface PumpTestResult { median_current_ma: number, max_current_ma: number, min_current_ma: number, flow_value_ml: number, flow_value_count: number, pump_time_s: number, error: boolean, } export interface SSIDList { ssids: [string] } export interface TestPump { pump: number } export interface CanPower { state: boolean } export interface SetTime { time: string } export interface GetTime { rtc: string, native: string } export interface Moistures { moisture_a: [string], moisture_b: [string], } export interface VersionInfo { git_hash: string, build_time: string, current: string, slot0_state: string, slot1_state: string, heap_total: number, heap_used: number, heap_free: number, heap_max_used: number, } export interface BatteryState { temperature: string voltage_milli_volt: string, current_milli_ampere: string, design_milli_ampere: string, remaining_milli_ampere: string, state_of_charge: string, state_of_health: string } /// Request: which sensors to send IDENTIFY_CMD to. export interface SensorRequest { sensor_a: boolean, sensor_b: boolean, } export interface DetectionRequest { plant: SensorRequest[] } /// Response: detection result per plant. /// sensor_a / sensor_b: firmware build timestamp in minutes since Unix epoch, /// or null if the sensor did not respond. export interface DetectionPlant { sensor_a: number | null, sensor_b: number | null, } export interface Detection { plant: DetectionPlant[] } export interface TankInfo { /// is there enough water in the tank enough_water: boolean, /// warning that water needs to be refilled soon warn_level: boolean, /// estimation how many ml are still in tank left_ml: number | null, /// if there is was an issue with the water level sensor sensor_error: string | null, /// raw water sensor value raw: number | null, /// percent value percent: number | null, /// water in tank might be frozen water_frozen: boolean, /// water temperature water_temp: number | null, temp_sensor_error: string | null }