]> git.basschouten.com Git - openhab-addons.git/blob
28cf1c95285894384ea6ac53ee53d68bc0c7720b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.modbus.e3dc.internal.modbus;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link E3DCModbusConstans} Variables for register handling.
19  * The numbers are taken from E3DC Modbus Spec Chapter 3.1 page 14 ff
20  * Registers start from 0 (not 1!) so from the documented registers subtract 1
21  *
22  * @author Bernd Weymann - Initial contribution
23  */
24 @NonNullByDefault
25 public class E3DCModbusConstans {
26     // "String" registers at the beginning shall be read with very low frequency - 1 hour
27     public static final int INFO_POLL_REFRESH_TIME_MS = 60 * 60 * 1000;
28
29     // Constants where a certain Block starts and block size. Note: General offset is -1 so INFO_REG from E3DC Modbus
30     // Spec starts at 1 but it's Register 0!
31     public static final int INFO_REG_START = 0;
32     public static final int INFO_REG_SIZE = 67;
33     public static final int POWER_REG_START = 67;
34     public static final int POWER_REG_SIZE = 16;
35     public static final int EMS_REG_START = 83;
36     public static final int EMS_REG_SIZE = 2;
37     public static final int WALLBOX_REG_START = 87;
38     public static final int WALLBOX_REG_SIZE = 8;
39     public static final int STRINGS_REG_START = 95;
40     public static final int STRINGS_REG_SIZE = 9;
41     public static final int REGISTER_LENGTH = 104;
42
43     /*
44      * Some Registers are numbers but needs to be decoded into Bits
45      */
46
47     // Wallbox Bit Definitions according to chapter 3.1.5 page 15
48     public static final int WB_AVAILABLE_BIT = 0;
49     public static final int WB_SUNMODE_BIT = 1;
50     public static final int WB_CHARGING_ABORTED_BIT = 2;
51     public static final int WB_CHARGING_BIT = 3;
52     public static final int WB_JACK_LOCKED_BIT = 4;
53     public static final int WB_JACK_PLUGGED_BIT = 5;
54     public static final int WB_SCHUKO_ON_BIT = 6;
55     public static final int WB_SCHUKO_PLUGGED_BIT = 7;
56     public static final int WB_SCHUKO_LOCKED_BIT = 8;
57     public static final int WB_SCHUKO_RELAY16A_BIT = 9;
58     public static final int WB_RELAY_16A_BIT = 10;
59     public static final int WB_RELAY_32A_BIT = 11;
60     public static final int WB_1PHASE_BIT = 12;
61
62     // EMS Bit Definitions according to chapter 3.1.3 page 17
63     public static final int EMS_CHARGING_LOCK_BIT = 0;
64     public static final int EMS_DISCHARGING_LOCK_BIT = 1;
65     public static final int EMS_AVAILABLE_BIT = 2;
66     public static final int EMS_WEATHER_CHARGING_BIT = 3;
67     public static final int EMS_REGULATION_BIT = 4;
68     public static final int EMS_CHARGE_LOCKTIME_BIT = 5;
69     public static final int EMS_DISCHARGE_LOCKTIME_BIT = 6;
70 }