Sync 2 devices with rules API

Whoooo, I got it working thanks to a piece of code that @nayelyz posted in a thread (believe it or not) named Mirror behavior in routines running local - SmartApps & Automations - SmartThings Community. I feel kinda stoopid because I did search and didn’t find anything before I posted my original question. anyway, the trick was to use the changes command. this code should definitely be in the JSON example library

here is what I did

{
    "name": "Front door lock to VS front door lock sync",
    "actions": [
        {
            "if": {
                "changes": {
                    "equals": {
                        "left": {
                            "device": {
                                "devices": [
                                    "892d6707-57db-42a1-afdc-67cd02dc39db"
                                ],
                                "component": "main",
                                "capability": "switch",
                                "attribute": "switch"
                            }
                        },
                        "right": {
                            "string": "on"
                        }
                    }
                },
                "then": [
                    {
                        "command": {
                            "devices": [
                                "3c90112b-adf1-4fb7-91ab-cbffde4de8f7"
                            ],
                            "commands": [
                                {
                                    "component": "main",
                                    "capability": "lock",
                                    "command": "lock"
                                }
                            ]
                        }
                    }
                ],
                "else": [
                    {
                        "if": {
                            "changes": {
                                "equals": {
                                    "left": {
                                        "device": {
                                            "devices": [
                                                "892d6707-57db-42a1-afdc-67cd02dc39db"
                                            ],
                                            "component": "main",
                                            "capability": "switch",
                                            "attribute": "switch"
                                        }
                                    },
                                    "right": {
                                        "string": "off"
                                    }
                                }
                            },
                            "then": [
                                {
                                    "command": {
                                        "devices": [
                                            "3c90112b-adf1-4fb7-91ab-cbffde4de8f7"
                                        ],
                                        "commands": [
                                            {
                                                "component": "main",
                                                "capability": "lock",
                                                "command": "unlock"
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "if": {
                "changes": {
                    "equals": {
                        "left": {
                            "device": {
                                "devices": [
                                    "3c90112b-adf1-4fb7-91ab-cbffde4de8f7"
                                ],
                                "component": "main",
                                "capability": "lock",
                                "attribute": "lock"
                            }
                        },
                        "right": {
                            "string": "locked"
                        }
                    }
                },
                "then": [
                    {
                        "command": {
                            "devices": [
                                "892d6707-57db-42a1-afdc-67cd02dc39db"
                            ],
                            "commands": [
                                {
                                    "component": "main",
                                    "capability": "switch",
                                    "command": "on"
                                }
                            ]
                        }
                    }
                ],
                "else": [
                    {
                        "if": {
                            "changes": {
                                "equals": {
                                    "left": {
                                        "device": {
                                            "devices": [
                                                "3c90112b-adf1-4fb7-91ab-cbffde4de8f7"
                                            ],
                                            "component": "main",
                                            "capability": "lock",
                                            "attribute": "lock"
                                        }
                                    },
                                    "right": {
                                        "string": "unlocked"
                                    }
                                }
                            },
                            "then": [
                                {
                                    "command": {
                                        "devices": [
                                            "892d6707-57db-42a1-afdc-67cd02dc39db"
                                        ],
                                        "commands": [
                                            {
                                                "component": "main",
                                                "capability": "switch",
                                                "command": "off"
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
}

its all so simple…when you know how