Device for regulating the passage of energy from an outside space into an inside space, where the device contains a switching layer, where the switching layer comprises one or more compounds of the formula: where: X is equal to S or Se; Z 1 is, independently of one another, a single bond, -CR 3 =CR 3 - or -C≡C-; or two, three, four or five groups selected from the groups -CR 3 =CR 3 - and -C≡C- combined with one another; Z 2 is, independently of one another, a single bond, O, S, C(R 3) 2, -CR 3 =CR 3 - or -C≡C-; or two, three, four or five groups selected from the groups O, S, C(R 3) 2, -CR 3 =CR 3 - and -C≡C- combined with one another; Ar 1 is, independently of one another, an aryl or heteroaryl group having 5 to 30 aromatic ring atoms, which may be substituted by one or more radicals R 4; R 1 is, independently of one another, H, D, F, CN, N(R 5) 2, or an alkyl, alkoxy or thioalkoxy group having 1 to 20 C atoms, which may be substituted by one or more radicals R 5, where one or more CH 2 groups in the alkyl, alkoxy or thioalkoxy groups may be replaced by -R 5 C=CR 5 -, -C=C-, C=O, C=S, -C(=O)O-, -OC(=O)-, Si(R 5) 2, NR 5, -O- or -S-; R 3, R 4 are, independently of one another, H, D, F, Cl, CN, or an alkyl, alkoxy or thioalkoxy group having 1 to 10 C atoms, which may be substituted by one or more radicals R 5, where one or more CH 2 groups in the alkyl, alkoxy or thioalkoxy groups may be replaced by -R 5 C=CR 5 -, -C≡C-, C=O, C=S, -C(=O)O-, -OC(=O)-, Si(R 5) 2, NR 5, -O- or -S-; R 5 is, independently of one another, H, D, F, Cl, CN, N(R 6) 2, an alkyl, alkoxy or thioalkoxy group having 1 to 10 C atoms or an alkenyl or alkynyl group having 2 to 20 C atoms, where the above-mentioned groups may in each case be substituted by one or more radicals R 6 and where one or more CH 2 groups in the above-mentioned groups may be replaced by -R 6 C=CR 6 -, -C≡C-, C=O, C=S, -C(=O)O-, -O(C=O)-, Si(R 6) 2, NR 6, -O- or -S-, or an aryl or heteroaryl group having 5 to 30 aromatic ring atoms, which may in each case be substituted by one or more radicals R 6; R 6 is, independently of one another, H, F or an aliphatic organic radical having 1 to 20 C atoms, in which one or more H atoms may be replaced by F, or an aryl or heteroaryl group having 5 to 20 C atoms, in which one or more H atoms may be replaced by F; and i is, independently of one another, equal to 0, 1, 2, 3, 4 or 5, and where a liquid-crystalline medium comprising one or more different compounds is present in the switching layer besides the compound of the formula. X is equal to S or Se; Z 1 is, independently of one another, a single bond, -CR 3 =CR 3 - or -C≡C-; or two, three, four or five groups selected from the groups -CR 3 =CR 3 - and -C≡C- combined with one another; Z 2 is, independently of one another, a single bond, O, S, C(R 3) 2, -CR 3 =CR 3 - or -C≡C-; or two, three, four or five groups selected from the groups O, S, C(R 3) 2, -CR 3 =CR 3 - and -C≡C- combined with one another; Ar 1 is, independently of one another, an aryl or heteroaryl group having 5 to 30 aromatic ring atoms, which may be substituted by one or more radicals R 4; R 1 is, independently of one another, H, D, F, CN, N(R 5) 2, or an alkyl, alkoxy or thioalkoxy group having 1 to 20 C atoms, which may be substituted by one or more radicals R 5, where one or more CH 2 groups in the alkyl, alkoxy or thioalkoxy groups may be replaced by -R 5 C=CR 5 -, -C=C-, C=O, C=S, -C(=O)O-, -OC(=O)-, Si(R 5) 2, NR 5, -O- or -S-; R 3, R 4 are, independently of one another, H, D, F, Cl, CN, or an alkyl, alkoxy or thioalkoxy group having 1 to 10 C atoms, which may be substituted by one or more radicals R 5, where one or more CH 2 groups in the alkyl, alkoxy or thioalkoxy groups may be replaced by -R 5 C=CR 5 -, -C≡C-, C=O, C=S, -C(=O)O-, -OC(=O)-, Si(R 5) 2, NR 5, -O- or -S-; R 5 is, independently of one another, H, D, F, Cl, CN, N(R 6) 2, an alkyl, alkoxy or thioalkoxy group having 1 to 10 C atoms or an alkenyl or alkynyl group having 2 to 20 C atoms, where the above-mentioned groups may in each case be substituted by one or more radicals R 6 and where one or more CH 2 groups in the above-mentioned groups may be replaced by -R 6 C=CR 6 -, -C≡C-, C=O, C=S, -C(=O)O-, -O(C=O)-, Si(R 6) 2, NR 6, -O- or -S-, or an aryl or heteroaryl group having 5 to 30 aromatic ring atoms, which may in each case be substituted by one or more radicals R 6; R 6 is, independently of one another, H, F or an aliphatic organic radical having 1 to 20 C atoms, in which one or more H atoms may be replaced by F, or an aryl or heteroaryl group having 5 to 20 C atoms, in which one or more H atoms may be replaced by F; and i is, independently of one another, equal to 0, 1, 2, 3, 4 or 5,