StarOS: power

Read only, and only your own. Figures are as the last turn left them. Power is in milliwatts, energy in milliwatt-hours. See the overview.

power.networks()

A list of dicts, one per network: id, field, members, solar_mw (usable solar), load_mw (asked), served_mw, battery_mwh, capacity_mwh.

power.meters()

New in the newest build; if your game does not offer it yet, it has not shipped there. It lists what the instruments of your switched-on stations read: station, slot, kind, plus mv (voltmeter), ma (shunt), charge_mwh, capacity_mwh, charge_permille (charge gauge) or light_permille (light sensor).

def tick():
    for net_ in power.networks():
        if net_["served_mw"] < net_["load_mw"]:
            robot.log("network " + str(net_["id"]) + " is short")

The name net_ has an underscore so that it does not hide the modem's net.