Announcement

Collapse
No announcement yet.

Device Auto-creation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Device Auto-creation

    Hi everyone,

    I'm new to mcsMQTT and have a question around auto device creation that I would really appreciate some help with please.

    My Homeseer setup is HS4 on an RPi and I'm using the Sonoff USB gateway with Zigbee2MQTT and mcsMQTT (v.5.26.5.4) with the MQTT broker in mcsMQTT.

    Devices pair and are identified in Zigbee2MQTT and the connection to mcsMQTT works OK as I can see the messages go in and manually create associations.

    I have homeassistant=true configured in ZigbeeMQTT and have the mcsMQTT Inbound (Subscription) Management settings configured as per the manual for Auto Device Creation but when I pair new devices (have tried Aquara mini switch and Ikea on/off switch) they aren't auto-creating.

    As soon as I pair a device in Zigbee2MQTT, over 700 messages then appear in the mcsMQTT Association table but no devices create in Homeseer. I've tried the steps in post 1561857 as the issue looked similar to mine, even downloading the build that Michael kindly made available but unfortunately it didn't work for me.

    The MQTT data going out from Zigbee2MQTT looks to be OK in the Zigbee2MQTT log (code below) but I don't have enough knowledge to understand what's going on when it's received into mcsMQTT - log attached - and why devices won't auto-create in Homeseer.

    Any help really appreciated.

    Thanks,
    Matt.

    Code:
    MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Aqara wireless switch","exposes":[{"access":1,"description":"Remaining battery in %","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":1,"description":"Voltage of the battery in millivolts","name":"voltage","property":"voltage","type":"numeric","unit":"mV"},{"access":1,"description":"Triggered action (e.g. a button click)","name":"action","property":"action","type":"enum","values":["single","double","triple","quadruple","hold","release"]},{"access":1,"description":"Temperature of the device","name":"device_temperature","property":"device_temperature","type":"numeric","unit":"°C"},{"access":1,"description":"Number of power outages (since last pairing)","name":"power_outage_count","property":"power_outage_count","type":"numeric"},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"WXKG11LM","options":[{"access":2,"description":"Calibrates the device_temperature value (absolute offset), takes into effect on next report of device.","name":"device_temperature_calibration","property":"device_temperature_calibration","type":"numeric"},{"access":2,"description":"Set to false to disable the legacy integration (highly recommended), will change structure of the published payload (default true).","name":"legacy","property":"legacy","type":"binary","value_off":false,"value_on":true}],"supports_ota":false,"vendor":"Xiaomi"},"friendly_name":"0x00158d000874759f","ieee_address":"0x00158d000874759f","status":"successful","supported":true},"type":"device_interview"}'
    Attached Files

    #2
    The ability to auto-create depends upon first receiving topics of the form homeassistant/.../config. It is likely they are received since zigbee2mqtt has been configured to send them, but they were not present in the snapshot of the debug log. They are typically sent when zigbee2mqtt starts by zigbee2mqtt and when mcsMQTT starts by the MQTT broker (unless the mcsMQTT broker is being used).

    If you can provide the mcsMQTT debug for when zigbee2mqtt starts up then I should be able to replicate and investigate.

    It would also make it easier to be using the same development version that I am using which is now 6.0.3.1 mcsMQTT Change Log (HS4 & HS3) - HomeSeer Message Board​ . To install it you need to use the Updater Override process that is described in that thread. I will be submitting it to Updater very soon, pending some feedback on the Tasmota Discover integration that was added. You do not need to use this newer version to collect the homeassistant/.../config messages in the debug, but if there is something that needs to be fixed then the fix will be in the most current version.

    Comment


      #3
      Thanks kindly Michael - much appreciated. Updated to 6.0.3.1 and log file attached with zigbee2mqtt restarting - I think this contains everything. Please let me know if not.
      Attached Files

      Comment


        #4
        I looked at the debug. The observations are ...

        1. No messages on a topic starting with homeassistant/
        2. Info message about a device contains the following which implies that homeassistant : true has been setup in the zigbee2mqtt config file. I do not know what the legacy attributes mean, and it was not easy to learn doing a quick google search.
        [code]
        "homeassistant":true,"homeassistant_legacy_entity_attributes ":false,"homeassistant_legacy_triggers":false,
        [code]

        Since there are no topics being delivered on the topic homeassistant/.../config, mcsMQTT has no information to use for auto-creation of HS devices.

        I have noticed a strong HomeAssistant influence in the Tasmota and Zigbee2mqtt communities so they may have gone the route assuming that only HomeAssistant has a need for integration information. I have not been following developments with zigbee2mqtt, but the published documentation seems to indication only homeassistant=true in the zigbee2mqtt setup is needed. I suggest raising the question in the zigbee2mqtt forums as to why homeassisant/.../config topics are not be sent when homeassistant=true has been setup.

        Another thing you can do is use something line MQTT Explorer to confirm that there are no MQTT messages on topic starting with homeassistant.

        3. Another observation is that it appears your are using HS4 mcsMQTT plugin based upon the debug data that is being collected while the post was made in the HS3 forum. Not a problem, but an observation.

        Comment


          #5
          Thanks Michael.

          I hadn't added the line discovery_topic: homeassistant in to the zigbee2mqtt config, so now all coming through with the topic homeassistant and devices being created - thanks for the steer.

          The devices aren't setting up correctly yet and not recognising clicks on buttons, etc, so a lot more reading for me to do when I get some time.

          Apologies for posting in the wrong group. I did notice when replying to you yesterday but was not sure how to move it.

          Thanks,
          Matt.

          Comment


            #6
            You should be able to capture the output from zigbee2mqtt from a terminal window that shows the homeassistant/.../config topics and payload. If I have that then I can replicate and provide guidance.

            zigbee2mqtt uses the convention that the publish topics are the same as the subscribe topics with a /set appended for the publish topics. I forget if it uses on/off or 1/0 for payloads in state control. $$LABEL: or $$VALUE: would be used in mcsMQTT publish payload template for these respectively. JSON formatting in this template will likely also be needed.

            The above is to try to give some ideas, but having the actual data will be the fastest way to resolution.

            Comment


              #7
              Thanks for the help Michael. Have got inbound switches working OK now. Just reading various posts and testing configurations to get my understanding improved... Will then move on to outbound control.

              Really appreciate your help.

              Comment

              Working...
              X