Maximum number of channels in things file?

  • Platform information:
    • Hardware: Raspberry Pi 3 Model B Plus Rev 1.3
    • OS: Raspbian GNU/Linux 9 (stretch)
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: openhabian 2.5.11-1
  • Issue of the topic: When I try to specify more than 6 channels for one topic in the mqtt.things file, mqtt does not return any values - not only for this topic, but for all topics specified in the mqtt.things file. I am using mosquitto.
  • Please post configurations (if applicable):
    • Items configuration related to the issue
//Martins Tesla RedRacer via Teslalogger mqtt 2.5

Number RedRacer_Restkm “Reichweite RedRacer [%.1f km]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_ideal_battery_range” }

String RedRacer_sleeping “RedRacer schläft [%s]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_sleeping” }

String RedRacer_is_preconditioning “RedRacer heizt vor [%s]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_is_preconditioning” }

String RedRacer_charging “RedRacer lädt [%s]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_charging” }

Number RedRacer_charger_actual_current “RedRacer Ladestrom [%.1f A]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_charger_actual_current” }

Number RedRacer_charger_phases “RedRacer lädt mit [%s Phase(n)]” <poweroutlet_eu> (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_charger_phases” }

Number RedRacer_charge_energy_added “RedRacer Ladung [%.1f kWh]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_charge_energy_added” }

Number RedRacer_SOC “Ladestand RedRacer [%.1f %%]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_battery_level” }

Number RedRacer_km “km Stand RedRacer [%.1f km]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_odometer” }

Number RedRacer_outside_temp “RedRacer Außentemperatur [%.1f °C]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_outside_temp” }

String RedRacer_driving “RedRacer fährt [%s]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_driving” }

Number RedRacer_speed “akt. Tempo RedRacer [%.1f km/h]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_speed” }

String RedRacer_trip_start “RedRacer letzte Fahrt Startzeit [%s]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_trip_start” }

Number RedRacer_trip_distance “RedRacer letzte Fahrt [%.1f km]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_trip_distance” }

Number RedRacer_trip_kwh “RedRacer letzte Fahrt Verbrauch [%.1f kWh]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_trip_kwh” }

Number RedRacer_trip_avg_kwh “RedRacer Trip Durchschnittsverbrauch [%.1f Wh/km]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_trip_avg_kwh” }

Number RedRacer_trip_max_speed “RedRacer Trip Höchstgeschwindigkeit [%.1f km/h]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_trip_max_speed” }

Number RedRacer_trip_max_power “RedRacer Trip max. PS [%.1f PS]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_trip_max_power” }

String RedRacer_firmware “RedRacer Software Stand [%s]” (gTesla1) { channel=“mqtt:topic:mosquitto:RedRacer:RedRacer_car_version” }

  • working things configuration related to the issue

// Tesla
Thing topic RedRacer “RedRacer” @ “Carport” {
Channels:

    Type number : RedRacer_ideal_battery_range "Reichweite"               [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.ideal_battery_range_km" ]

    Type string : RedRacer_sleeping "RedRacer schlaeft"  [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.sleeping" ]

    Type string : RedRacer_charging "RedRacer laedt"  [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.charging" ]

    Type number : RedRacer_charger_actual_current      "RedRacer Ladestrom" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.charger_actual_current"]

    Type number : RedRacer_battery_level "Batteriestand" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.battery_level" ]

    Type string : RedRacer_is_preconditioning "RedRacer heizt vor" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.is_preconditioning" ]

}
  • not working things file related to the issue

// Tesla
Thing topic RedRacer “RedRacer” @ “Carport” {
Channels:

    Type number : RedRacer_ideal_battery_range "Reichweite"               [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.ideal_battery_range_km" ]

    Type string : RedRacer_sleeping "RedRacer schlaeft"  [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.sleeping" ]

    Type string : RedRacer_charging "RedRacer laedt"  [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.charging" ]

    Type number : RedRacer_charger_actual_current      "RedRacer Ladestrom" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.charger_actual_current"]

    Type number : RedRacer_battery_level "Batteriestand" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.battery_level" ]

    Type string : RedRacer_is_preconditioning "RedRacer heizt vor" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.is_preconditioning" ]

    Type number : RedRacer_charger_actual_current      "RedRacer Ladestrom" [ stateTopic="tele/RedRacer", transformationPattern="JSONPATH:$.charger_actual_current" 
}
  • If logs where generated please post these here using code fences:

So everything is working fine as long as I only specify up to 6 channels for the topic RedRacer.
As soon as I add one ore more addt’l channels, the mqtt.things file stops working.
Sorry for asking, but is there a maximum number of 6 channels per topic in the mqtt.things file? Can this be changed by any parameter? I am not that familiar with the environment…

Many thanks in advance!

Please could you reformat your OP to use code fences - helps us to see the code better!

No, there’s not a limit. I have loads of Channels for some of my Things (15+).

What happens if you have more than 6 Channels, but restart openHAB too? Does it work then?

Thanks a lot! The problem was a missing ] at the end of channel 7, so this one and all the following channel specifications were in error.