Virtual Devices Made Up of Multiple Real Devices?


(Ben) #1

I’m curious if anyone has run across a way to do this.

I’d like to create a virtual device that subscribes to various other devices to provide one seamless device for SmartApps to use. One example I can think of is a virtual thermostat. This virtual thermostat would provide all the normal thermostat capabilities (humidity, temperature, set points, etc), but behind the scenes it would be grouping my Nest Thermostat, my separate relay for the whole house humidifier, the switch for my dehumidifier, bathroom fans, and the portable heater in my guest bedroom. In a perfect world, all these devices would be controlled by my thermostat, so I’d like to present that interface to SmartApps. The logic within this virtual thermostat would determine when it would use which device to satisfy the requested change. If I requested to lower the humidity, it could choose to use the bathroom fans to vent the extra humidity if the outside temp is close to the inside temp or use the dehumidifier if it’s very cold outside to save energy.

Is it possible to subscribe to capabilities of other devices from within a device type somehow?


(Todd Wackford) #2

@bbfelts,

Yes you can subscribe to events from other devices. Device file are essentially applications themselves. But, they typically just act as the front end for a particular device marshaling the data to and from that device. In looking at what you’re describing though, I think an App is a better fit for what you you’re trying to do. The app is better suited to be the logical wiring between devices. It has an interface logic that is more robust and you can schedule things better.

Think of the “Hello Home” application. It is an interface to many devices and their events.

HTH,
Twack


(Ben) #3

@twack,

I see your point about apps being better for “wiring” devices together and scheduling.

Given that, do you know of a way to expose capabilities within a SmartApps? Or having SmartApps that call SmartApps somehow?

I’m envisioning a bunch of single device types with a “virtual device” SmartApp subscribing to them, and then SmartApps that can use the capabilities of the “virtual device” SmartApp.


(Todd Wackford) #4

@bbfelts,

Don’t the “Hello Home” apps already do exactly what you’re saying.

Twack


(Ben) #5

@twack,

Yes, they do. I didn’t see documentation as to how to do this and can’t find the “Hello Home” apps code published anywhere. Did I something?