Marstek Venus E2 with hame-relay and hm2mqtt

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Marstek Venus E2 with hame-relay and hm2mqtt

Post by eddieb »

As discussed in an other topic.

I have my Marstek Venus E2 working with hame-relay and hm2mqtt working all in docker ...

install https://github.com/tomquist/hame-relay

compose.yaml

Code: Select all

services:
  mqtt-forwarder:
    container_name: hame-relay
    image: ghcr.io/tomquist/hame-relay:latest
    restart: unless-stopped
    dns_search: .
    volumes:
      - ./config:/app/config
    environment:
      - LOG_LEVEL=info
networks: {}

Code: Select all

cat config.json
{
  "broker_url": "mqtt://your-broker-ip",
  "username": "your-marstek-user",
  "password": "your-marstek-password",
  "inverse_forwarding": "true"
}
install https://github.com/tomquist/hm2mqtt

compose.yaml

Code: Select all

services:
  hm2mqtt:
    container_name: hm2mqtt
    image: ghcr.io/tomquist/hm2mqtt:latest
    restart: unless-stopped
    environment:
      - MQTT_BROKER_URL=mqtt://your-broker-ip:1883
      - MQTT_USERNAME=''
      - MQTT_PASSWORD=''
      - MQTT_POLLING_INTERVAL=60
      - MQTT_RESPONSE_TIMEOUT=45
      - POLL_CELL_DATA=true
      - POLL_EXTRA_BATTERY_DATA=true
      - POLL_CALIBRATION_DATA=true
      - DEVICE_0=HMG-50:0019aa0d4dcb # 12-character MAC address
#      - DEVICE_0=HMA-1:0019aa0d4dcb # 12-character MAC address
networks: {}
The DEVICE must be HMg-50 for VENUS E2
the MAC must be the Bluetooth MAC address of your battery

from now on hm2mqtt polls the Marstek cloud every minute and sends data over mqtt
as I had MQTTAD running, some 94 devices are created in domoticz !

- don't be surprised to see some timeouts on polling
- don't be surprised to see some very strange values in the TEMPERATURE devices
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
willemd
Posts: 795
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.3
Location: The Netherlands
Contact:

Re: Marstek Venus E2 with hame-relay and hm2mqtt

Post by willemd »

If you want to build on that and use that communication layer to control your battery you could use:

https://github.com/WillemD61/battery-planning

That program retrieves:
1) day ahead prices, either per 15 minutes of per hour
2) solar forecast for your solar panels
3) expected usage from a domoticz device
4) various settings related to your battery from domoticz user variables and the SOC device (you could modify it to take it from mqtt)

It then optimises the strategy for your battery for the day (1 or 2) ahead and sends the setting for the next hour to your battery using hame-relay.

Further details on github.
Post Reply