Skip to content

Ability to respond to variable queries over MQTT #5

@bblacey

Description

@bblacey

It would be good to extend the SensorMqtt plugin to include a relatively benign subscription as a "request/response" proof of concept for controlling a Vera remotely over MQTT. Other adventurous souls could expand the set of actions to address more use cases.

Concept

Implement a relatively benign topic action that allows a remote mqtt client to request an update for one or more service variables.

Design

  • If a service variable request includes device id, then the variable will only be returned for that device.
  • If a service variable request does not specify a device, then the variable will be returned to all devices that provide the requested service variable.
  • The service variable requests are encoded as a JSON array allowing the remote client to request one or more variables in a single request

Service Variable Request Topic

/Vera/(SerialNumber)/GETVARIABLE

Payload Example

{
    [
      {"ServiceId: "urn:upnp-org:serviceId:TemperatureSensor1", "Variable": "CurrentTemperature"},
      {"ServiceId: "urn:upnp-org:serviceId:HumiditySensor1", "Variable": "CurrentLevel", "DeviceId": 49}
   ]
}
  • The first element requests the current temperature from all TemperatureSensor devices.
  • The second element requests the current humidity from device 49

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions