Problem with MQTT Discovery climate nodes getting MQTT payloads, works with YAML

I am hoping someone can help me with this one, as it is in incredbily frustrating.

I am working on “integrating” an RV control system into HA. It currenrtly uses a read-only instance of OPenHab as an IP<->Canbus bridge. The CANbus is proprietary, unfortunately.

I am using Node Red to connect to the OpenHab instance an enumerate all the nodes and channels. I am able to pull the info, message it as necessary, and insert them into HA via MQTT discovery - once created, HA subscribes to the correct MQTT topics, and the entities all work as expected.

The discovery topic being used is
homeassistant/climate/hvac_0000000DA7271001/climate/config

Except the climate entity type. When the climate entity is created, HA does not connect the MQTT topics to the appropriate variables in the config. An example of this is the state_topic:

state_topic:  smarthome/items/idsmyrv_hvac_thing_0000000DA7271001_online/state 
json_attributes_topic: homeassistant/binary_sensor/hvac_0000000DA7271001/online/attributes 
availability:
    topic: smarthome/things/idsmyrv:hvac-thing:0000000DA7271001/status
    payload_available: online
    payload_not_available: offline

When the device is created via MQTT Discovery, HA will subscribe to the topic smarthome/items/idsmyrv_hvac_thing_0000000DA7271001_online/state , as indicated in the MQTT Info for the device. Even though it is acknowledging that it is receiving the payload “online”, it is not updating the state of the entity:
image

In Developer tools, the same is seen:

If I take the exact same code, and add it to a YAML file, it works exactly as it should. I have literally copied and pasted the output of the script writing to the /config topic to the YAML file, and it works as expected.

Here is the JSON being sent to the /config topic:

{
	"name": "OneControl Main Climate Zone",
	"send_if_off": true,
	"unique_id": "hvac_0000000DA7271001",
	"availability_topic": "smarthome/things/idsmyrv:hvac-thing:0000000DA7271001/status",
	"payload_available": "online",
	"payload_not_available": "offline",
	"current_temperature_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_inside_temperature/state",
	"fan_mode_command_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_fan_mode/set",
	"fan_mode_state_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_fan_mode/state",
	"fan_modes": ["auto", "high", "low"],
	"mode_command_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_hvac_mode/set",
	"mode_state_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_hvac_mode/state",
	"modes": ["heat", "cool", "off"],
	"min_temp": 45,
	"max_temp": 100,
	"precision": 1,
	"retain": true,
	"temperature_high_command_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_high_temperature/set",
	"temperature_high_state_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_high_temperature/state",
	"temperature_low_command_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_low_temperature/set",
	"temperature_low_state_topic": "smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_low_temperature/state",
	"temp_step": 1,
	"device": {
		"manufacturer": "Lippert Components",
		"via_device": "OneControl Gateway",
		"identifiers": "hvac_0000000DA7271001",
		"name": "Main Climate Zone",
		"model": "OneControl: hvac_0000000DA7271001",
		"sw_version": "1.0"
	}
}

Here is the YAML being written to the YAML file for manual creation:

name: OneControl Main Climate Zone
send_if_off: true
unique_id: hvac_0000000DA7271001
availability_topic: 'smarthome/things/idsmyrv:hvac-thing:0000000DA7271001/status'
payload_available: online
payload_not_available: offline
current_temperature_topic: smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_inside_temperature/state
fan_mode_command_topic: smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_fan_mode/set
fan_mode_state_topic: smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_fan_mode/state
fan_modes:
  - auto
  - high
  - low
mode_command_topic: smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_hvac_mode/set
mode_state_topic:   smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_hvac_mode/state
modes:
  - heat
  - cool
  - 'off'
min_temp: 45
max_temp: 100
precision: 1
retain: true
temperature_high_command_topic: smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_high_temperature/set
temperature_high_state_topic:   smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_high_temperature/state
temperature_low_command_topic:  smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_low_temperature/set
temperature_low_state_topic:    smarthome/items/idsmyrv_hvac-thing_0000000DA7271001_low_temperature/state
temp_step: 1
device:
  manufacturer: Lippert Components
  via_device: OneControl Gateway
  identifiers: hvac_0000000DA7271001
  name: Main Climate Zone
  model: 'OneControl: hvac_0000000DA7271001'
  sw_version: '1.

When I used the MQTT Integration to subscribe to the state topic, it does not report the payloads being sent:
image

Even though from outside of HA, I can subscribe to that topic and I see the payloads:
image

I am at my whits end, and creating them as YAML files is VERY problematic (in my instance I could, but each OneControl instance has unique nodeUID’s and channelUID’s).

My platform is Home Assistant Blue, running 2021.11.5

Any help GREATLY appreciated!

1 Like

What is the full config topic name?
I assume you know it must have a specific format:

<discovery_prefix>/<component>/[<node_id>/]<object_id>/config

e.g.
smarthome/climate/idsmyrv_hvac/config for a climate.idsmyrv_hvac entity.

The /config topic is:

homeassistant/climate/hvac_0000000DA7271001/climate/config

The device is being created in HA, it is just not getting any MQTT topic payloads.

Edit: Sorry, I did not include that in the initial post - I have updated it - thanks for catching that!