Hoymiles DTU microinverters (PV)

Can you explain me how this exactly works? In english or german. I own the OpenDTU too, but not very familiar in adding something to homeassistant manually.

You’ll have to configure a mqtt broker like mosquito as addon in homeassistant - and then configure the opendtu to export its data to it.

The string above is for homeassistants configuration to import the data on the mqtt database as sensor.

This tutorial may help you on how to configure the mqtt broker: MQTT Setup | Set up Home Assistant with a Raspberry Pi | Adafruit Learning System

Ok thank you. Do i have to use the inverter oder dtu serial?
Did you change any of the mqtt settings in opendtu? Base Topic or Prefix Topic? Both are homeassistant/ in my openDTU Settings.

I would also be very interested in a tutorial for integrating openDTU into HA, possibly with Grafana. So far I haven’t found anything suitable in my research.

still waiting for help from @eingemaischt :slight_smile:


Got if working now, but it only shows up for about 30seconds to a minute and than it shows “not available”. Its Midnight right now. Does it only show something when the Inverter is working? OpenDTU is running and shows “connected”. I don’t get it.

EDIT:
Somehow that version of @eingemaischt works for me now, but i still have a problem above.

Yes, @Lynsch, the inverter only sends data when it’s working. Otherwise it’s in sleep mode.

I would also be interested if there’s a way to store the sensor data in order to have it displayed in HA during sleep mode.

As people are asking, here is what I did.
Assumption:

  • openDTU up and working and connected to your Wifi
  • MQTT broker up and running in your Wifi
  • HOme Assistant up and running (talking about 2022.10.x - might work with older versions)
  1. Setup MQTT broker in HA
    Add new MQTT integration

  2. Configure openDTU
    – Open webpage from open DTU
    – Goto inverter settings, enter serial number of your converter and give it a name (is used in the sensor name in HA)
    – Goto MQTT settings, enable MQTT, enter your MQTT broker IP address and port (1883?), enter credentials if required
    – check settings again
    – Goto MQTT settings, enable HA auto-discovery

  3. Configure HA dashboards
    – Check MQTT integration under settings - open entities and check if new entities appeared (should). New sensor entities are named “sensor.INVERTERNAME_ATTRIBUTE”
    – Add sensors to your dashboards through any visualization card you want to

  4. If sensor data disappears/expires
    – Goto MQTT settings page
    – disable “Enable expiration” (please note, that this means, the last sensor value stays. You need to monitor reachability of the converter via the according sensor)

I hope this helps…

4 Likes

I‘ve got it working and have the information in home Assistant. But I cannot find the setting to disable expiration. Can anyone help me?

Go to ur opendtu webpage, mqtt setting, scroll to bottom. I think it is the 2nd last checkbox…

So easy, thank you very much! I searched for it all the time in home assistant! :man_facepalming:

Here is my integration of OpenDTU in HA:

Does anyone of you know how the data of OpenDTU can be used in the energy dashboard? The power sensor does not show up in the list of available sensors there, only the yield day and yield total ones.

Anything I can do to fix that?

Edit: Nevermind, I simply chose one of the yield sensors for the energy dashboard and it seems to work perfectly fine.

Hey there, is anyone running AhoyDTU with Home Assistant? I cant get it working.
The Moquitto Log has an entry from Ahoy, but I dont get any new devices:

‘2023-04-09 11:30:24: New connection from 192.168.178.125:52563 on port 1883.
2023-04-09 11:30:24: Client DTU_Carport already connected, closing old connection.
2023-04-09 11:30:24: New client connected from 192.168.178.125:52563 as DTU_Carport (p2, c1, k15, u’mqtt’).’

Do you have any Idea, what to do?

Thanks

Where can I find unique_id inverters_yieldday_kwh and inverters_power

OpenDTU can be used in the energy dashboard I found a solution in this topic

and i did it like this
configuration.yaml: (add line)

mqtt: !include mqtt.yaml # opendtu

mqtt.yaml: (add new file in same directory as configuration.yaml if not existing yet)

sensor:
    # General data
  - name: "OpenDTU"
    icon: mdi:information-outline
    state_topic: "solar/dtu/status"
  - name: "OpenDTU power"
    device_class: power
    icon: mdi:solar-power
    unit_of_measurement: "W"
    state_topic: "solar/ac/power"  
  - name: "OpenDTU total production"
    state_class: total
    device_class: energy
    icon: mdi:solar-power-variant
    unit_of_measurement: "kWh"
    state_topic: "solar/ac/yieldtotal"
  - name: "OpenDTU daily production"
    state_class: total
    device_class: energy
    icon: mdi:solar-power-variant
    unit_of_measurement: "Wh"
    state_topic: "solar/ac/yieldday"

opendtu

Hello,
Thank you to Banny310 for his addon.
I installed it on HA core 2023.11.0 with a DTU-W-lite.over Wifi.
Vers. de l’appareil : Gen3
Modèle : DTU-WLite
Vers. matériel : V00.03.12
Vers. logiciel : H06.01.01

It’s Sun dark but there is the info in the dashboard

image

image

message log


“app_mode_active”: {},
“app_mode_passive”: {},
“mqtt”: {
“host”: “core-mosquitto”,
“port”: “1883”,
“username”: “addons”,
“password”: “eiGh3lei1axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxm1Ohdee4iec3aebee”
}
}
[17:47:26] INFO: Starting…
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
INFO | 2023-11-03 17:47:29 | [main] hoymiles.Entrypoint (Entrypoint.java:15) - Starting…
INFO | 2023-11-03 17:47:29 | [main] hoymiles.Entrypoint (Entrypoint.java:16) - TimeZone: Europe/Paris
INFO | 2023-11-03 17:47:29 | [main] bootstrap.WeldStartup (WeldStartup.java:148) - WELD-000900: 4.0.3 (Final)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.weld.bean.proxy.util.WeldDefaultProxyServices$1 (file:/app.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of org.jboss.weld.bean.proxy.util.WeldDefaultProxyServices$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO | 2023-11-03 17:47:30 | [main] bootstrap.WeldStartup (WeldStartup.java:236) - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
INFO | 2023-11-03 17:47:49 | [main] se.WeldContainer (WeldContainer.java:235) - WELD-ENV-002003: Weld SE container 3f7025fc-d7b0-4977-bbce-9ae6d42e28ad initialized
INFO | 2023-11-03 17:47:52 | [pool-2-thread-1] infrastructure.App (App.java:79) - Application Hoymiles DTU starting…
INFO | 2023-11-03 17:47:52 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 17:47:52 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 17:47:52 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 17:47:52 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success
INFO | 2023-11-03 17:47:52 | [pool-2-thread-1] infrastructure.App (App.java:127) - Connecting to MQTT: tcp://core-mosquitto:1883
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] infrastructure.App (App.java:142) - MQTT connection success
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] application.AppController (AppController.java:56) - Successful connected to tcp://core-mosquitto:1883
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] application.AppController (AppController.java:58) - Sending online state…
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] application.AppController (AppController.java:95) - Getting AppInfo from DTU…
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:130) - Sending command: message=com.hoymiles.infrastructure.protos.APPInformationData$APPInfoDataResDTO, responseClazz=com.hoymiles.infrastructure.protos.APPInformationData$APPInfoDataReqDTO
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:120) - → sending: msgId=41729
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:121) - ymdHms: “2023-11-03 17:47:54”, offset: 3600, packageNow: 0, errCode: 0, time: 1699030074,
INFO | 2023-11-03 17:47:54 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:115) - → end
INFO | 2023-11-03 17:47:56 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:24) - ← decode: incoming message, length=106
INFO | 2023-11-03 17:47:56 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:58) - 484da20100017df6006a|xxxxxxxxxxxxxxxxxxxxxx14408140
INFO | 2023-11-03 17:47:56 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:67) - header=HM, msgId=41473, counter=1, dataCrc=32246, msgLen=106
INFO | 2023-11-03 17:47:56 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:97) - dtuSn: “theDTU@MAC”, time: 1699030081, deviceNub: 1, pvNub: 2, packageNub: 1, channel: 1, mAPPDtuInfo {, dtuSw: 780, dtuHw: 24833, dtuRfSw: 160, accessModel: 1, communicationTime: 1699030058, signalStrength: 94, gprsVsn: “”, wifiVsn: “2.3.0.0”, kaNub: “”, dtuRuleId: 18, gprsImei: “”, }, mAPPpvInfo {, pvSn: 18973305540610, pvSw: 10016, pvHwPn: 269565952, pvHw: 266, pvGpfCode: 2560, pvGpf: 8193, },
INFO | 2023-11-03 17:47:56 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:101) - ← end
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] application.AppController (AppController.java:99) - DTU: hw=24833, sw=780, time=2023-11-03T17:48:01
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] application.AppController (AppController.java:101) - Sending autodiscovery…
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] application.AppController (AppController.java:122) - Gathering configuration…
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:130) - Sending command: message=com.hoymiles.infrastructure.protos.GetConfig$GetConfigRes, responseClazz=com.hoymiles.infrastructure.protos.GetConfig$GetConfigReq
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:120) - → sending: msgId=41737
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:121) - offset: 3600, time: 1699030076,
INFO | 2023-11-03 17:47:56 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:115) - → end
INFO | 2023-11-03 17:47:58 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:24) - ← decode: incoming message, length=193
INFO | 2023-11-03 17:47:58 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:58) - 484xxxxxxxxxxxxxxxxxxxxxxxxxxxxab484f786d30313031373224
INFO | 2023-11-03 17:47:58 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:67) - header=HM, msgId=41481, counter=2, dataCrc=7186, msgLen=193
INFO | 2023-11-03 17:47:58 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:97) - offset: 3600, time: 1699030083, netmodeSelect: 1, serverSendTime: 15, wifiRssi: 94, serverPort: 10081, apnSet: “CMNET”, meterKind: “2.3.0.0”, meterInterface: “2.3.0.0”, wifiSsid: “MySSID”, wifiPassword: “MyPWD”, serverDomainName: “dataeu.hoymiles.com”, dtuSn: “theMAC@DTU”, kaNub: “”, apnName: “NONE”, apnPassword: “NONE”, wifiIpAddr0: 192, wifiIpAddr1: 168, wifiIpAddr2: 1, wifiIpAddr3: 76, wifiMac0: 180, wifiMac1: 138, wifiMac2: 10, wifiMac3: 236, wifiMac4: 198, wifiMac5: 116, dtuApSsid: “MyHOYMILES_SSID”, dtuApPass: “MyHOYMILES_PWD”,
INFO | 2023-11-03 17:47:58 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:101) - ← end
INFO | 2023-11-03 17:47:58 | [pool-2-thread-1] application.AppController (AppController.java:129) - serverSendTime: expected=1, current=15
INFO | 2023-11-03 17:47:58 | [pool-2-thread-1] application.AppController (AppController.java:138) - changing ‘serverSendTime’ to 1
INFO | 2023-11-03 17:47:58 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:130) - Sending command: message=com.hoymiles.infrastructure.protos.SetConfig$SetConfigRes, responseClazz=com.hoymiles.infrastructure.protos.SetConfig$SetConfigReq
INFO | 2023-11-03 17:47:58 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:120) - → sending: msgId=41744
INFO | 2023-11-03 17:47:58 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:121) - offset: 3600, time: 1699030078, serverSendTime: 1, wifiSsid: “MyWIFI_SSID”, wifiPassword: “MyWIFI_PWD”, dtuSn: “MyDTU@MAC”,
INFO | 2023-11-03 17:47:58 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:115) - → end
INFO | 2023-11-03 17:48:03 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:24) - ← decode: incoming message, length=19
INFO | 2023-11-03 17:48:03 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:58) - 484da210000132b20013|08901c10c6c894aa06
INFO | 2023-11-03 17:48:03 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:67) - header=HM, msgId=41488, counter=1, dataCrc=12978, msgLen=19
INFO | 2023-11-03 17:48:03 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:97) - offset: 3600, time: 1699030086,
INFO | 2023-11-03 17:48:03 | [nioEventLoopGroup-2-1] dtu.DtuMessageDecoder (DtuMessageDecoder.java:101) - ← end
INFO | 2023-11-03 17:48:03 | [pool-2-thread-1] infrastructure.App (App.java:86) - Bootstrap finished. Waiting for incoming messages…
WARN | 2023-11-03 17:53:03 | [nioEventLoopGroup-2-1] dtu.DtuClient$InboundHandler (DtuClient.java:167) - Watchdog timeout
ERROR | 2023-11-03 17:53:03 | [pool-2-thread-1] infrastructure.App$1 (App.java:55) - DTU connection lost: (null)
INFO | 2023-11-03 17:53:03 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 17:53:03 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 17:53:03 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 17:53:03 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success
WARN | 2023-11-03 17:58:03 | [nioEventLoopGroup-2-1] dtu.DtuClient$InboundHandler (DtuClient.java:167) - Watchdog timeout
ERROR | 2023-11-03 17:58:03 | [pool-2-thread-1] infrastructure.App$1 (App.java:55) - DTU connection lost: (null)
INFO | 2023-11-03 17:58:03 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 17:58:03 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 17:58:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 17:58:06 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success
WARN | 2023-11-03 18:03:06 | [nioEventLoopGroup-2-1] dtu.DtuClient$InboundHandler (DtuClient.java:167) - Watchdog timeout
ERROR | 2023-11-03 18:03:06 | [pool-2-thread-1] infrastructure.App$1 (App.java:55) - DTU connection lost: (null)
INFO | 2023-11-03 18:03:06 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 18:03:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 18:03:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 18:03:06 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success
WARN | 2023-11-03 18:08:06 | [nioEventLoopGroup-2-1] dtu.DtuClient$InboundHandler (DtuClient.java:167) - Watchdog timeout
ERROR | 2023-11-03 18:08:06 | [pool-2-thread-1] infrastructure.App$1 (App.java:55) - DTU connection lost: (null)
INFO | 2023-11-03 18:08:06 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 18:08:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 18:08:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 18:08:06 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success
WARN | 2023-11-03 18:13:06 | [nioEventLoopGroup-2-1] dtu.DtuClient$InboundHandler (DtuClient.java:167) - Watchdog timeout
ERROR | 2023-11-03 18:13:06 | [pool-2-thread-1] infrastructure.App$1 (App.java:55) - DTU connection lost: (null)
INFO | 2023-11-03 18:13:06 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 18:13:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 18:13:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 18:13:06 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success
WARN | 2023-11-03 18:18:06 | [nioEventLoopGroup-2-1] dtu.DtuClient$InboundHandler (DtuClient.java:167) - Watchdog timeout
ERROR | 2023-11-03 18:18:06 | [pool-2-thread-1] infrastructure.App$1 (App.java:55) - DTU connection lost: (null)
INFO | 2023-11-03 18:18:06 | [pool-2-thread-1] infrastructure.App (App.java:109) - Connecting to DTU: “my_@IP”:10081 (watchdog_timeout=300)
INFO | 2023-11-03 18:18:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:78) - Trying connect to “my_@IP”:10081
INFO | 2023-11-03 18:18:06 | [pool-2-thread-1] dtu.DtuClient (DtuClient.java:87) - Connect success to “my_@IP”:10081
INFO | 2023-11-03 18:18:06 | [pool-2-thread-1] infrastructure.App (App.java:123) - DTU connection success


I’ll try next to set the dashboard correctly and verifying the solar info

Use --illegal-access=warn

Do you use the correct passwort and user?
(Like in your app or in the hoymiles web surface?)

Is it also possible to configure the power limiter of the inverter via home assistant and open DTU?
I would like to prevent it to export energy into the grid. Can I do this using home assistant?

1 Like

Hi wasilukm,

I got now “hoymiles-plant-DTU-Pro” running but I am not able to get your “hoymiles-mqtt” running as an integration as I get the error in Homeassistant that the github repository structure is invalid.

Kind Regards.