You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-23Lines changed: 71 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,49 +1,72 @@
1
1
# Hame Relay
2
2
3
-
This project helps you integrate your B2500 storage system with both the official mobile app and local home automation systems. It solves two common integration challenges:
3
+
This project helps you integrate your Marstek storage systems with both the official mobile app and local home automation systems. It supports all Marstek storage systems including the Marstek Saturn (B2500), Marstek Venus, and Marstek Jupiter, solving common integration challenges:
4
4
5
5
1. Using the official app with a locally configured storage system
6
6
2. Using home automation with a storage system configured for the official Hame cloud
7
7
8
8
## How It Works
9
9
10
-
The B2500 storage system can be configured to use either:
10
+
Marstek storage systems can be configured to use either:
11
11
- The official Hame MQTT broker (default) - allows control via the mobile app but not local automation
12
-
- A local MQTT broker - allows local automation but breaks mobile app control
12
+
- A local MQTT broker - allows local automation but breaks mobile app control (**Note: Only available for Marstek Saturn/B2500**)
13
13
14
14
This tool bridges these two scenarios by forwarding MQTT messages between your local broker and the Hame broker. It has two modes controlled by the `inverse_forwarding` option:
15
15
16
16
### Mode 1: Storage configured with local broker (`inverse_forwarding: false`)
17
-
- Use this when your storage is configured to use your local MQTT broker
17
+
-**Only available for Marstek Saturn/B2500 systems**
18
+
- Use this when your Saturn/B2500 is configured to use your local MQTT broker
18
19
- The relay forwards necessary messages to the Hame broker
19
20
- Allows you to keep using the official mobile app while your storage runs on local MQTT
20
21
21
22
### Mode 2: Storage configured with Hame broker (`inverse_forwarding: true`)
23
+
-**Required for Marstek Venus and Jupiter systems** (they cannot be reconfigured to use local MQTT)
24
+
-**Optional for Marstek Saturn/B2500** if you prefer to keep using the Hame broker
22
25
- Use this when your storage is using the default Hame MQTT broker
23
26
- The relay forwards messages from your local broker to Hame
24
27
- Allows local home automation control without reconfiguring your storage
25
28
29
+
## Getting Device Information
30
+
31
+
You need your storage system's Device ID, MAC address, and device type (e.g. HMA-1, HMA-2, HMA-3 etc.) for configuration.
32
+
33
+
**Recommended approach:**
34
+
- Provide your Hame account username and password in the configuration
35
+
- The relay will automatically fetch your device information from the Hame API
36
+
- Check the application logs to see the retrieved device details
37
+
- Update your configuration with the actual values
38
+
39
+
**Manual approach:**
40
+
- If you already know your device details, specify them directly in the configuration
41
+
26
42
## Prerequisites
27
43
28
44
- Either:
29
45
- Docker environment
30
46
- Home Assistant OS or a Home Assistant Supervised installation
31
-
- Your storage's Device ID, MAC and device type (e.g. HMA-1, HMA-2, HMA-3 etc.)
32
-
- Optional: Configure storage with local MQTT broker (see below)
47
+
-**Legal ownership of a Marstek storage system and associated Hame software**
33
48
34
-
You can get your Device ID, MAC address and device type by logging into the [Energy Management System](https://eu.hamedata.com/app/AfterSales/login.html)with your account. The Device ID is the 22 to 24-digit value below "Device Configuration". The MAC address and type is listed below.
49
+
## Configure Storage with Local MQTT Broker
35
50
36
-
## Configure Storage with Local MQTT Broker (Optional)
51
+
**Note: This section only applies to Marstek Saturn/B2500 systems. Marstek Venus and Jupiter systems cannot be configured with a local MQTT broker and must use Mode 2 (`inverse_forwarding: true`).**
37
52
38
-
This step is optional depending on your chosen setup:
39
-
- If you want to use the storage with a local broker (`inverse_forwarding: false`), follow these steps
40
-
- If you want to keep using the Hame broker (`inverse_forwarding: true`), skip this section
53
+
This configuration allows you to use Mode 1, where your Saturn/B2500 connects to your local MQTT broker while maintaining mobile app functionality.
41
54
42
-
1. Enable the MQTT option through the [Energy Management System](https://eu.hamedata.com/app/AfterSales/login.html) by toggling "MQTT enabled" on
55
+
**You have two options to enable and configure MQTT:**
56
+
57
+
### Option 1: Contact Support (Recommended)
58
+
1.**Contact support to enable MQTT**: Use the in-app feedback functionality in the Power Zero/Marstek App to contact support and request MQTT activation for your B2500 device
43
59
2. Open the Power Zero/Marstek App and connect to your storage via Bluetooth
44
-
3. Under "Settings" you'll see an option "MQTT" now
60
+
3. Under "Settings" you'll see an option "MQTT" now (after support has enabled it)
45
61
4. Fill out your MQTT broker settings. Make sure to enable or disable the checkbox "SSL connection enabled", depending on whether your broker supports SSL (disable if unsure)
46
-
5. Save
62
+
5.**Important**: Make sure you write down the MAC address displayed in the Marstek app! You will need it later and the WIFI MAC address of the battery is the wrong one.
63
+
6. Save
64
+
65
+
### Option 2: Direct Bluetooth Configuration
66
+
1. With an Android smartphone or Bluetooth-enabled PC, use [this tool](https://tomquist.github.io/hame-relay/b2500.html) to configure the MQTT broker directly via Bluetooth
67
+
2.**Important**: Make sure you write down the MAC address that is displayed in this tool! You will need it later and the WIFI MAC address of the battery is the wrong one.
68
+
69
+
**⚠️ Important Warning**: Enabling MQTT on the device will disable the cloud connection. You will not be able to use the PowerZero or Marstek app to monitor or control your device anymore. You can re-enable the cloud connection by using this Hame Relay tool in Mode 1.
47
70
48
71
Now your storage can be controlled through your own MQTT broker. See [this document](https://eu.hamedata.com/ems/mqtt/index.html?version=2) for more information.
49
72
@@ -72,7 +95,17 @@ mkdir config
72
95
]
73
96
}
74
97
```
75
-
Note: If you provide `username` and `password`, the relay can fetch your device information automatically from the Hame API.
98
+
99
+
**Configuration options:**
100
+
-`inverse_forwarding`: Choose your operation mode:
101
+
-`false` (default): Storage uses local broker, maintain app functionality (**Only available for Saturn/B2500**)
102
+
-`true`: Storage uses Hame broker, enable local control (**Required for Venus/Jupiter, optional for Saturn/B2500**)
103
+
-`username` and `password`: Your Hame account credentials for automatic device information retrieval
104
+
-`devices`: Your storage systems' details (can use dummy values initially if using automatic retrieval)
105
+
106
+
**Getting Device Information:**
107
+
-**Recommended**: If you provide `username` and `password`, the relay can fetch your device information automatically from the Hame API. Check the container logs to see the retrieved device details, then update your configuration with the actual values.
108
+
-**Manual**: If you know your device details, you can specify them directly in the `devices` array.
76
109
77
110
3. Run the container:
78
111
```bash
@@ -122,7 +155,7 @@ docker compose up -d
122
155
```
123
156
124
157
2. Install the "Hame Relay" add-on
125
-
3. Configure your device details (see below)
158
+
3. Configure your device details
126
159
4. Start the add-on
127
160
128
161
## Configuration
@@ -133,7 +166,7 @@ Example configuration:
133
166
# Optional: only needed if not using Home Assistant's MQTT service
134
167
mqtt_uri: "mqtt://username:password@host:1883"
135
168
136
-
# Choose your operation mode (see "How It Works" section above)
169
+
# Choose your operation mode
137
170
inverse_forwarding: false
138
171
139
172
# Optional: Hame account credentials to automatically fetch device information
@@ -149,13 +182,18 @@ devices:
149
182
type: "HMA-1"
150
183
```
151
184
185
+
**Getting Device Information:**
186
+
- **Automatic retrieval**: If you provide `username` and `password`, the add-on will automatically fetch your device information from the Hame API
187
+
- **Important for Home Assistant**: You must include at least one device in the `devices` list (even if using automatic retrieval). You can use dummy values initially, then check the add-on logs to see your actual device details and update the configuration accordingly
188
+
- **Manual configuration**: If you already know your device details, specify them directly in the `devices` array
189
+
152
190
### MQTT Configuration
153
191
154
192
The add-on will automatically use your Home Assistant MQTT settings if configured. You only need to provide the `mqtt_uri` if you want to use a different MQTT broker.
155
193
156
194
### Required Configuration
157
195
158
-
- `devices`: List of your B2500 devices with their IDs, MAC addresses and types
196
+
- `devices`: List of your Marstek storage systems with their IDs, MAC addresses and types
159
197
- `device_id`: Your device's 22 to 24-digit ID
160
198
- `mac`: Your device's MAC address without colons
161
199
- `type`: Your device's type (e.g. HMA-1, HMA-2, HMA-3 etc.)
@@ -164,12 +202,22 @@ The add-on will automatically use your Home Assistant MQTT settings if configure
164
202
### Optional Configuration
165
203
166
204
- `inverse_forwarding`: Choose your operation mode:
167
-
- `false` (default): Storage uses local broker, maintain app functionality
168
-
- `true`: Storage uses Hame broker, enable local control
169
-
- `username`: Your Hame Energy Management System email address. If provided along with password,
170
-
the tool can automatically fetch device information from the Hame API.
171
-
- `password`: Your Hame Energy Management System password
205
+
- `false` (default): Storage uses local broker, maintain app functionality (**Only available for Saturn/B2500**)
206
+
- `true`: Storage uses Hame broker, enable local control (**Required for Venus/Jupiter, optional for Saturn/B2500**)
207
+
- `username`: Your Hame account email address. When provided along with password,
208
+
the tool will automatically fetch device information from the Hame API and display it in the logs.
209
+
- `password`: Your Hame account password. Required when using automatic device information retrieval.
172
210
173
211
## Development
174
212
175
213
For development instructions, see [CONTRIBUTING.md](CONTRIBUTING.md)
214
+
215
+
## Interoperability Statement
216
+
217
+
This software is developed for the sole purpose of achieving interoperability between Marstek storage systems and home automation platforms, in accordance with EU Directive 2009/24/EC Article 6. The relay enables legitimate users to maintain functionality of both official mobile applications and local automation systems that would otherwise be mutually exclusive. All reverse engineering activities conducted during development were limited to extracting only the minimum information necessary to establish communication protocols for interoperability purposes.
218
+
219
+
**Legal Compliance**: This project does not compete with or replace the original Hame software. Users must own legitimate copies of the original software and hardware. Any embedded certificates or authentication data included are used solely for interoperability purposes as permitted under EU Directive 2009/24/EC Article 6.
220
+
221
+
## License & Legal
222
+
223
+
This project is provided for interoperability purposes only. Users are responsible for ensuring compliance with applicable laws in their jurisdiction. The project maintainers make no warranties regarding legal compliance beyond the stated interoperability purpose.
0 commit comments