<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_mqtt_to_message(self, topic, payload, qos):
 """Parse a MQTT topic and payload. Return a mysensors command string. """

        topic_levels = topic.split('/')
        topic_levels = not_prefix = topic_levels[-5:]
        prefix_end_idx = topic.find('/'.join(not_prefix)) - 1
        prefix = topic[:prefix_end_idx]
        if prefix != self._in_prefix:
            return None
        if qos and qos > 0:
            ack = '1'
        else:
            ack = '0'
        topic_levels[3] = ack
        topic_levels.append(str(payload))
        return ';'.join(topic_levels)