I’ve solved it with these steps:
(hass)$ pip3 install --upgrade pilight
And used the example config from GitHub.
pilight: host: 127.0.0.1 port: 5000
switch: platform: pilight switches: test switch: on_code: protocol: intertechno_old unit: 3 id: 12 'on': 1 off_code: protocol: intertechno_old unit: 3 id: 12 'off': 1