{"id":2576,"date":"2023-12-28T14:53:29","date_gmt":"2023-12-28T14:53:29","guid":{"rendered":"https:\/\/www.creatingsmarthome.com\/?p=2576"},"modified":"2024-01-29T05:33:55","modified_gmt":"2024-01-29T05:33:55","slug":"home-assistant-maintenance-reminders-using-nfc-tags","status":"publish","type":"post","link":"https:\/\/www.creatingsmarthome.com\/index.php\/2023\/12\/28\/home-assistant-maintenance-reminders-using-nfc-tags\/","title":{"rendered":"Home Assistant: Maintenance reminders using NFC tags"},"content":{"rendered":"\n<p>There are places where NFC tags can be very useful and one of those is possibly a cleanup reminder! I have Mitsubishi Heat pump which filters should be vacuumed once a month as recommended by the manufacturer. The problem here is, I never ever remember when was the last time I actually did it! So, how about Home Assistant and NFC tags to keep track of it? Let&#8217;s think of a following sequence: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Vacuum the filters<\/li>\n\n\n\n<li>Tap phone next to the heat pump NFC tag to reset cleanup timer<\/li>\n\n\n\n<li>Get notified when a month has passed since last cleanup<\/li>\n<\/ol>\n\n\n\n<p>Quite useful right? Of course you could create automation to manually click an entity on Home Assistant using app or web browser, but I think a <a href=\"https:\/\/www.amazon.de\/Sticker-Compatible-Commands-Homekit-Smartphone-White\/dp\/B06XH2R5ZP?&amp;_encoding=UTF8&amp;tag=creatingsmart-21&amp;linkCode=ur2&amp;linkId=15a989ef1cc6f4f6d617d1a01708d07d&amp;camp=1638&amp;creative=6742\" data-type=\"link\" data-id=\"https:\/\/www.amazon.de\/Sticker-Compatible-Commands-Homekit-Smartphone-White\/dp\/B06XH2R5ZP?&amp;_encoding=UTF8&amp;tag=creatingsmart-21&amp;linkCode=ur2&amp;linkId=15a989ef1cc6f4f6d617d1a01708d07d&amp;camp=1638&amp;creative=6742\" target=\"_blank\" rel=\"noreferrer noopener\">NFC sticker<\/a> works here quite well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating NFC tag<\/h2>\n\n\n\n<p>NFC tags can be programmed just by using Home Assistant Companion App (<a href=\"https:\/\/apps.apple.com\/us\/app\/home-assistant\/id1099568401\" data-type=\"link\" data-id=\"https:\/\/apps.apple.com\/us\/app\/home-assistant\/id1099568401\" target=\"_blank\" rel=\"noreferrer noopener\">iOS<\/a> or <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=io.homeassistant.companion.android\" data-type=\"link\" data-id=\"https:\/\/play.google.com\/store\/apps\/details?id=io.homeassistant.companion.android\" target=\"_blank\" rel=\"noreferrer noopener\">Android<\/a>) and <a href=\"https:\/\/www.amazon.de\/Sticker-Compatible-Commands-Homekit-Smartphone-White\/dp\/B06XH2R5ZP?&amp;_encoding=UTF8&amp;tag=creatingsmart-21&amp;linkCode=ur2&amp;linkId=15a989ef1cc6f4f6d617d1a01708d07d&amp;camp=1638&amp;creative=6742\" data-type=\"link\" data-id=\"https:\/\/www.amazon.de\/Sticker-Compatible-Commands-Homekit-Smartphone-White\/dp\/B06XH2R5ZP?&amp;_encoding=UTF8&amp;tag=creatingsmart-21&amp;linkCode=ur2&amp;linkId=15a989ef1cc6f4f6d617d1a01708d07d&amp;camp=1638&amp;creative=6742\" target=\"_blank\" rel=\"noreferrer noopener\">a programmable NFC sticker<\/a>. To write your tag using the companion app can be done by navigating the app to <em>Settings -&gt; Tags -&gt; + Add New -&gt; Fill in the info -&gt; Create and Write<\/em>.<\/p>\n\n\n\n<p>After writing you should get a <strong>TAG ID<\/strong> that can then be used in an automation. So store the ID in a text file for a while and then paste it to the automation later. <\/p>\n\n\n\n<p>Now just stick the NFC sticker on the side of selected device.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"270\" height=\"585\" data-id=\"2595\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_115830_Home-Assistant.jpg\" alt=\"\" class=\"wp-image-2595\" srcset=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_115830_Home-Assistant.jpg 270w, https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_115830_Home-Assistant-138x300.jpg 138w\" sizes=\"auto, (max-width: 270px) 100vw, 270px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"270\" height=\"585\" data-id=\"2597\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_122142_Home-Assistant.jpg\" alt=\"\" class=\"wp-image-2597\" srcset=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_122142_Home-Assistant.jpg 270w, https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_122142_Home-Assistant-138x300.jpg 138w\" sizes=\"auto, (max-width: 270px) 100vw, 270px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"270\" height=\"585\" data-id=\"2596\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_122103_Home-Assistant.jpg\" alt=\"\" class=\"wp-image-2596\" srcset=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_122103_Home-Assistant.jpg 270w, https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/Screenshot_20231228_122103_Home-Assistant-138x300.jpg 138w\" sizes=\"auto, (max-width: 270px) 100vw, 270px\" \/><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Automation<\/h2>\n\n\n\n<p>For this automation we need three items: <strong>input_datetime<\/strong> to keep the date of our &#8216;last cleaned&#8217; status, <strong>template sensor<\/strong> to convert this date time to &#8216;<em>last cleaned<\/em>&#8216; days and finally an <strong>automation<\/strong> to set the last cleaned date into the input_datetime defined previously. <\/p>\n\n\n\n<p><strong>Here&#8217;s my package:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>input_datetime:\n  heat_pump_filter_last_cleaned:\n    name: Heat Pump filter last cleaned\n    has_time: false\n    has_date: true\n\ntemplate:\n  -  sensor:\n      - name: \"Heat Pump filter cleanup in days\"\n        unique_id: heat_pump_filter_clean\n        icon: \"mdi:wrench-clock\"\n        state: &gt;\n          {%- set cycle = (this.attributes.get('clean_cycle_days', 30) | int) -%}\n          {%- set due =  strptime(states('input_datetime.heat_pump_filter_last_cleaned'), '%Y-%m-%d' ) + timedelta(days = cycle) -%}\n          {{ ((as_timestamp(due) - as_timestamp(now())) | int \/60\/1440) | round(0) }}\n        attributes:\n          clean_cycle_days: 30 # Cycle amount in days\n\nautomation:\n  - id: 'maintenance_set_heatpump_filter_last_cleaned'\n    description: \"Maintenance: Reset heat pump filter last cleaned\"\n    trigger:\n    - platform: tag\n      tag_id: f1892138-fe90-442e-8d0b-d1cc356e5d13 # Tag id\n    condition: &#91;]\n    action:\n    - service: input_datetime.set_datetime\n      data:\n        datetime: '{{ now() }}'\n      target:\n        entity_id: input_datetime.heat_pump_filter_last_cleaned\n    mode: single<\/code><\/pre>\n\n\n\n<p>The configurable variable here is the <em>cycle_clean_days<\/em> that contains the clean cycle in days and <em>tag_id<\/em> that is responsible of resetting the cycle when scanned.<\/p>\n\n\n\n<div class=\"wp-block-columns are-vertically-aligned-top is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<p>This automation does not contain the reminder itself, but is trivial to implement when needed. I&#8217;m using this only to show the due time on my maintenance dashboard rather than getting even more push notifications on my phone.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"796\" height=\"270\" src=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-29-at-7.32.05.png\" alt=\"\" class=\"wp-image-2886\" srcset=\"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-29-at-7.32.05.png 796w, https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-29-at-7.32.05-300x102.png 300w, https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-29-at-7.32.05-768x261.png 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/figure>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>There are places where NFC tags can be very useful and one of those is possibly a cleanup reminder! I have Mitsubishi Heat pump which&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2599,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[100],"tags":[105,341,340,7,342,344,111,343],"class_list":["post-2576","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-assistant","tag-automation","tag-filter","tag-heat-pump","tag-home-assistant","tag-maintenance","tag-maintenance-reminder","tag-nfc","tag-reminder","has-post-thumbnail-archive"],"acf":[],"featured_image_src":"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2023\/12\/heatpump_maintenance.png","author_info":{"display_name":"Toni","author_link":"https:\/\/www.creatingsmarthome.com\/index.php\/author\/topsy\/"},"_links":{"self":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/2576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/comments?post=2576"}],"version-history":[{"count":20,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/2576\/revisions"}],"predecessor-version":[{"id":2887,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/2576\/revisions\/2887"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/media\/2599"}],"wp:attachment":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/media?parent=2576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/categories?post=2576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/tags?post=2576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}