message: fix: use ids without node prefix
diff: @@ -1178,30 +1178,32 @@ Gateway.prototype.discoverClimates = function (node) {
  v.commandClass === CommandClasses['Thermostat Setpoint'] &&
  v.property === 'setpoint'
  ) {
  - setpoints.push(v)
  + setpoints.push(vId)
  } else if (
  v.commandClass === CommandClasses['Multilevel Sensor'] &&
  v.property === 'Air temperature'
  ) {
  - temperatures.push(v)
  + temperatures.push(vId)
  } else if (
  v.commandClass === CommandClasses['Thermostat Mode'] &&
  v.property === 'mode'
  ) {
  - modes.push(v)
  + modes.push(vId)
  }
  }
  - const mode = modes[0]
  - const temperature = temperatures[0]
  + const modeId = modes[0]
  + const temperatureId = temperatures[0]
  - if (!temperature || !mode) {
  + if (!temperatureId || !modeId) {
  debug(
  'Unable to discover climate device, there is no valid temperature/thermostat mode valueIds'
  )
  return
  }
  + const mode = node.values[modeId]
  +
  // [0, 1, 2] ---> ['off', 'heat', 'cold']
  const availableModes = mode.states.map(s => s.value)
  @@ -1230,10 +1232,10 @@ Gateway.prototype.discoverClimates = function (node) {
  config.mode_map = {}
  config.setpoint_topic = {}
  - config.values = [mode.id, temperature.id]
  + config.values = [modeId, temperatureId]
  - config.discovery_payload.mode_state_topic = mode.id
  - config.discovery_payload.current_temperature_topic = temperature.id
  + config.discovery_payload.mode_state_topic = modeId
  + config.discovery_payload.current_temperature_topic = temperatureId
  // for all available modes update the modes map and setpoint topics
  for (const m of availableModes) {
  @@ -1241,14 +1243,15 @@ Gateway.prototype.discoverClimates = function (node) {
  config.discovery_payload.modes.push(hassModes[m])
  if (m > 0) {
  // find the mode setpoint, ignore off
  - const setpoint = setpoints.find(v => v.propertyKey === m)
  - if (setpoint) {
  + const setId = setpoints.find(v => v.endsWith('-' + m))
  + if (setId) {
  + const setpoint = node.values[setId]
  if (setpoint.propertyKey === 1) {
  - config.default_setpoint = setpoint.id
  + config.default_setpoint = setId
  }
  - config.values.push(setpoint.id)
  - config.setpoint_topic[m] = setpoint.id
  + config.values.push(setId)
  + config.setpoint_topic[m] = setId
  }
  }
  }
  