Skip to content

Control via Homey Script #84

Description

@0ge

I was trying to make a load balancer and figured it would be easiest to do this via Homey Script.
I ran into some issues with controlling the Zaptec though: it seems you cannot set the current. (Either the installation or per phase)

Phase currents are not listed as a capability, and if I try to set the available_installation_current, it says it is not setable.

Is HomeyScript the wrong approach?
It felt a little cumbersome to do this with cards, especially if you want to add more complexity such as electricity prices or power tariff avoidance.

log(box.capabilitiesObj);
await box.setCapabilityValue("available_installation_current", i_limit)
  .then(() => log("OK!"))
  .catch(error => log(error));

Capabilities

{
  'meter_power.current_session': {
    value: null,
    lastUpdated: 2026-04-15T04:54:30.726Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Energy current session',
    desc: 'Energy usage in kilowatt-hour (kWh)',
    units: 'kWh',
    decimals: 2,
    chartType: 'spline',
    id: 'meter_power.current_session',
    options: { title: [Object] }
  },
  meter_power: {
    value: 0.08,
    lastUpdated: 2026-04-14T13:03:09.820Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Energy this year',
    desc: 'Energy usage in kilowatt-hour (kWh)',
    units: 'kWh',
    decimals: 2,
    chartType: 'spline',
    id: 'meter_power',
    options: { title: [Object] }
  },
  'meter_power.last_session': {
    value: 0.08,
    lastUpdated: 2026-04-14T13:03:10.791Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Energy previous session',
    desc: 'Energy usage in kilowatt-hour (kWh)',
    units: 'kWh',
    decimals: 2,
    chartType: 'spline',
    id: 'meter_power.last_session',
    options: { title: [Object] }
  },
  measure_power: {
    value: 0,
    lastUpdated: 2026-04-14T13:03:10.566Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Power',
    desc: 'Power in watt (W)',
    units: 'W',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_power',
    options: {}
  },
  charging_button: {
    value: false,
    lastUpdated: 2026-04-14T13:04:31.153Z,
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Charging',
    desc: null,
    units: null,
    id: 'charging_button',
    options: {}
  },
  cable_permanent_lock: {
    value: null,
    lastUpdated: null,
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Cable locked',
    desc: null,
    units: null,
    id: 'cable_permanent_lock',
    options: {}
  },
  charge_mode: {
    value: 'Disconnected',
    lastUpdated: 2026-04-14T13:03:10.739Z,
    type: 'enum',
    getable: true,
    setable: false,
    title: 'Charger operation mode',
    desc: null,
    units: null,
    values: [ [Object], [Object], [Object], [Object], [Object] ],
    id: 'charge_mode',
    options: {}
  },
  'alarm_generic.car_connected': {
    value: false,
    lastUpdated: 2026-04-14T13:03:10.751Z,
    type: 'boolean',
    getable: true,
    setable: false,
    title: 'Car connected',
    desc: 'Generic alarm',
    units: null,
    id: 'alarm_generic.car_connected',
    options: {
      title: [Object],
      insightsTitleTrue: [Object],
      insightsTitleFalse: [Object]
    }
  },
  available_installation_current: {
    value: 16,
    lastUpdated: 2026-04-14T20:28:30.547Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Current limit',
    desc: 'Set the amount of current available for an installation of chargers.',
    units: 'A',
    decimals: 0,
    min: 0,
    max: 40,
    step: 1,
    iconObj: {
      id: '90dc388b015d75b858870078c06f8936',
      url: '/icon/90dc388b015d75b858870078c06f8936/icon.svg'
    },
    chartType: 'stepLine',
    id: 'available_installation_current',
    options: { title: [Object] }
  },
  'measure_current.phase1': {
    value: 0.02,
    lastUpdated: 2026-04-14T13:03:10.427Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Current L1',
    desc: 'Electric current (A)',
    units: 'A',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_current.phase1',
    options: { title: [Object] }
  },
  'measure_current.phase2': {
    value: 0.02,
    lastUpdated: 2026-04-14T13:03:10.448Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Current L2',
    desc: 'Electric current (A)',
    units: 'A',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_current.phase2',
    options: { title: [Object] }
  },
  'measure_current.phase3': {
    value: 0.03,
    lastUpdated: 2026-04-14T13:03:10.550Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Current L3',
    desc: 'Electric current (A)',
    units: 'A',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_current.phase3',
    options: { title: [Object] }
  },
  'measure_voltage.phase1': {
    value: 2.76,
    lastUpdated: 2026-04-14T13:03:10.180Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Voltage L1',
    desc: 'Voltage (V)',
    units: 'V',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_voltage.phase1',
    options: { title: [Object] }
  },
  'measure_voltage.phase2': {
    value: 0.36,
    lastUpdated: 2026-04-14T13:03:10.192Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Voltage L2',
    desc: 'Voltage (V)',
    units: 'V',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_voltage.phase2',
    options: { title: [Object] }
  },
  'measure_voltage.phase3': {
    value: 0.61,
    lastUpdated: 2026-04-14T13:03:10.204Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Voltage L3',
    desc: 'Voltage (V)',
    units: 'V',
    decimals: 2,
    chartType: 'stepLine',
    id: 'measure_voltage.phase3',
    options: { title: [Object] }
  },
  measure_humidity: {
    value: 24.25,
    lastUpdated: 2026-04-15T04:15:00.742Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Humidity',
    desc: 'Humidity in percent (%)',
    units: '%',
    decimals: 2,
    chartType: 'spline',
    id: 'measure_humidity',
    options: {}
  },
  measure_temperature: {
    value: 23.2,
    lastUpdated: 2026-04-15T04:15:00.736Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Temperature',
    desc: 'Temperature in degrees Celsius (°C)',
    units: '°C',
    decimals: 1,
    chartType: 'spline',
    id: 'measure_temperature',
    options: {}
  },
  'meter_power.signed_meter_value': {
    value: 0.08,
    lastUpdated: 2026-04-14T13:03:10.725Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Signed meter value',
    desc: 'Energy usage in kilowatt-hour (kWh)',
    units: 'kWh',
    decimals: 2,
    chartType: 'spline',
    id: 'meter_power.signed_meter_value',
    options: { title: [Object], uiComponent: 'none' }
  },
  measure_signal_strength: {
    value: -72,
    lastUpdated: 2026-04-14T23:57:00.918Z,
    type: 'number',
    getable: true,
    setable: false,
    title: 'Signal strength',
    desc: 'The signal strength in decibels.',
    units: '%',
    decimals: 2,
    chartType: 'spline',
    id: 'measure_signal_strength',
    options: { title: [Object], units: '%' }
  },
  communication_method: {
    value: null,
    lastUpdated: null,
    type: 'string',
    getable: true,
    setable: false,
    title: 'Communication method',
    desc: 'Communication technology, LTE or Wifi',
    units: null,
    iconObj: {
      id: '90dc388b015d75b858870078c06f8936',
      url: '/icon/90dc388b015d75b858870078c06f8936/icon.svg'
    },
    id: 'communication_method',
    options: {}
  },
  charging_mode: {
    value: '0',
    lastUpdated: 2026-04-14T13:03:10.043Z,
    type: 'enum',
    getable: true,
    setable: true,
    title: 'Charging mode',
    desc: 'Set the charging mode of the charger. Available modes are: Default charging, Scheduled charging, and Automatic charging.',
    units: null,
    values: [ [Object], [Object], [Object] ],
    id: 'charging_mode',
    options: {}
  }
}

Set capability log

[HomeyAPIError: An unknown error has occurred [not_setable]] {
  statusCode: 500,
  description: 'An unknown error has occurred [not_setable]'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions