It shall be shown when the script starts if it is able to connect to your MQTT broker. But I think it does not connect correctly or not at all
But try to run this script from the command prompt. It is just connecting to the broker and sends a simple message to NR (you can then kill it with ctrl+c)
When you do the copy & pasting you seem to lose the important spaces that is required as indents in python. Instead of doing that, download my script and rename it to .py
Let's see if this works better. Try this new script. I have re-arranged it a bit, now running the MQTT and SDS011 data readings in separate so called threads. Download it and run it from the console and check what is written to the console and the debug in NR
In this first test I am interested to know
does it connect and subscribe to the MQTT broker correctly
does it start reading data from the SDS011 device correctly
The script is not yet sending SDS011 data via MQTT, it should just print it once per second to the console
If this works we can do the next steps and process the data you would like to send to NR via MQTT and try that. I guess you are interested in data[2] to data [5], the PM2.5 and PM10 values