Giter VIP home page Giter VIP logo

Comments (7)

thenewwazoo avatar thenewwazoo commented on August 19, 2024

Device:

    {
      href: '/device/37',
      Name: 'Sensor de movimiento',
      FullyQualifiedName: [ 'Garaje', 'Sensor de movimiento' ],
      Parent: { href: '/project' },
      SerialNumber: 52654332,
      ModelNumber: 'PD-OSENS-XX',
      DeviceType: 'RPSOccupancySensor',
      AssociatedArea: { href: '/area/12' },
      OccupancySensors: [ { href: '/occupancysensor/1' } ],
      LinkNodes: [ { href: '/device/37/linknode/29' } ],
      DeviceRules: [ { href: '/devicerule/122' } ],
      AddressedState: 'Addressed'
    }

from homebridge-lutron-caseta-leap.

thenewwazoo avatar thenewwazoo commented on August 19, 2024
{
  "CommuniqueType": "ReadResponse",
  "Header": {
    "MessageBodyType": "OneDeviceDefinition",
    "StatusCode": "200 OK",
    "Url": "/device/37"
  },
  "Body": {
    "Device": {
      "href": "/device/37",
      "Name": "Sensor de movimiento",
      "FullyQualifiedName": [
        "Garaje",
        "Sensor de movimiento"
      ],
      "Parent": {
        "href": "/project"
      },
      "SerialNumber": 52654332,
      "ModelNumber": "PD-OSENS-XX",
      "DeviceType": "RPSOccupancySensor",
      "AssociatedArea": {
        "href": "/area/12"
      },
      "OccupancySensors": [
        {
          "href": "/occupancysensor/1"
        }
      ],
      "LinkNodes": [
        {
          "href": "/device/37/linknode/29"
        }
      ],
      "DeviceRules": [
        {
          "href": "/devicerule/122"
        }
      ],
      "AddressedState": "Addressed"
    }
  }
}

from homebridge-lutron-caseta-leap.

thenewwazoo avatar thenewwazoo commented on August 19, 2024

After subscribe, response is

{
  "CommuniqueType": "SubscribeResponse",
  "Header": {
    "MessageBodyType": "MultipleOccupancyGroupStatus",
    "StatusCode": "200 OK",
    "Url": "/occupancygroup/status"
  },
  "Body": {
    "OccupancyGroupStatuses": [
      {
        "href": "/occupancygroup/1/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/1"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/2/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/2"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/3/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/3"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/4/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/4"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/5/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/5"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/6/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/6"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/7/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/7"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/8/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/8"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/9/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/9"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/10/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/10"
        },
        "OccupancyStatus": "Unknown"
      },
      {
        "href": "/occupancygroup/11/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/11"
        },
        "OccupancyStatus": "Unoccupied"
      }
    ]
  }
}

Status change message looks like

{
  "CommuniqueType": "ReadResponse",
  "Header": {
    "MessageBodyType": "MultipleOccupancyGroupStatus",
    "StatusCode": "200 OK",
    "Url": "/occupancygroup/status",
    "ClientTag": "8b73ef78-8af0-41d8-96f6-16eb18cf43a4"
  },
  "Body": {
    "OccupancyGroupStatuses": [
      {
        "href": "/occupancygroup/11/status",
        "OccupancyGroup": {
          "href": "/occupancygroup/11"
        },
        "OccupancyStatus": "Occupied"
      }
    ]
  }
}

n.b. that the most recent subscription wins, and subsequent subscriptions silently drop the earlier one. also, trying to subscribe to /occupancygroup/X/status fails (even though that's a valid href. wtf lutron?)

from homebridge-lutron-caseta-leap.

thenewwazoo avatar thenewwazoo commented on August 19, 2024

Getting a single occupancygroup returns

{
  "CommuniqueType": "ReadResponse",
  "Header": {
    "MessageBodyType": "OneOccupancyGroupDefinition",
    "StatusCode": "200 OK",
    "Url": "/occupancygroup/11"
  },
  "Body": {
    "OccupancyGroup": {
      "href": "/occupancygroup/11",
      "AssociatedSensors": [
        {
          "OccupancySensor": {
            "href": "/occupancysensor/1"
          }
        }
      ],
      "AssociatedAreas": [
        {
          "Area": {
            "href": "/area/12"
          }
        }
      ],
      "ProgrammingType": "Freeform",
      "ProgrammingModel": {
        "href": "/programmingmodel/169"
      },
      "OccupiedActionSchedule": {
        "ScheduleType": "None"
      },
      "UnoccupiedActionSchedule": {
        "ScheduleType": "None"
      }
    }
  }
}

from homebridge-lutron-caseta-leap.

thenewwazoo avatar thenewwazoo commented on August 19, 2024

Area response is

{
  "CommuniqueType": "ReadResponse",
  "Header": {
    "MessageBodyType": "OneAreaDefinition",
    "StatusCode": "200 OK",
    "Url": "/area/12"
  },
  "Body": {
    "Area": {
      "href": "/area/12",
      "Name": "Garaje",
      "Parent": {
        "href": "/area/1"
      },
      "Category": {
        "Type": "Garage"
      },
      "AssociatedDevices": [
        {
          "href": "/device/36"
        },
        {
          "href": "/device/37"
        }
      ],
      "AssociatedOccupancyGroups": [
        {
          "href": "/occupancygroup/11"
        }
      ],
      "LoadShedding": {
        "href": "/area/12/loadshedding"
      },
      "OccupancySettings": {
        "href": "/area/12/occupancysettings"
      },
      "OccupancySensorSettings": {
        "href": "/area/12/occupancysensorsettings"
      },
      "DaylightingGainSettings": {
        "href": "/area/12/daylightinggainsettings"
      }
    }
  }
}

from homebridge-lutron-caseta-leap.

thenewwazoo avatar thenewwazoo commented on August 19, 2024

The relationship between an occupancy sensor and a group (and an area) is still unknown to me, but it looks like the flow will go

Devices[Device].AssociatedArea -> Area.AssociatedOccupancyGroups <- OccupancyGroupStatuses.OccupancyGroup

I'm still not sure wtf it means for an occupancy group to potentially have multiple differing occupancy status values from different sensors 🤷

Because I apparently can't query for an individual occupancygroup's status, I will have to use the omnibus endpoint to set the initial values for the occupancygroup. Which, by the way, isn't returned with the tag, so waiting for the subscribe response with a direct callback doesn't work. 🤯 So anyway, I'll need to:

  • get all devices
  • if there's a sensor, get its area, and then save its occupancygroup
  • subscribe to occupancygroup updates, and ignore that you don't get a response (I mean, you do, it just doesn't have a tag, so you can't know it's yours... anyway...)
  • request occupancygroup status update and update all sensors w/ the reported values

from homebridge-lutron-caseta-leap.

thenewwazoo avatar thenewwazoo commented on August 19, 2024

Baked in v2.3.0-beta9 pending GA release.

from homebridge-lutron-caseta-leap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.