2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.solarwatt.internal.domain.model;
15 import static org.openhab.binding.solarwatt.internal.SolarwattBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.solarwatt.internal.domain.dto.DeviceDTO;
21 * The energy manager itself which aggregates all other devices.
23 * This fields have been identified to exist:
24 * com.kiwigrid.devices.em.EnergyManager=[
27 * IdBootLoaderVersion,
30 * FractionCPULoadAverageLastFifteenMinutes,
31 * FractionCPULoadAverageLastFiveMinutes,
32 * IdSystemImageVersion,
34 * IdNotInstalledDevicesMap,
35 * StatusMonitoringMap,
36 * FractionCPULoadUser,
37 * VersionExtensionsMap,
38 * InstallConfiguration,
48 * FractionTopFiveProcessesMap,
50 * FractionCPULoadAverageLastMinute,
52 * SettingsDatetimeMap,
53 * FractionCPULoadKernel,
54 * FractionCPULoadTotal,
57 * VersionLocalApplicationsMap,
61 * DateTagCollectorWatchdogEvents,
62 * LocationGeographical
65 * @author Sven Carstens - Initial contribution
68 public class EnergyManager extends Device {
69 public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.em.EnergyManager";
71 public EnergyManager(DeviceDTO deviceDTO) {
76 public void update(DeviceDTO deviceDTO) {
77 super.update(deviceDTO);
79 this.addSecondsQuantity(CHANNEL_TIMESTAMP.getChannelName(), "SettingsDatetimeMap", ".timestamp", deviceDTO);
80 this.addStringState(CHANNEL_IDTIMEZONE, deviceDTO);
81 this.addPercentQuantity(CHANNEL_FRACTION_CPU_LOAD_TOTAL, deviceDTO);
82 this.addPercentQuantity(CHANNEL_FRACTION_CPU_LOAD_USER, deviceDTO);
83 this.addPercentQuantity(CHANNEL_FRACTION_CPU_LOAD_KERNEL, deviceDTO);
84 this.addPercentQuantity(CHANNEL_FRACTION_CPU_LOAD_AVERAGE_LAST_MINUTE, deviceDTO);
85 this.addPercentQuantity(CHANNEL_FRACTION_CPU_LOAD_AVERAGE_LAST_FIVE_MINUTES, deviceDTO);
86 this.addPercentQuantity(CHANNEL_FRACTION_CPU_LOAD_AVERAGE_LAST_FIFTEEN_MINUTES, deviceDTO);