Announcement

Collapse
No announcement yet.

Making unique HS devices when the payload contains the identification of the device

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

    Making unique HS devices when the payload contains the identification of the device

    This is a continuation of the topic started at https://forums.homeseer.com/forum/de...umidity-sensor


    A new feature was added to mcsMQTT in version 5.0.5.0 at http://mcsSprinklers.com/mcsMQTT_5_0_5_0.zip to address the subject problem. An except from the manual



    Click image for larger version

Name:	Capture.PNG
Views:	151
Size:	160.7 KB
ID:	1356174

    #2
    Good evening Michael; thx for the quick turn around

    here are the results :


    If I enable the feature for "id" (temp/hum sensor) or "unit" (motion, door, etc) independently, it works well.
    However if I try to enable both, it seems to crash the code logic.

    See below the topic/payloads and what I eventually get when enabling both "id" and "unit"

    I wish they had standardized everything under "unit" or "id" but seems like both are used as "unique" identifiers.

    Let me know if there is a way to adapt the code to address this.

    Thx again

    Temp/hum sensor code1 (correct) S 2020-01-23 21:14:35 home/OpenMQTTGateway_SRFB/PilighttoMQTT {"message":{"id":63,"temperature":31.10,"humidity":29.00,"ba ttery":1,"channel":1},"protocol":"tfa","length":"63","repeat s":2,"status":2}
    Temp/hum sensor code2 (incorrect - noise) S 2020-01-23 21:14:35 home/OpenMQTTGateway_SRFB/PilighttoMQTT {"message":{"id":147.0,"temperature":-100.5,"humidity":56.0,"battery":1.0},"protocol":"teknihall", "length":"147","repeats":2,"status":2}
    Motion S 2020-01-23 21:14:36 home/OpenMQTTGateway_SRFB/PilighttoMQTT {"message":{"unit":32858,"battery":1,"state":"opened"},"prot ocol":"iwds07","length":"","repeats":2,"status":2}
    Door S 2020-01-23 21:14:39 home/OpenMQTTGateway_SRFB/PilighttoMQTT {"message":{"unit":8234,"battery":1,"state":"opened"},"proto col":"iwds07","length":"","repeats":2,"status":2}

    Sub: home/OpenMQTTGateway_SRFB/PilighttoMQTT:message:63:8234:147.0:id 63 2020-01-23 21:19:26
    67 Sub: home/OpenMQTTGateway_SRFB/PilighttoMQTT:message:63:8234:147.0:temperature 30.70 2020-01-23 21:19:26
    68 Sub: home/OpenMQTTGateway_SRFB/PilighttoMQTT:message:63:state off 2020-01-23 21:20:28

    Comment


      #3
      Capability added in http://mcsSprinklers.com/mcsMQTT_5_0_6_0.zip. Manual updated to reflect expansion. There is some nuisance because the plugin only keeps track of JSON keys at the Topic level so there can be key permutations showing on Association tab that will never actually show up in the data. Just ignore those than not using. For example given the two payloads for the same Topic
      Code:
      {"id:1,"paper":"empty"}
      {"unit":2,"ink":"full"}
      
      Association tab options after selecting id to be a unique identifier
      :id
      :1:paper
      :1:ink
      :1:unit
      
      After selecting :1:unit to also be unique then
      :id
      :1:paper
      :1:ink
      :unit
      :2:paper
      :2:ink
      
      Just ignore the 1:ink and 2:paper rows as they will never be updated based upon the payload illustrated.

      Comment


        #4
        Tested. working.
        Thank you Michael =)

        Comment

        Working...
        X