Right! It is finally done and solved. I used the custom card: ha-floorplan. Much easier than hacking away at javascript, they did all the hard work for me. So was able to do it in a matter of hours last night and a bit this evening.
Final results - colours change based on status. Working in both light & dark mode.

