[APP][PRO] Mennekes modbus

Hello Tjar,

This last document you’ve provided. I went through but this doesn’t help. Doesn’t correspond with my charger type according to me.

My charger is clearly working via the LAN network since I can get to it to configure parameters.
Into the image from my charger in my Garage, I show you my model and some DATA from the first screen I get when connected directly with this charging station.
Onto the same IP-network segment from the charging station, my Homey-Pro is situated as well as my SMA Home Manager 2.0. This SMA Home Manager 2.0 can clearly CONTROL my charger. The charger when set into ENERGY MANAGER mode, can follow the charging level my SMA HM 2.0 pushes : based onto the level of solar-power available.
So there’s clearly a communication ongoing at that moment. But if this via a MODBUS communication, that I don’t know. Tried several times but don’t get any MODBUS tool showing me anything…

Getting this charger to communicate with my Homey Pro was actually one from the main reasons why I bought this Homey Pro.
I keep hoping that somehow a solution pops up…
Regards, Walter

If your device has ModbusTCP enabled and you know the Port and device ID… and you know the Modbus registers/types (provided by the manufacturers Modbus documentation), you could use rhis app:

This app allows to use HomeyPro to read/write Modbus registers. But that only makes sense if you know your device allows Modbus access and you know the registers to use for.

Hello RonnyW,

I’ve tried what you suggested but don’t directly see any progress in this.

I’ve just replied to Tjar ( as to my understanding, the developer from the APP for Mennekes Amtron within Homey Pro ) .
Thanks

Hello Tjar,

The winter-period is now kind of passed-by.
During the winter-period, controlling my charging station is kind of important.
Controlling my charging station from within Homey-Pro would be great.

But last winter-period that was not possible. I had to do things myself, manually.
This works relative well but naturally it takes daily attention.
But every now and then I make a small mistake, I forget something somewhere and then, things can go a bit wrong or call it different then what I wanted to happen.
By this I’ve had every month somewhere a small moment that I charged my car with to high power so that I pull a lot from the grid in a short time.
In Belgium we have a special mechanism called : CAPACITEITSTARIEF
That is used to calculate a kind of extra cost.

Now the summer period starts, I have a lot of solar energy so charging my car is now normally purely by solar-power and by that, I have less issues since my charger does perform this intelligent. So charging goes fine.
But by the next winter-period it would be nice to have a CONTROL capability via Homey-Pro.

So I keep asking, begging you to please : have a look into this topic as we discussed before and please try to get my charging station type ( from Mennekes ) to be included as a functioning solution.

Thanks for your efforts

Kind regards,
Walter

Hi,

so because of very limited time I’m not capable of maintaining apps. Also for myself.

So I have a different solution using a Modbus gateway from teletonika (about $100).

It’s the TRB256 which will sit between Homey’s (internal) MQTT broker and (any) Modbus device. It will auto retrieve the data from your Modbus device and send in to your MQTT broker, where you can pick it up with MQTT HUB and MQTT client.

So, you login to your dataserver and just configure your ModbusTCP client

  1. Service>Modbus>Modbus TCP Client

There you define your endpoints and the device you want to communicate

(scroll down) And the registers (and types) you want to have automatically read. Make sure the request name is logical as we’ll make that available in the MQTT payload.

You may test individual request by using the “testing” method below.

==============================================================================

So, now you’ve tested the request locally we can now setup the MQTT connection. Goto Services>Data To Server

Here you create a new COLLECTION which can hold multiple requests, so just “ADD” a new collection

You first configure the “collector” properties with a name, an interval period (1sec) and the type of payload.

And then you configure the MQTT broker, mines is served from within Homey Pro. Choose a logical Topic for the collector to publish to.

Then you add a new data configuration to the collector to publish retrieved data automatically to the MQTT broker.

Just apply now and connect to the broker using a client like MQTTX and you’ll see messages like:

{"ModbusTCP":{ "Amtron":
   { "ChargeCurrent": 
      { "data":[32] 
     }
   }
 }
}
====================================================================
{"ModbusTCP":{ "Amtron":
   { "AC": 
      { "data":[30976004,-1,-1,0,-1,-1,3,0,0,30976004,0,224,-1,-1] 
     }
   }
 }
}
====================================================================

==============================================================================

Now getting it into Homey:

Setup the MQTT HUB and MQTT Client in Homey (lots of details to find).

Create a MQTT Device, skip the capability configuration for now just create it.

Now edit the device and paste the following configuration:

{
  "evcharger_charging_state": {
    "capability": "evcharger_charging_state",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {if(value.ModbusTCP.Amtron.State.data[0] === 0) return 'plugged_out'; if(value.ModbusTCP.Amtron.State.data[0] === 1) return 'plugged_in'; if(value.ModbusTCP.Amtron.State.data[0] === 6) return 'plugged_in_charging'; if(value.ModbusTCP.Amtron.State.data[0] === 9) return 'plugged_in_paused';  }",
    "outputTemplate": "",
    "displayName": "Status"
  },
  "measure_number.target_current": {
  "capability": "measure_number",
  "stateTopic": "Teltonika",
  "setTopic": "",
  "valueTemplate": "(value) => { return value.ModbusTCP.Amtron.ChargeCurrent.data[0]; }",
  "outputTemplate": "",
  "displayName": "Current limit",
  "units": "A"
  },
  "evcharger_charging": {
    "capability": "evcharger_charging",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {if(value.ModbusTCP.Amtron.State.data[0] === 6) return 1; return 0  }",
    "outputTemplate": "",
    "displayName": "Charging"
  },
  "measure_current.L1": {
    "capability": "measure_current",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[6] /1000}",
    "outputTemplate": "",
    "displayName": "L1 current"
  },
  "measure_current.L2": {
    "capability": "measure_current",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[7] /1000}",
    "outputTemplate": "",
    "displayName": "L2 current"
  }, 
  "measure_current.L3": {
    "capability": "measure_current",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[8] /1000}",
    "outputTemplate": "",
    "displayName": "L3 current"
  },
  "measure_power.total": {
    "capability": "measure_power",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[0] /1000}",
    "outputTemplate": "",
    "displayName": "Power",
     "units": "kW"
  },
  "measure_voltage.L1": {
    "capability": "measure_voltage",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[11]}",
    "outputTemplate": "",
    "displayName": "L1 Volt"
  },
  "measure_voltage.L2": {
    "capability": "measure_voltage",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[12]}",
    "outputTemplate": "",
    "displayName": "L2 Volt"
  },
  "measure_voltage.L3": {
    "capability": "measure_voltage",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[13]}",
    "outputTemplate": "",
    "displayName": "L3 Volt"
  },
  "meter_power.session": {
    "capability": "meter_power",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.Session.data[0] / 1000}",
    "outputTemplate": "",
    "displayName": "Session",
     "units": "kWh"
  },
  "measure_number": {
    "capability": "measure_number",
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.Session.data[1]}",
    "outputTemplate": "",
    "displayName": "Session time",
    "units": "s"
  },
  "meter_power.total": {
    "capability": "meter_power",
    "energy": {"cumulative": true },
    "stateTopic": "Teltonika",
    "setTopic": "",
    "valueTemplate": "(value) => {return value.ModbusTCP.Amtron.AC.data[9] / 1000}",
    "outputTemplate": "",
    "displayName": "Total Energy",
     "units": "kWh"
  },
  "target_temperature.target_current": {
  "capability": "target_temperature",
  "stateTopic": "Teltonika",
  "setTopic": "Teltonika/Amtron/ChargeCurrent/set",
  "valueTemplate": "(value) => { return value.ModbusTCP.Amtron.ChargeCurrent.data[0]; }",
  "outputTemplate": "(value) => { return String(value); }",
  "displayName": "Current Limit",
  "units": "A"
 }
}

And then you’ll see:

Write for current limit is something I still have to do. Should be from an advanced flow using Something like:

{
  "cookie": 2,
  "type": 0,
  "host": "192.168.2.205",
  "port": 502,
  "timeout": 2,
  "server_id": 255,
  "function": 6,
  "register_number": 1000,
  "value": 10
}

Using a flow this can be done by:

That should be published to a topic corresponding to the settings in Services>Modbus>Mqtt Modbus Gateway

This results in:

and the ack:

image