Toyota Matrix Tachometer has gone crazy

I drive a 2007 Toyota Matrix, automatic, 111K. My check engine light is on, but I haven’t had it check because it frequently comes on and off for the evap sensor in the gas cap.

a few months ago all of a sudden the tachometer would move around very irratically. it started the first weekend that it was really cold here, and has since come and gone.
At the times when it’s not working, when i start the car the tachometer will usually hang at zero for a while and then begin to flail around usually bouncing between zero and about 4k. Occasionally it will make it all the way to the highest range of the gauge, 8k, and jump around there for a while. Then without any trend that I’ve noticed all of a sudden it will function correctly.
There are also times when it works fine the entire time from the time I start the engine.

Another disturbing piece is that about a month ago my temperature gauge joined in and will now remain at zero the entire time the tachometer is flailing about and then when simultaneously they will begin working normally.

Thanks for any insights!

I had a similar situation happen with my Ford. When the tach started acting up, a sharp hit on the dash restored proper operation. I figured a bad connection. I fixed it some time later when I pulled the dash cluster to also replace some blown backlight bulbs. Some light corrosion on the connectors on the back of the cluster was easy to polish off. I added some dielectric grease before I reassembled.