Automatic material switch by Render Engine
You can easily do it with drivers.


Click right mouse button (RMB) on render engine name and select Copy as a
new driver
Go to your node, for example Value node (Input->Value)
Put cursor over value field and with RMB click Paste driver
RMB click again and this time choose Edit driver
In driver setting switch type from Averaged to Scripted Expression
Change expression to engine/2 (because Cycles is third engine in list,
otherwise you'll have (0,2) output)