In my neighbourhood people burn a lot of firewood. I always deactivate my automatic ventilation when I smell it, but I would like to have something better.
Are there sensors to detect this?
Search for a 'particulate' or 'particle' sensor, which will be characterised by the particle size it detects, e.g. PM10 (10 micron) which can be generated by burning. See here for information on particle sizes.
You could try MQ135 and tune it to detect the smoke. It has a potentiometer that changes its sensitivity to CO2. Move it around and tune it to trigger when certain smoke density is present. you could use it with esp8266 or esp32 as it's cheap, performant and resilient of course if you buy from a reliable source. that's your project there
ESP8266/ESP32 MQ135 Some wires or PCB if you can 5v source / old phone charger and you are good to go you could find ready to use code example