An even easier way to change the icon is to use ui_control.
For example, here is how you could use it to change the Button's icon using any of the three font styles
Each change node sets msg.ui_control:
Note: you can add other options to the object. See https://github.com/node-red/node-red-dashboard/blob/master/config-fields.md)
Flow of the ablve example:
[{"id":"11a56d6d.43391b","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"a361a5ed.6d1ee8","type":"change","z":"11a56d6d.43391b","name":"Material design - book","rules":[{"t":"set","p":"ui_control","pt":"msg","to":"{\"icon\":\"book\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":180,"wires":[["d202bb5c.9042b"]]},{"id":"635e4ee4.2bc768","type":"inject","z":"11a56d6d.43391b","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":180,"wires":[["a361a5ed.6d1ee8"]]},{"id":"d202bb5c.9042b","type":"ui_button","z":"11a56d6d.43391b","name":"","group":"4a875617.84471","order":1,"width":0,"height":0,"passthru":true,"label":"","tooltip":"turn off alarm","color":"{{msg.colour}}","bgcolor":"{{msg.background}}","icon":"wi-wu-clear","payload":"button clicked","payloadType":"str","topic":"topic from button","x":590,"y":240,"wires":[["195778b5.d5fcf7"]]},{"id":"195778b5.d5fcf7","type":"debug","z":"11a56d6d.43391b","name":"after UI","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":740,"y":240,"wires":[]},{"id":"d50364fe.88d528","type":"inject","z":"11a56d6d.43391b","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":240,"wires":[["1cd96231.7cd976"]]},{"id":"749bc785.e7de1","type":"inject","z":"11a56d6d.43391b","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":300,"wires":[["3e431f08.f532c8"]]},{"id":"3e431f08.f532c8","type":"change","z":"11a56d6d.43391b","name":"Weather Icon - clear","rules":[{"t":"set","p":"ui_control","pt":"msg","to":"{\"icon\":\"wi-wu-clear\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":300,"wires":[["d202bb5c.9042b"]]},{"id":"1cd96231.7cd976","type":"change","z":"11a56d6d.43391b","name":"Font Awesome - car","rules":[{"t":"set","p":"ui_control","pt":"msg","to":"{\"icon\":\"fa-car fa-2x\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":240,"wires":[["d202bb5c.9042b"]]},{"id":"e6f8294a.df3f98","type":"comment","z":"11a56d6d.43391b","name":"Examples using ui_control to change BUTTON icon ","info":"","x":310,"y":120,"wires":[]},{"id":"4a875617.84471","type":"ui_group","z":"","name":"button group","tab":"b91fc8ae.6397","order":1,"disp":true,"width":"6","collapse":false},{"id":"b91fc8ae.6397","type":"ui_tab","z":"","name":"button tab","icon":"dashboard","order":1,"disabled":false,"hidden":false}]