Download icon as SVG
If you paste that into button-card it will look like this.

Rather than fixing it in code we can have a consistent viewbox for all the icons we create or download.
- Create an empty svg
<svg viewBox="0 0 50 50"></svg>
-
Open both icon and empty svg in illustrator
-
Copy over the icon to the empty svg
-
Resize the icon to fit artboard
Now, there’s a lot of paths so let’s make it into one with Compound Path with keyboard shortcut cmd + 8 (ctrl + 8)
So of course that didn’t work as you picked a complex icon 
Undo that and select everything again and go Pathfinder > Exclude

Lets try Compound Path again, we got one path
Save as svg and upload to nano
Now we got an SVG file of the icon in:
- One single path
- In our viewbox
- A lot less code
You don’t have to make it into one shape, we can split it into more paths so you can color and animate separate parts.
In lovelace it looks like this, you can fine tune the size and position.

custom_fields:
icon_cube3d: >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M47.6 8.1v-.4h-.3L19.2 1c-.1 0-.3 0-.4.1L2.6 12.6l-.1.1v29c0 .2.2.5.4.5l28 6.7h.4l16.1-11.6a.76.76 0 0 0 .2-.4V8.1c0 .1 0 0 0 0zm-28.5-6h.4l12.4 3-7 5-5.4-1.3v-.1h-.4L12.3 7l6.8-4.9zm-2.7 29.6h0V37l-.9-.2-.2.8 1 .2v6.8L3.5 41.4V28.1l12.9 3.1v.5zm0-14.4h0v12.9L11 28.8h.4v-1.3h-.8v1.2L3.5 27V13.7l7.2 1.7v.3h.8v-.1l5 1.2v.5zm-5-2.7v-.1H11l-6.8-1.6 6.8-5h.4l7.3 1.7v.4h.8v-.2l4.3 1-4.3 3.1h-.8v.6l-1.9 1.4-5.4-1.3zm7.2 1.7l-.4-.1.2-.2.2.3zM30.4 35h0v12.9l-12.9-3.1V31.9l.3-.2-.1-.1 12.7 3v.4zm0-1.5L19 30.8l.1-.1.5.1.2-.8-.3-.1v-.3h-.8v.4l-.4.3.3.4-1.1-.3V17.5l.3-.2-.1-.1 1 .2v.4h.8v-.2l7.6 1.8 3.3.8v13.3zm.7-14.5l-.3.2L19 16.4l.1-.1.5.1.2-.8-.6-.2-.1.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