...you chose this municipality for commuting?
From Erba, the nearest crossing in the model is Chiasso-Strada, about 14.5 km as the crow flies from the municipal centre. With the current snapshot the crossing weighs around 14 min; on ordinary days the declared historical wait is 5-23 min in the morning and 1-10 min in the evening.
...you worked in Lugano or Mendrisio?
For a job in Ticino, a prudent estimate is around 51 minutes to Mendrisio, 67 minutes to Lugano and 74 minutes to Locarno, including the approach to the crossing and the wait. These are orientation estimates: incidents, school traffic and weather can change the result a lot.
...you wanted to balance tax and rent?
The real game is adding net salary, housing and time. Here you have a local surcharge of 0.7%, indicative rent of EUR 580 and an estimated monthly car cost from EUR 310. Before moving, compare at least three municipalities in the same corridor.