{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.5",
    "type": "AdaptiveCard",
    "speak": "${automationName}",
    "body": [
        {
            "type": "ColumnSet",
            "spacing": "none",
            "tooltip": "${device.deviceIconTooltip}",
            "columns": [
                {
                    "type": "Column",
                    "width": "stretch",
                    "spacing": "none"
                },
                {
                    "type": "Column",
                    "width": "auto",
                    "spacing": "none",
                    "items": [
                        {
                            "type": "ImageSet",
                            "stacked": true,
                            "clipMode": "top",
                            "clipMargin": "${device.wallpaper.wallpaperMargin}",
                            "clipCornerRadius": "${device.wallpaper.wallpaperCornerRadius}",
                            "spacing": "none",
                            "images": [
                                {
                                    "type": "Image",
                                    "url": "${device.wallpaper.wallpaperUrl}",
                                    "horizontalAlignment": "Center",
                                    "spacing": "none",
                                    "accessibilityView": "raw"
                                },
                                {
                                    "type": "Image",
                                    "url": "${device.wallpaper.deviceFrameUrl}",
                                    "height": "54px",
                                    "horizontalAlignment": "Center",
                                    "spacing": "none",
                                    "accessibilityView": "raw"
                                }
                            ]
                        }
                    ],
                    "selectAction": {
                        "type": "Action.OpenUrl",
                        "title": "${device.deviceIconTooltip}",
                        "url": "${device.deviceIconLaunchUrl}"
                    }
                },
                {
                    "type": "Column",
                    "width": "stretch",
                    "spacing": "none"
                }
            ]
        },
        {
            "type": "Container",
            "minHeight": "1px",
            "spacing": "Small"
        },
        {
            "type": "TextBlock",
            "$when": "${!empty(device.name)}",
            "text": "${device.name}",
            "weight": "Bolder",
            "horizontalAlignment": "Center",
            "spacing": "Default"
        },
        {
            "type": "Container",
            "minHeight": "1px",
            "spacing": "Small"
        },
        {
            "type": "ColumnSet",
            "horizontalAlignment": "Center",
            "spacing": "Default",
            "columns": [
                {
                    "type": "Column",
                    "width": "stretch",
                    "spacing": "none"
                },
                {
                    "type": "Column",
                    "width": "auto",
                    "verticalContentAlignment": "center",
                    "spacing": "none",
                    "$when": "${device.indicators.showConnectivity}",
                    "items": [
                        {
                            "type": "FontIcon",
                            "fontSize": 16,
                            "glyph": "${device.indicators.connectivityIcon}",
                            "color": "${device.indicators.connectivityColor}",
                            "isSubtle": "${device.indicators.connectivityIsSubtle}",
                            "tooltip": "${device.indicators.connectivityLabel}",
                            "label": "${device.indicators.connectivityLabel}",
                            "horizontalAlignment": "center",
                            "spacing": "none"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "12px",
                    "spacing": "none",
                    "$when": "${device.indicators.showBluetooth && device.indicators.showConnectivity}"
                },
                {
                    "type": "Column",
                    "width": "auto",
                    "verticalContentAlignment": "center",
                    "spacing": "none",
                    "$when": "${device.indicators.showBluetooth}",
                    "items": [
                        {
                            "type": "FontIcon",
                            "fontSize": 16,
                            "glyph": "${device.indicators.bluetoothIcon}",
                            "isSubtle": "${device.indicators.bluetoothIsSubtle}",
                            "tooltip": "${device.indicators.bluetoothLabel}",
                            "label": "${device.indicators.bluetoothLabel}",
                            "horizontalAlignment": "center",
                            "spacing": "none"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "12px",
                    "spacing": "none",
                    "$when": "${device.indicators.showBattery && (device.indicators.showConnectivity || device.indicators.showBluetooth)}"
                },
                {
                    "type": "Column",
                    "width": "auto",
                    "verticalContentAlignment": "center",
                    "spacing": "none",
                    "$when": "${device.indicators.showBattery}",
                    "items": [
                        {
                            "type": "FontIcon",
                            "fontSize": 16,
                            "glyph": "${device.indicators.batteryIcon}",
                            "isSubtle": "${device.indicators.bluetoothIsSubtle}",
                            "tooltip": "${device.indicators.batteryLabel}",
                            "label": "${device.indicators.batteryAutomationName}",
                            "horizontalAlignment": "center",
                            "spacing": "none"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "4px",
                    "spacing": "none",
                    "$when": "${device.indicators.showBattery}"
                },
                {
                    "type": "Column",
                    "width": "auto",
                    "verticalContentAlignment": "center",
                    "spacing": "small",
                    "$when": "${device.indicators.showBattery}",
                    "items": [
                        {
                            "type": "Container",
                            "spacing": "none",
                            "tooltip": "${device.indicators.batteryLabel}",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "$when": "${!empty(device.indicators.batteryPercent)}",
                                    "text": "${device.indicators.batteryPercent}",
                                    "size": "small",
                                    "spacing": "none"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "stretch",
                    "spacing": "none"
                }
            ]
        },
        {
            "type": "Container",
            "spacing": "Medium"
        },
        {
            "type": "Container",
            "height": "stretch",
            "spacing": "none",
            "customStyle": "scroll",
            "items": [
                {
                    "type": "Container",
                    "spacing": "none"
                },
                {
                    "type": "Container",
                    "spacing": "default"
                },
                {
                    "type": "Container",
                    "spacing": "small"
                },
                {
                    "type": "Container",
                    "spacing": "small"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "none",
                    "minHeight": "146px",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "12px",
                            "spacing": "none"
                        },
                        {
                            "type": "Column",
                            "width": "Stretch",
                            "spacing": "none",
                            "items": [
                                {
                                    "type": "Container",
                                    "spacing": "small",
                                    "customStyle": "list",
                                    "itemSpacing": "8px",
                                    "cornerRadius": "4px",
                                    "title": "${featuresTitle}",
                                    "items": [
                                        {
                                            "type": "ColumnSet",
                                            "$data": "${features}",
                                            "horizontalAlignment": "center",
                                            "spacing": "medium",
                                            "tooltip": "${tooltip}",
                                            "columns": [
                                                {
                                                    "type": "Column",
                                                    "width": "12px",
                                                    "spacing": "none"
                                                },
                                                {
                                                    "type": "Column",
                                                    "width": "auto",
                                                    "verticalContentAlignment": "Center",
                                                    "spacing": "none",
                                                    "items": [
                                                        {
                                                            "type": "FontIcon",
                                                            "fontsize": 16,
                                                            "glyph": "${glyph}",
                                                            "isBadged": "${isBadged}"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "type": "Column",
                                                    "width": "${if(isBadged, '15px', '16px')}",
                                                    "spacing": "none"
                                                },
                                                {
                                                    "type": "Column",
                                                    "width": "Stretch",
                                                    "verticalContentAlignment": "Center",
                                                    "spacing": "none",
                                                    "items": [
                                                        {
                                                            "type": "TextBlock",
                                                            "text": "${title}",
                                                            "size": "Small",
                                                            "spacing": "none"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "type": "Column",
                                                    "width": "12px",
                                                    "spacing": "none"
                                                }
                                            ],
                                            "selectAction": {
                                                "type": "Action.OpenUrl",
                                                "title": "${automationName}",
                                                "url": "${launchUrl}"
                                            }
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "12px",
                            "spacing": "none"
                        }
                    ]
                },
                {
                    "type": "Container",
                    "spacing": "Small"
                },
                {
                    "type": "Container",
                    "spacing": "Small"
                },
                {
                    "type": "Container",
                    "spacing": "Medium"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "none",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "24px",
                            "spacing": "none"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "center",
                            "spacing": "none",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "${recentActivities.title}",
                                    "weight": "bolder",
                                    "spacing": "none",
                                    "style": "heading"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "Container",
                    "spacing": "Medium"
                },
                {
                    "type": "Container",
                    "spacing": "none",
                    "items": [
                        {
                            "type": "Container",
                            "spacing": "none",
                            "$when": "${count(recentActivities.activities) == 0}",
                            "items": [
                                {
                                    "type": "Container",
                                    "spacing": "Medium"
                                },
                                {
                                    "type": "ColumnSet",
                                    "spacing": "none",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "width": "24px",
                                            "spacing": "none"
                                        },
                                        {
                                            "type": "Column",
                                            "width": "stretch",
                                            "spacing": "none",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "${recentActivities.placeholderText}",
                                                    "size": "Small",
                                                    "weight": "Lighter",
                                                    "color": "Dark",
                                                    "wrap": true,
                                                    "horizontalAlignment": "Left",
                                                    "spacing": "none"
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Column",
                                            "width": "24px",
                                            "spacing": "none"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "Container",
                            "spacing": "none",
                            "$when": "${count(recentActivities.activities) > 0}",
                            "items": [
                                {
                                    "type": "ColumnSet",
                                    "spacing": "none",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "width": "12px",
                                            "spacing": "none"
                                        },
                                        {
                                            "type": "Column",
                                            "width": "Stretch",
                                            "spacing": "none",
                                            "items": [
                                                {
                                                    "type": "Container",
                                                    "spacing": "none",
                                                    "customStyle": "list",
                                                    "cornerRadius": "4px",
                                                    "title": "${recentActivities.title}",
                                                    "items": [
                                                        {
                                                            "type": "ColumnSet",
                                                            "$data": "${recentActivities.activities}",
                                                            "horizontalAlignment": "center",
                                                            "spacing": "medium",
                                                            "tooltip": "${tooltip}",
                                                            "columns": [
                                                                {
                                                                    "type": "Column",
                                                                    "width": "12px",
                                                                    "spacing": "none"
                                                                },
                                                                {
                                                                    "type": "Column",
                                                                    "width": "32px",
                                                                    "verticalContentAlignment": "center",
                                                                    "spacing": "none",
                                                                    "items": [
                                                                        {
                                                                            "type": "Image",
                                                                            "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastwhite\", imageUrlLight, imageUrlDark)}",
                                                                            "width": "32px",
                                                                            "horizontalAlignment": "center",
                                                                            "style": "${if(isPerson, 'person', 'default')}",
                                                                            "spacing": "none"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "Column",
                                                                    "width": "12px",
                                                                    "spacing": "none"
                                                                },
                                                                {
                                                                    "type": "Column",
                                                                    "width": "stretch",
                                                                    "minHeight": "38px",
                                                                    "verticalContentAlignment": "center",
                                                                    "spacing": "none",
                                                                    "items": [
                                                                        {
                                                                            "type": "TextBlock",
                                                                            "$when": "${!empty(title)}",
                                                                            "text": "${title}",
                                                                            "size": "small",
                                                                            "spacing": "none"
                                                                        },
                                                                        {
                                                                            "type": "TextBlock",
                                                                            "$when": "${!empty(description)}",
                                                                            "text": "${description}",
                                                                            "size": "small",
                                                                            "color": "dark",
                                                                            "spacing": "none"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "Column",
                                                                    "width": "12px",
                                                                    "spacing": "none"
                                                                }
                                                            ],
                                                            "selectAction": {
                                                                "type": "Action.OpenUrl",
                                                                "title": "${automationName}",
                                                                "url": "${launchUrl}"
                                                            }
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Column",
                                            "width": "12px",
                                            "spacing": "none"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "Container",
                            "spacing": "none",
                            "minHeight": "12px"
                        }
                    ]
                }
            ]
        }
    ]
}
