Creating channels from MQTT Config Topics

  • Platform information:
    • Hardware: x86_64, i5-8499 2,8Ghz, 32GB Ram
    • OS: Ubuntu 24.04. LTS
    • Java Runtime Environment: openjdk 17.0.15 2025-04-15
    • openHAB version: openHAB 4.3.5

I have a Growatt Noha 2000 battery that I would like to integrate in OH4. I did a lot of searching on the net yesterday and found out that Grott, as workaround with the Growatt-Binding is incompatible with the Noha 2000 because it communicates differently. See this discussion growatt noah 2000 battery with other brand inverter · johanmeijer/grott · Discussion #560 · GitHub.

The only ray of hope is the noha-mqtt project on github. I can start it on my server and the MQTT broker automatically recognizes the device and appears in the INBOX.
Unfortunately, it doesn’t offer any channels, but all the channels are listed in the configuration under MQTT Config Topic. (see picture)

Noha-mqtt is actually intended for Home Assistant.
Is there a way to use a script or rule with MQTT to convert the points from the topics into channels that I can read out?

I’m new handling openHub, and I’m terrible at scripting. Help is very welcome as I am reluctant to change.

Best regards Daniel

Welcome to openhab. Do you have Mqtt binding installed? What about JSONPATh and Jinja transforms? The channels should have appeared automatically

MQTT Binding is installed. I didn’t have JASONPATh and Jinja installed, but I have just installed them. Unfortunately, this doesn’t change anything. Do I have to configure anything else for JASONPATh and Jinja?

Hi,
You can also work directly with ‘Generic MQTT Thing’. Javascipt and JsonPath is required for this example. I send commands directly with Blockly.

UID: mqtt:topic:YourBroker:Growatt_Noah
label: Solarspeicher_Growatt
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:YourBroker
channels:
  - id: Solarspeicher_soc
    channelTypeUID: mqtt:number
    label: Ladepegel
    configuration:
      stateTopic: noah2mqtt/0PVPJ7ZR245T00QF
      transformationPattern:
        - JSONPATH:$.soc
      unit: "%"
  - id: Solarspeicher_Temp
    channelTypeUID: mqtt:number
    label: Temperatur
    configuration:
      stateTopic: noah2mqtt/0PVPJ7ZR245T00QF/BAT0
      transformationPattern:
        - JSONPATH:$.temp
      unit: °C
  - id: Solarspeicher_Solar_in
    channelTypeUID: mqtt:number
    label: Solar_in
    configuration:
      stateTopic: noah2mqtt/0PVPJ7ZR245T00QF
      transformationPattern:
        - JSONPATH:$.solar_w
      unit: W
  - id: Solarspeicher_output_w
    channelTypeUID: mqtt:number
    label: output_w
    configuration:
      stateTopic: noah2mqtt/0PVPJ7ZR245T00QF
      transformationPattern:
        - JSONPATH:$.output_w
      unit: W
  - id: Solar_charge_sum
    channelTypeUID: mqtt:number
    label: Solar_charge_sum
    description: ""
    configuration:
      stateTopic: noah2mqtt/0PVPJ7ZR245T00QF
      transformationPattern:
        - JS:|var obj = JSON.parse(input); var charge =
          parseFloat(obj.charge_w);var discharge = parseFloat(obj.discharge_w) *
          -1;charge + discharge
      unit: W

Not that I am aware of. What also looks odd is the yellow unknown thing status, maybe that is stopping the configs in some way. I don’t have a HA thing at this moment to compare. Do you have Mqtt Explorer installed to examine the topics? (to see if they are getting through?) there should be two sections (one the direct topics that could be used in generic things, two the HA config section that pulls from the direct topics).

Edit: another thought is to delete the thing and rescan now that the transforms are installed.

Okay, I’ve done it. Many thanks for the tips.
I can’t say exactly what solved it, as I was working on several points at the same time.
I added two settings to Mosquitto MQTT Broker. I deleted the items and things and created everything again. Then I realized that I hadn’t started noha-mqtt at all and did it again.
Anyway, the channels then appeared and then the items too. I had to link everything manually. Unfortunately, Noha2000 has been offline since the afternoon and I don’t know why, so I can’t see the changes. The values are now old.

I would describe the setup of the Noha2000 here in the forum. Where is the best place for this?

You could post under the Openhab stories or solutions topics