Announcement

Collapse
No announcement yet.

Revive a deleted device

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

    Revive a deleted device

    First off thank you for this great PI!. I am a noob to mqtt and zigbee, but I was able to get this installed on windows and start adding devices. Unfortunately I started with an INNR smart plug (SP224), which added fine, but it seemed to also add and not pair a sensor (I saw in the Zigbee2MQTT site that the HA parameters have both in the device parameters (SW and Sensor) and I have HA set to true). So I kept getting interview requests for this device that did not pair. I tried pairing the smart plug again and it did not change this unknown device. The plug function worked without this pairing, but the requests (186 of them) kept coming. So I tried to remove the device. Not knowing what I was doing I started using the "Delete Sub and Refence" key in the edit tab for every line that appeared to be associated with this phantom device in the associations tab. Now the switch does not communicate from the physical device button and from HS pressing a state change gives me the following error:

    zigbee2mqtt:info 2020-07-19 22:26:56: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"entity_not_found","message":{"friendly_name":"0x 68 0ae2fffee413e2"}}'
    zigbee2mqtt:error 2020-07-19 22:26:56: Entity '0x680ae2fffee413e2' is unknown

    The other issue with my ignorant changes is that I have multiple instances of the device:
    Click image for larger version

Name:	Zigbee plug.jpg
Views:	452
Size:	26.2 KB
ID:	1404173
    I only added the buttons to the top instance.

    Is there a way to clean up my mess? Right now the plug shows no communication from the device- power up, reset, etc

    One last question. When I added the buttons (ON/OFF) to the HS device it creates a double publish of the command when I control it from HS, but only sends one when I use the physical button on the plug. Is that normal?

    zigbee2mqtt:info 2020-07-19 21:45:48: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee55867', payload '{"state":"OFF","linkquality":152}'
    zigbee2mqtt:info 2020-07-19 21:45:48: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee55867', payload '{"state":"OFF","linkquality":157}'

    Thanks in advance for any help!

    #2
    If you are just starting then the easiest was to clean up is to delete /data/mcsMQTT/mcsMQTT.db when the plugin is disabled. This will delete all info about MQTT topics.

    A technique I often use when testing is to go to General tab, Inbound Management, and enter # in the text box on the Obsolete topics row. This has the same effect in most circumstances as deleting the database.

    After doing one of the above two then use HS Device Management to delete any mcsMQTT devices that may be left over due to broken linkages.

    i am not quite understanding you description. Is the interview response/request coming from zigbee2mqtt? I don’t recall ever seeing this. What is being repeated over and over and what effect does it have on mcsMQTT?

    When you associate a topic that has on-off controls then you will review the Edit tab of assure the control/status type is Button. The publish topic should be the same as the subscribe topic with a /set suffix. When you press the physical button then only the subscribe topic is communicated. If you use the HS button then the publish topic is sent. Zigbee2mqtt should the update the device and the new status will be sent just as if the physical button is used.

    A few screenshots of the mcsMQTT pages for this device may help with my understanding.

    Comment


      #3
      So I cleaned all the old stuff out and started from scratch. (the # and/or .db removal did not fully clean out everything there was some device info that appears to have come from the Zigbee2MQTT data base that needed to be removed - just re-installed and that got everything out)

      It appears that when I create my buttons on the edit page there is a duplicate "state" line that is created on the association page and that is causing double messages only when HS controls the smart plug. When I manually switch the smart plug on and off it is only one transmission. This is how I set up my buttons (I tried to follow what you suggested in "Start all over" thread
      Click image for larger version

Name:	Zigbee edit pg.jpg
Views:	433
Size:	138.0 KB
ID:	1404356


      And then this is what the association page looks like after the edit page changes:
      Click image for larger version

Name:	Zigbee association list.jpg
Views:	354
Size:	78.6 KB
ID:	1404357

      The second state line apears to produce the double transmission as shown below:
      zigbee2mqtt:info 2020-07-20 15:18:05: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee55867', payload '{"state":"OFF","linkquality":128}'
      zigbee2mqtt:info 2020-07-20 15:18:05: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee55867', payload '{"state":"OFF","linkquality":123}'

      It doesn't seem to make a difference functionally.


      The other unknown device issue might be device or zigbee database related. It seems to only happen with one of the two INNR smart plugs and it now appears more random. When I first added the plug I didn't realize it had popped up but after letting the system sit idle I saw request after request to interview the device and then fail. Today after the reset I paired the plugs again and it popped up again. This time it is more random in requests, but as the requests continue the Z2M system will lock up and I have to restart. I have been monitoring the system and no more requests have happened this afternoon. But it is listed in the Z2M config device list. I guess I need to find a way to edit or remove the item from that database. Very Strange.

      This is the type of activity I see from this unknown device 0x00001c877670f1c0 (when it happens):

      zigbee2mqtt:info 2020-07-20 14:48:35: Successfully configured '0x680ae2fffee413e2'
      zigbee2mqtt:info 2020-07-20 14:50:12: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee413e2', payload '{"state":"ON","linkquality":120}'
      zigbee2mqtt:info 2020-07-20 14:51:06: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee413e2', payload '{"state":"OFF","linkquality":123}'
      zigbee2mqtt:info 2020-07-20 14:54:23: Device '0x00001c877670f1c0' joined
      zigbee2mqtt:info 2020-07-20 14:54:23: Starting interview of '0x00001c877670f1c0'
      zigbee2mqtt:info 2020-07-20 14:54:23: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":{"friendly_name":"0x 00 001c877670f1c0"}}'
      zigbee2mqtt:info 2020-07-20 14:54:23: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_started","meta":{" fr iendly_name":"0x00001c877670f1c0"}}'
      zigbee2mqtt:info 2020-07-20 14:56:38: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee413e2', payload '{"state":"ON","linkquality":123}'
      zigbee2mqtt:info 2020-07-20 14:56:38: MQTT publish: topic 'zigbee2mqtt/0x680ae2fffee413e2', payload '{"state":"ON","linkquality":126}'
      zigbee2mqtt:error 2020-07-20 14:56:42: Failed to interview '0x00001c877670f1c0', device has not successfully been paired



      Thanks Again for all your help!


      Comment


        #4
        Notice your interview request is for '0x00001c877670f1c0. This device looks to be trying to join a zigbee network and likely Z2M does not recognize what it is or some user action is needed to complete the pairing and this action is not happening. It may be to your benefit to locate this device and tend to it. In general question related to the operation of Z2M will get more informed answers on the Z2M forum than on the HS one.

        You have two other devices that have joined. 0x680ae2fffee413e2 and 0x...55867. The 0x...3e2 device published an update on linkquality. I don't know what criteria Z2M uses to publish. Linkquality would seem to change often.

        I do not recognize rows 9 and 15 in your screenshot of the Association tab. If you tried to manually add a topic via the Edit tab, then only the topic can be specified. The colon is used as nomenclature to distinguish JSON payload keys from the topic. Do you know what you did to cause these rows to appear? You indicated "create buttons". Do you mean select the Control/Status type to be Button?

        The process that use is to use the Association tab and "A" checkbox anything I want to be a HS device. With HomeAssistant Discovery some of this is done automatically. Were they created for you of did you take specific action to create HS devices? After devices are created I will click on the Ref button to bring up the Edit tab and review the Control/Status UI and make any other changes such as the templates. While Edit tab has the ability to create Topic/Device associations, I always do it in a more visual manner with the Association tab.

        Comment


          #5
          Notice your interview request is for '0x00001c877670f1c0. This device looks to be trying to join a zigbee network and likely Z2M does not recognize what it is or some user action is needed to complete the pairing and this action is not happening. It may be to your benefit to locate this device and tend to it.
          Yes this seems to be either a INNR Smart plug issue or a Z2M issue. It only did for one of the two plugs and now it has stopped.

          You have two other devices that have joined. 0x680ae2fffee413e2 and 0x...55867. The 0x...3e2 device published an update on linkquality. I don't know what criteria Z2M uses to publish. Linkquality would seem to change often.
          These are the smart plugs, the Aqara Door magnetic door sensors publish link quality as well. This is all new to me so I will take your word for it.

          I do not recognize rows 9 and 15 in your screenshot of the Association tab. If you tried to manually add a topic via the Edit tab, then only the topic can be specified. The colon is used as nomenclature to distinguish JSON payload keys from the topic. Do you know what you did to cause these rows to appear? You indicated "create buttons". Do you mean select the Control/Status type to be Button?
          "Button" was already selected

          These are the rows I suspect are creating the duplicate publish topic. This is what I did to test:

          1) I delete rows 9&15 from PI (check the O box and delete rows)
          2) I removed two lines via the PI edit tab (these were added to create ON/OFF buttons on HS devices)

          Publish Payload Template {"state":"$$LABEL:"}
          HS Device Publish Topic zigbee2mqtt/0x680ae2fffee413e2/set

          3) Refreshed HS Device page and On/Off buttons are gone and device is not available in events pull down to control smart plug
          4) Refreshed PI Edit page and lines 9&15 have not re-appeared.
          5) Only on/off control is on physical button on smart plug
          6) Added lines back to create On/Off buttons

          Publish Payload Template {"state":"$$LABEL:"}
          HS Device Publish Topic zigbee2mqtt/0x680ae2fffee413e2/set

          7) lines 9&15 do not appear in PI.
          8) Turn on/off smart plug from HS device page and lines 9&15 re-appear in PI and duplicate publish topics appear in NPM window



          Were they created for you of did you take specific action to create HS devices?
          The only changes I made to anything in your plugin was the two lines shown above, everything else was automatic.

          Since I don't have any other Zigbee devices that can be controlled through HS, I don't know what normal is.

          Comment


            #6
            What is of interest to me is the message from Z2M with the HomeAssistant topic. The information in this message is what is used to create the HS devices and setup mcsMQTT for the advertised topics. There are various tools that are able to record MQTT traffic. MQTT Explorer and MQTT Lens are two popular ones. mcsMQTT can also do this, but it may exclude HomeAssistant topic. If you could provide the payload for this topic then I can replicate it and see what may be wrong with the auto-creation of this set of devices.

            The HomeAssistant topic should be created each time Z2M starts. It should also be a retained message so the MQTT broker should send it to mcsMQTT each time mcsMQTT starts.

            Comment


              #7
              After reading your last post again I see how the new associations (row 9 & 15) are being added. I need to look into mcsMQTT to see why. The MQTT Broker does send the message back to mcsMQTT for any topic that it publishes, but mcsMQTT should remember that it sent it and not add the row to the association tab. It is not a functional problem, but only a cosmetic one.

              Your pairing/interview/lockup issue is not something I can help with. I have found the zigbee2mqtt forum responsive in the past.

              Comment


                #8
                I am just learning, but it seemed like the new associations were coming from the HS/PI side of things. I just don't know if it was something I added to create the On/Off buttons for the HS device that also created the redundancy. Functionally I didn't/don't see an issue and probably never would have noticed if I hadn't been monitoring the traffic in the npm window.

                The pairing/interview issue seems to have stopped on its own and has not reoccurred in over 24 hours (but I suspected that it was either a device or Z2M issue).

                Here is what I think is the payload information you asked for:

                zigbee2mqtt:info 2020-07-20 14:46:38: Starting interview of '0x680ae2fffee413e2'
                zigbee2mqtt:info 2020-07-20 14:46:38: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":{"friendly_name":"0x 68 0ae2fffee413e2"}}'
                zigbee2mqtt:info 2020-07-20 14:46:38: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_started","meta":{" fr iendly_name":"0x680ae2fffee413e2"}}'
                zigbee2mqtt:info 2020-07-20 14:46:38: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_announced","message":"announce","meta":{" fr iendly_name":"0x680ae2fffee413e2"}}'
                zigbee2mqtt:info 2020-07-20 14:46:39: MQTT publish: topic 'homeassistant/switch/0x680ae2fffee413e2/switch/config', payload '{"payload_off":"OFF","payload_on":"ON","value_template":" {{ value_json.state }}","command_topic":"zigbee2mqtt/0x680ae2fffee413e2/set","state_topic":"zigbee2mqtt/0x680ae2fffee413e2","json_attributes_topic":"zigbee2mqtt/0x680ae2fffee413e2","name":"0x680ae2fffee413e2_switch","uniq ue_id":"0x680ae2fffee413e2_switch_zigbee2mqtt","device":{"id entifiers":["zigbee2mqtt_0x680ae2fffee413e2"],"name":"0x680ae2fffee413e2","sw_version":"Zigbee2mqtt 1.14.1","model":"Smart plug (SP 224)","manufacturer":"Innr"},"availability_topic":"zigbee2mq tt/bridge/state"}'
                zigbee2mqtt:info 2020-07-20 14:46:39: MQTT publish: topic 'homeassistant/sensor/0x680ae2fffee413e2/linkquality/config', payload '{"icon":"mdi:signal","unit_of_measurement":"lqi","value_t em plate":"{{ value_json.linkquality }}","state_topic":"zigbee2mqtt/0x680ae2fffee413e2","json_attributes_topic":"zigbee2mqtt/0x680ae2fffee413e2","name":"0x680ae2fffee413e2_linkquality", "unique_id":"0x680ae2fffee413e2_linkquality_zigbee2mqtt" ,"de vice":{"identifiers":["zigbee2mqtt_0x680ae2fffee413e2"],"name":"0x680ae2fffee413e2","sw_version":"Zigbee2mqtt 1.14.1","model":"Smart plug (SP 224)","manufacturer":"Innr"},"availability_topic":"zigbee2mq tt/bridge/state"}'
                zigbee2mqtt:info 2020-07-20 14:46:40: Successfully interviewed '0x680ae2fffee413e2', device has successfully been paired
                zigbee2mqtt:info 2020-07-20 14:46:40: Device '0x680ae2fffee413e2' is supported, identified as: Innr Smart plug (SP 224)
                zigbee2mqtt:info 2020-07-20 14:46:40: Configuring '0x680ae2fffee413e2'
                zigbee2mqtt:info 2020-07-20 14:46:40: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_successful","meta" :{ "friendly_name":"0x680ae2fffee413e2","model":"SP 224","vendor":"Innr","description":"Smart plug","supported":true}}'
                zigbee2mqtt:info 2020-07-20 14:46:40: Successfully configured '0x680ae2fffee413e2'


                Thanks again for the dongle and the PI!!!

                Comment


                  #9
                  I used your data to try to duplicate the scenario that was described and did not get the extra /set:state rows created on the Association tab. Since these have no operational implications I do not think it is worth the effort to add additional debug.

                  Comment

                  Working...
                  X