@FragMenthor I got a notification that you posted up a question about how to use these icons now, but I can’t see the question in this thread. Not sure where it’s gone.
You now need this in your configuration…
frontend:
extra_module_url:
- /local/moon-icons.js
…and this saved as www/moon-icons.js
…
const ICONS = {
new_moon: { path: 'm12,1.150499c-5.982,0 -10.85,4.866 -10.85,10.849c0,5.981 4.867,10.85 10.85,10.85c5.981,0 10.85,-4.868 10.85,-10.85c0,-5.983 -4.868,-10.849 -10.85,-10.849z' },
waxing_crescent: { path: 'm12.0005,1.151c-5.981,0 -10.851,4.866 -10.851,10.847c0,5.983 4.869,10.851 10.851,10.851c5.98,0 10.85,-4.867 10.85,-10.851c0,-5.981 -4.869,-10.847 -10.85,-10.847zm0,19.452c-0.306,0 -0.605,-0.018 -0.903,-0.048c3.042,-1.646 5.113,-4.854 5.113,-8.558c0,-3.699 -2.071,-6.91 -5.111,-8.555c0.296,-0.032 0.596,-0.049 0.901,-0.049c4.745,0 8.604,3.861 8.604,8.604c0,4.749 -3.858,8.606 -8.604,8.606z' },
first_quarter: { path: 'm12.000999,1.1505c-5.983,0 -10.85,4.868 -10.85,10.849c0,5.982 4.867,10.85 10.85,10.85c5.981,0 10.848,-4.867 10.848,-10.85c0,-5.981 -4.867,-10.849 -10.848,-10.849zm0,19.454l0,-17.21c4.745,0 8.604,3.86 8.604,8.604c0,4.748 -3.859,8.606 -8.604,8.606z' },
waxing_gibbous: { path: 'm12.000499,1.151c-5.983,0 -10.85,4.865 -10.85,10.847c0,5.983 4.867,10.851 10.85,10.851c5.981,0 10.849,-4.867 10.849,-10.851c0,-5.982 -4.868,-10.847 -10.849,-10.847zm0.614,19.423c-3.054,-1.641 -5.132,-4.864 -5.132,-8.576c0,-3.707 2.078,-6.931 5.132,-8.571c4.459,0.316 7.991,4.036 7.991,8.571c0,4.538 -3.531,8.255 -7.991,8.576z' },
full_moon: { path: 'm22.8485,11.999499c0,-5.982 -4.868,-10.849 -10.849,-10.849c-5.983,0 -10.848,4.866 -10.848,10.849c0,5.981 4.865,10.85 10.848,10.85c5.981,0 10.849,-4.868 10.849,-10.85zm-10.849,8.606c-4.744,0 -8.605,-3.859 -8.605,-8.605c0,-4.745 3.861,-8.604 8.605,-8.604c4.745,0 8.604,3.859 8.604,8.604c0.001,4.745 -3.859,8.605 -8.604,8.605z' },
waning_gibbous: { path: 'm12.000499,1.1515c-5.981,0 -10.85,4.866 -10.85,10.848c0,5.981 4.868,10.849 10.85,10.849c5.981,0 10.849,-4.868 10.849,-10.849c0,-5.982 -4.868,-10.848 -10.849,-10.848zm-0.612,19.421c-4.46,-0.317 -7.993,-4.037 -7.993,-8.574c0,-4.538 3.532,-8.256 7.991,-8.574c3.054,1.641 5.132,4.863 5.132,8.574c0,3.71 -2.081,6.935 -5.13,8.574z' },
third_quarter: { path: 'm12.001,1.151c-5.984,0 -10.85,4.867 -10.85,10.85c0,5.981 4.865,10.848 10.85,10.848c5.981,0 10.848,-4.867 10.848,-10.848c0,-5.983 -4.867,-10.85 -10.848,-10.85zm0,19.453c-4.746,0 -8.605,-3.858 -8.605,-8.604s3.859,-8.605 8.605,-8.605l0,17.209z' },
waning_crescent: { path: 'm12.0005,22.848501c5.98,0 10.85,-4.867 10.85,-10.848c0,-5.984 -4.869,-10.849 -10.85,-10.849c-5.984,0 -10.851,4.865 -10.851,10.849c0.001,5.981 4.867,10.848 10.851,10.848zm0,-19.453c0.304,0 0.604,0.015 0.902,0.048c-3.039,1.644 -5.113,4.855 -5.113,8.557c0,3.7 2.069,6.912 5.111,8.556c-0.296,0.031 -0.596,0.048 -0.9,0.048c-4.746,0 -8.605,-3.857 -8.605,-8.604s3.859,-8.605 8.605,-8.605z' },
}
async function getIcon(name) {
return ICONS[name];
}
window.customIconsets = window.customIconsets || {};
window.customIconsets["moon"] = getIcon;
They’re then available with the moon:
prefix. I have this template sensor to use them:
- platform: template
sensors:
moon_phase:
friendly_name: Moon
value_template: >
{{ states.sensor.moon.state[0] | upper }}{{ states.sensor.moon.state[1:] | replace('_', ' ') }}
icon_template: >
moon:{{ states.sensor.moon.state }}