Button-card with if statement

I have read that topic (Fun with custom:button-card not all).

Do I understand it wrong or do you have to hack everything together to get it ( home-assistant ) working?