I found the solution here. Now it’s work just fine on 5V.
Code:
switch:
- platform: restart
name: Restart device
- platform: gpio
name: "Luce"
id: rluce
pin:
number: 32
inverted: true
mode:
output: true
open_drain: True