AM43 Cover Device Missing

Ok so I have a problem that I am not able to figure out. I have used the AM43 devices and used this code GitHub - binsentsu/am43-ctrl: Node Util for controlling an AM43 Blinds Drive Cover, either over MQTT or via a HTTP API.

Everything was fine until recent update. Now only the battery and light sensor data is showing up and all the entities are showing unavailable. I am using the MQTT integration and auto discovery.

I am wondering if the cover setup is wrong but I am not sure. I have captured the MQTT messages and all looks fine but HASS will not see the device. here is what is being sent to HASS for the auto discover:

Message 18 received on homeassistant/cover/025c1926a2bd/config at 3:35 PM:
{
    "name": "025c1926a2bd",
    "command_topic": "homeassistant/cover/025c1926a2bd/set",
    "position_topic": "homeassistant/cover/025c1926a2bd/state",
    "set_position_topic": "homeassistant/cover/025c1926a2bd/setposition",
    "position_open": 0,
    "position_closed": 100,
    "availability_topic": "homeassistant/cover/025c1926a2bd/connection",
    "payload_available": "Online",
    "payload_not_available": "Offline",
    "payload_open": "OPEN",
    "payload_close": "CLOSE",
    "payload_stop": "STOP",
    "value_template": "{{value_json['position']}}",
    "unique_id": "am43_025c1926a2bd_cover",
    "device": {
        "identifiers": "am43_025c1926a2bd",
        "name": "025c1926a2bd",
        "manufacturer": "Generic AM43"
    }
}

This does not get recognized by HASS.

However, the following battery sensor does:

Message 30 received on homeassistant/sensor/025c1926a2bd_battery/config at 3:35 PM:
{
    "name": "025c1926a2bd Battery",
    "state_topic": "homeassistant/cover/025c1926a2bd/state",
    "availability_topic": "homeassistant/cover/025c1926a2bd/connection",
    "payload_available": "Online",
    "payload_not_available": "Offline",
    "unique_id": "am43_025c1926a2bd_battery_sensor",
    "device": {
        "identifiers": "am43_025c1926a2bd",
        "name": "025c1926a2bd",
        "manufacturer": "Generic AM43"
    },
    "value_template": "{{value_json['battery']}}",
    "device_class": "battery",
    "unit_of_measurement": "%"
}

does anyone know what may be wrong with the cover one as to why it is failing to see that entity?

I have also disabled the integration and created the config in the configuration.yaml and it did the same thing.

System Info:
Supervisor: supervisor-2021.06.8
core: core-2021.6.5
MQTT: Mosquitto Broker version 6.0.1

Found the answer.

You have to go to your source directory on the PI device hosting the AM43 software and go to the source folder. I have under root user: /home/root/node_modules/am43-ctrl/src/MQTTConnector.js. you need to modify the MQTTConnector.js file.

After line #53 you need to add: state_topic: ${deviceTopic}/state, to the file. Then restart your am43-ctrl and you should be good to go!

Refer to my git hub question: Shade Stopped Working But Battery is fine · Issue #33 · binsentsu/am43-ctrl · GitHub

1 Like