Losant MQTT Broker

how do i connect and publish data from ubuntu to losant using MQTT with python?
i was tried using the sample code but it’s not working for us

I don’t see anywhere in your screenshot where you are publishing a message on a custom MQTT topic, which is what would cause the MQTT Trigger to fire, assuming it is configured to listen to the Losant Broker on the topic you published on.

I do see that you are sending a random number as state for the “temperature” attribute on your device. Per your device’s connection log, is it connecting to the Losant broker? Do you see those state reports in your Recent Device States tab?