Announcement

Collapse
No announcement yet.

Payload Switches Between Sensor and List of Plugins

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

    Payload Switches Between Sensor and List of Plugins

    So I finally got to the point where I see MQTT Topic from a Zigbee sensor. When I saw the contact true message (see attachment) I clicked on the 'a' and it created device 778. I can see how it changes from contact true to contact false depending on the status of the sensor. However, if the status doesn't change for a while it shows me a list of all my plugins (see attachment). Why is that happening and how do I avoid that?

    Also how can I use this in events? When I try to setup an event I can't even see the device. I sounds like chapter 4.1.6 kind of describes how to select between different payloads but I don't see that anywhere. Also how would I convert those Topics into something like on/off? With the regex match pattern?

    Attached Files

    #2
    You are showing the Statistics topics and not the topic of the zigbee sensor. On the Association tab select zigbee2mqtt for the T1 topic filter. After using the Show Associations button only those topics from zigbee2mqtt will be visible. Associate any you like.

    What you have associated now is the last received payload statistic from any source. It is generally not very useful to map into HS. The HS set of topics are refreshed every minute.

    Comment


      #3
      Thanks. However, I don't see any zigbee2mqtt. I only see MQTT. Does that mean my setup is incorrect? One step I bit confused about is changing the configuration.yaml (or something like that). I didn't enter anything for the broker because I use the stick I purchased from you ask the broker. The serial port looked like linux so I changed it to plain COM6.

      Comment


        #4
        Since you are seeing the contact sensor status payload in the "4F-Last Received" row of the Association table it means that zigbee2mqtt has been properly setup. The default configuration.yaml file for zigbee2mqtt is shown below.

        The homeassistant key, when changed to true, will send information about any zigbee device so that mcsMQTT can automatically create HS devices. When false then HS devices are created manually from the mcsMQTT MQTT Page, Asssociation table. For initial testing false is good, but once the operation is understood the automatic is easier.

        The permit_join, when true, allows new zigbee devices be discovered and managed by the CC2531 zigbee coordinator. When false, only the status of previously discovered zigbee devices are updated. After all your zigbee devices have been discovered then change the setting to false. If can be changed back again if you get a new zigbee device later.

        The server key shoud be set to the IP of your HS computer that is running mcsMQTT. If you installed zigbee2mqtt on the same computer then localhost is fine. Otherwise you need to change it

        port is the name given to the CC2531 by the OS. Linux is /dev/... COM... is for Windows.


        Code:
         [TABLE]
        [TR]
        [TD] [/TD]
         			[TD]# Home Assistant integration (MQTT discovery)[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]homeassistant: false[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD] [/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# allow new devices to join[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]permit_join: true[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD] [/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# MQTT settings[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]mqtt:[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# MQTT base topic for zigbee2mqtt MQTT messages[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]base_topic: zigbee2mqtt[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# MQTT server URL[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]server: 'mqtt://localhost'[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# MQTT server authentication, uncomment if required:[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# user: my_user[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# password: my_password[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD] [/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# Serial settings[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]serial:[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]# Location of CC2531 USB sniffer[/TD]
         		[/TR]
        [TR]
        [TD] [/TD]
         			[TD]port: /dev/ttyACM0[/TD]
         		[/TR]
        [/TABLE]
        With mcsMQTT all incoming data is routed through the MQTT Page, Association tab. At the top of the tab are filters to select specific subset of the data. At the bottom is the table with rows containing each topic and payload received. There are also navigation buttons at the top of the table. Any time a filter is changed the "Show Associations" button is used to rebuild the table. The Prev/Next buttons are used to scroll through the table 20 rows at a time.

        The Topic filter consists of two rows of selectors. Top row for topics. Second row for JSON keys in the payload. If a topic has been newly received, such as zigbee2mqtt, then the rebuild button on the top of the topic selectors should be clicked to rebuild the selectors. There is also a Clear button. If you use that the the table will contains all topics which should be fine for you since you have so few.


        After the CC2531 has recognized a zigbee device the zigbee2mqtt\data folder .yaml file and the .db file will contain information about the device. It will give it a name that is the ID of the device. This name will show up on mcsMQTT Association in the T2 position on the filter with the topic being zigbee2mqtt/xxxxx where xxxxx is that ID. If you edit the .yaml file and change the friendly name to "kitchen" then the MQTT message will be zigbee2mqtt/kitchen and this will then be the row that shows up in the Association table.

        One of the JSON keys will be "contact" so there will be a row for topic zigbee2mqtt/kitchen:contact and the payload will be true or false. You will want to associate this to a HS device so HS will be updated as the contact sensor changes state.

        Rather than editing the friendly name in configuration.yaml you can edit the HS Device name after the association. You can also do this even if you changed the friendly name.

        Comment

        Working...
        X