{"id":4687,"date":"2025-06-16T22:54:04","date_gmt":"2025-06-17T03:54:04","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=4687"},"modified":"2025-05-13T20:56:52","modified_gmt":"2025-05-14T01:56:52","slug":"assigning-unique-ids-to-template-helpers","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=4687","title":{"rendered":"Assigning Unique IDs to Template Helpers"},"content":{"rendered":"\n<p>I ran into an odd issue while trying to use a template sensor, home assistant gave me an error that I needed to have a unique id in order to use the sensor. Luckily, this is surprisingly simple to add.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"774\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/12\/screenshot_20241213-22510564173455358316050-1024x774.png\" alt=\"\" class=\"wp-image-4686\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/12\/screenshot_20241213-22510564173455358316050-1024x774.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/12\/screenshot_20241213-22510564173455358316050-300x227.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/12\/screenshot_20241213-22510564173455358316050-768x580.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/12\/screenshot_20241213-22510564173455358316050.png 1080w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>It really is just a one line addition to the yaml for the sensor to add a unique ID. You can also use an <a href=\"https:\/\/www.uuidgenerator.net\/\">online generator to create the ID <\/a>to make sure conflicts are avoided. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">- sensor:<br>\u00a0\u00a0\u00a0 unique_id: asdf<br>\u00a0\u00a0\u00a0 name: a_to_b<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Resources:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/community.home-assistant.io\/t\/how-to-add-unique-id-to-templates\/370922\">Adding a Unique_id to templates<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I ran into an odd issue while trying to use a template sensor, home assistant gave me an error that I needed to have a unique id in order to use the sensor. Luckily, this is surprisingly simple to add. It really is just a one line addition to the yaml for the sensor to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=4687\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Assigning Unique IDs to Template Helpers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4686,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[39,14,49],"class_list":["post-4687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","tag-home-assistant","tag-quick-bites","tag-smart-home"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4687"}],"version-history":[{"count":3,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4687\/revisions"}],"predecessor-version":[{"id":4936,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4687\/revisions\/4936"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/media\/4686"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}