How to connect wifi thermostat with a boiler after cable upgrade?
Difficult to guess but here's what it looks like:


The top left post 1, Thick yellow wire is boiler
The top middle post 2, labeled G activates both the fan (thin black wire) and the boiler (thin red wire jumping 1 and 2)
The bottom left post 4, Thick white wire is neutral C 
The bottom right post 5, Thick black wire is hot R


There is no fan delay control so when the thermostat shorts the red and white, it energises both fan and boiler.

With 18/5 wire you'll connect 


White to top center post: Call for heat W 
Red to bottom right post: Hot R
Blue to bottom left post: Neutral C
Green unconnected: fan control G
Yellow unconnected: call for cool Y


Important: The RTH8580WF is made for 24VAC systems.  If the boiler is using line voltage (120V) it will destroy the thermostat.