[RELEASE] Device Mirror Plus

Fork of Phuc Tran's Device Mirror App that adds a couple additional devices and extra mirroring capabilities for devices that already existed.

Device Mirror Plus

One master [Switch], [Motion Sensor], [Contact Sensor], [Humidity Sensor], [Temperature Sensor], [Battery Level], [Audio] or [Single Button] to control one or more slaves.

  • Motion Sensor can now mirror - Motion, Temperature, Illuminance, Humidity, Acceleration, Tamper, and Battery
  • Contact Sensor can now mirror - Contact, Temperature, Tamper, and Battery
  • Humidity Sensor can mirror - Humidity, Temperature, and Battery
  • Temperature Sensor can mirror - Temperature, Humidity, and Battery
  • Battery Only can mirror - Battery

Use with modified driver: [RELEASE] Virtual Omni Sensor Plus.


v1.0.0
-Added "Device Mirror Plus" and "Virtual Omni Sensor Plus" to HPM

v202110091200
-Add non-dimmable switch
-Separate dimmable switch from non-dimmable switch

v202110031130
-fix tamper attribute not updating on slave
-fix acceleration attribute not updating on slave
-add threeAxis

v202110022252
-fix humidity attribute not updating on slave

2 Likes

Very cool. Any chance you could also look into mirroring a vibration sensor into a shock sensor? I do that in a bit of a convoluted way at the moment and a direct driver would be great!

Not sure, but I can try. Should be able to create a new sensor and mirror the capabilities. Just need to know what they are.

Will you take a screenshot of your device page to show its current states.

It'll be in the top right corner and will look something like this.
Screenshot 2021-09-30 at 20-17-41 L2 Landing Staircase Motion Sensor

Thanks for having a look at this. The sensor is a smartthings multisensor (acceleration = active/inactive)

Capture5

Hopefully the acceleration attribute can be mirrored to shock status (which has values "clear" and "detected") like so:

Capture6

My apologies. I read your request differently in my head. This app is not converting one capability to another. It is simply mirroring the primary device to the secondary device.

If a motion sensor has the ability to monitor illuminance and temperature. When motion, illuminance, or temperature change on the primary device. It is reflected in the secondary device. Assuming the secondary devices driver has those capabilities.

So if the secondary device is using the virtual omni sensor driver then it would be able to mirror all three of capabilities. But if the secondary device uses the virtual multi sensor it would only be able to mirror motion and temperature.

Ok no problem! As I said I can do it currently but in a convoluted way as I'm not at all conversant in groovy, maybe one day....

Sorry this maybe a daft question?

What does this app actually do, Does it mirror the status of another device?

Thanks

Good question. You are correct. It allows one device to mirror the status of another device.
I use it to mirror real devices into virtual devices.

  • The built in mirror app allows only light switches to be mirrored.

  • Phuc Tran's Device Mirror App added onto that by allowing other devices to be mirrored. i.e. Motion sensors, contact sensors, etc... But only the single motion attribute for motion sensors, or the single contact attribute for contact sensors.

  • Device Mirror Plus builds on this by allowing multiple attributes for a single sensor to be mirrored.
    For example: A motion sensor that is also a temperature, humidity, and lux sensor will mirror all of these attributes into a virtual device set with the virtual omni sensor driver.

2 Likes

Does this work in both directions?

Master device --> virtual device
and
Virtual device --> master device

I ask this because my master device labels are very descriptive, so I create virtual devices with easier names for my wife's dashboard, but I'd like them both to control the device and correctly show the status.

@mebejedi

Works in one direction. Master Device ---> Virtual Device

I use this for devices where it makes sense for me to only mirror Master --> Virtual (e.g. motion sensors, contact sensors, temperature/humidity sensors, etc...)

For devices where you may need to have bi-directional control (e.g. light switches, dimmer switches, buttons, etc...), for me it makes more sense to use Groups and Scenes or Button Controller.

For switches what I do is name my group "Virtual Dimmer Switch A". Select a single Master Device (e.g. Real Dimmer Switch A). Then enable "Use group device to indicate if any members are on?". This allows bi-directional control between the master and virtual device.

For buttons that require bi-directional control I use the Button Controller App. Name the new button controller "Virtual Dimmer Switch A Button" and select the button device (e.g. Real Dimmer Switch A). Then chose which button behaviors to use.

  • The "Real Dimmer Switch A" is used in "Virtual Dimmer Switch A" Group for on/off/dimlevel commands.
  • The "Real Dimmer Switch A" is also used in "Virtual Dimmer Switch A Button" Button Controller for pushed/doubletapped/released/held commands.

I don't see this in Bundles or HPM. Any chance this could be picked up as a managed app?

I recently had a need to create a VD to push through Maker API to an external app and this was a perfect solution to it! I have not tried the Omni VD driver but I've no doubt it's also a worthy candidate for eased sharing!

@jshimota
This is now added to the HPM repositories.json. Next time pull requests are merged "Device Mirror Plus" should be available as an app. And the "Virtual Omni Sensor Plus" as an optional driver that can be installed along with it.

You did a Pull Request against the "retired" repo. I happened to stumble across it and applied it to the "active" repo on HubitatCommunity. :slight_smile:

2 Likes

@csteele
Much appreciated!

Ahh, I see where I got confused. The link to the repositories.json is pointing to the retired repositories.json.

Pull request submitted to update the link.

Hello - is it possible to reverse the sense of the mirroring? That is, to have a Close on the master device trigger an Open on the slave device? THis comes up for me when using things like ST multipurpose sensors as position sensors. For instance I have one mounted on a bar lock on a sliding door. When it's in the position that represents "locked" it reports "Open" , which then looks like an "alarm" or "alert" state in dashboards. I've had to resort to complex rules and virtual devices just to reverse the output.
If this app could have an option to mirror or reverse mirror, it would be incredibly helpful.

1 Like

As a temporary solution - maybe use a virtual switch driver - One of the first I wrote was a 'reversible' switch - [RELEASE] - Virtual Inverse-able Switch . I don't know how it would work in mirror mode but
if you 'Mirror' your first device to a virtual switch that is reversed.
Then mirror your second device off the Virtual switch - it would give you a possible workaround.

1 Like

Thanks for the suggestion. I suppose that's less complex than using rules and two devices but still rather messy.

I am working on putting some kind of reverse options/functionality into the app. If it does not work out the way I want I can throw together a "Reverse Virtual Omni Sensor Plus" driver instead.

2 Likes

Any possibility of adding Fan options? I'm trying to split a Bond Device into separate Fan/Overhead Lights.

Alan

1 Like

@hokfujow @alan564923
Just pushed an updated version of Device Mirror Plus to HPM that should allow:

  • Reversing certain attributes (e.g. open on parent will show as a close on child)
    • Look for the Enable reverse attributes toggle
    • It will appear when there are reversable attributes
  • Added fan as an option
    • Should be able to access the fan speed attribute thru fan, switch, dimmer, and humidity sensor types
  • Virtual Omni Sensor Plus updated with fan attributes
2 Likes