{"id":718,"date":"2018-07-30T13:00:05","date_gmt":"2018-07-30T20:00:05","guid":{"rendered":"https:\/\/diyfuturism.com\/?p=718"},"modified":"2018-07-30T16:18:34","modified_gmt":"2018-07-30T23:18:34","slug":"automate-dumb-devices-ir-node-red-home-assistant","status":"publish","type":"post","link":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/","title":{"rendered":"Automating Dumb Devices with Node-Red and Home Assistant"},"content":{"rendered":"<p>Here in coastal California, air conditioning is extremely uncommon. So during a recent heat wave, I got desperate and went down to the big box store in search of some relief and came home with a regular old dumb fan. I&#8217;m sure this is the kind of gadget you could probably spend hundreds of dollars on for a &#8216;smart&#8217; version, but I&#8217;m more in favor of adapting existing, cheap technology to do my bidding instead. And since my dumb fan came with an infrared remote control, it&#8217;s quite simple to integrate it into the smart home using Node-Red and Home Assistant.<\/p>\n<p><!--more--><\/p>\n<h1>GETTING MY DUMB FAN AN EDUCATION<\/h1>\n<p>What does it mean to say a gadget is &#8216;smart&#8217;? It needs to be able to report its state somehow, and accept commands to change that state. Any old device with a remote can be controlled via an IR transmitter, but we need a way to observe what it&#8217;s doing as well. For my dumb fan, we can observe the amount of power used to determine it&#8217;s state (off, low, medium, or high).<\/p>\n<h2>HARDWARE<\/h2>\n<p>To accomplish this I&#8217;m using:<\/p>\n<ul>\n<li>A dumb fan with remote<\/li>\n<li><a href=\"https:\/\/amzn.to\/2AzKtTl\" target=\"_blank\" rel=\"noopener\">Broadlink RM Mini<\/a>\u00a0or RM Pro for infrared control<\/li>\n<li><a href=\"https:\/\/amzn.to\/2LNbbfv\" target=\"_blank\" rel=\"noopener\">Sonoff POW<\/a> with <a href=\"https:\/\/github.com\/arendst\/Sonoff-Tasmota\" target=\"_blank\" rel=\"noopener\">Sonoff-Tasmota<\/a> firmware<\/li>\n<\/ul>\n<p>For a DIY alternative to the Broadlink, try <a href=\"https:\/\/github.com\/1technophile\/OpenMQTTGateway\" target=\"_blank\" rel=\"noopener\">OpenMQTTGateway<\/a>, and for a commercial alternative to the Sonoff POW try the <a href=\"https:\/\/amzn.to\/2LO0RDS\">Wemo Insight Switch<\/a>.<\/p>\n<p><script type=\"text\/javascript\">\namzn_assoc_placement = \"adunit0\";\namzn_assoc_search_bar = \"false<span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span>\";\namzn_assoc_tracking_id = \"diyfuturism-20\";\namzn_assoc_ad_mode = \"manual\";\namzn_assoc_ad_type = \"smart\";\namzn_assoc_marketplace = \"amazon\";\namzn_assoc_region = \"US\";\namzn_assoc_title = \"\";\namzn_assoc_asins = \"B078W1JVYK,B06XSD6PD6,B01DBXNYCS,B01GIZ4DHG\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n<h2>INITIAL STEPS<\/h2>\n<p>With the <a href=\"https:\/\/amzn.to\/2LNbbfv\" target=\"_blank\" rel=\"noopener\">Sonoff POW<\/a> flashed with the Tasmota firmware, I need to make some observations. What range of power is used with the fan set at each speed setting?<\/p>\n<div id=\"attachment_721\" style=\"width: 490px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-721\" data-attachment-id=\"721\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/screenshot-from-2018-07-30-113916\/\" data-orig-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-113916.png?fit=480%2C737&amp;ssl=1\" data-orig-size=\"480,737\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Sonoff Pow with Tasmota firmware\" data-image-description=\"&lt;p&gt;Sonoff Pow with Tasmota firmware&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Sonoff Pow with Tasmota firmware&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-113916.png?fit=195%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-113916.png?fit=480%2C737&amp;ssl=1\" loading=\"lazy\" class=\"wp-image-721 size-full\" src=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-113916.png?resize=480%2C737&#038;ssl=1\" alt=\"Sonoff Pow with Tasmota firmware\" width=\"480\" height=\"737\" srcset=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-113916.png?w=480&amp;ssl=1 480w, https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-113916.png?resize=195%2C300&amp;ssl=1 195w\" sizes=\"(max-width: 480px) 100vw, 480px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-721\" class=\"wp-caption-text\">Sonoff POW with Tasmota firmware<\/p><\/div>\n<p>On my fan it came out to:<\/p>\n<ul>\n<li>Low &lt;= 29<\/li>\n<li>Medium &lt;= 34<\/li>\n<li>High &gt; 34<\/li>\n<\/ul>\n<p>Next I captured the IR codes with the <a href=\"https:\/\/amzn.to\/2AzKtTl\" target=\"_blank\" rel=\"noopener\">Broadlink RM<\/a>. My fan just has two commands: toggle power, and toggle speed.<\/p>\n<h2>HOME ASSISTANT ENTITIES<\/h2>\n<p>The first step to getting this thing smart-ified is quantifying it&#8217;s state in Home Assistant. So to get the power reading for the <a href=\"https:\/\/amzn.to\/2LNbbfv\" target=\"_blank\" rel=\"noopener\">Sonoff Pow<\/a> with the Tasmota firmware, my <strong>sensors.yaml<\/strong> configuration is:<\/p>\n<pre>- platform: mqtt\r\n  name: \"Fan Power\"\r\n  state_topic: \"tele\/fan\/SENSOR\"\r\n  value_template: '{{ value_json[\"ENERGY\"][\"Power\"] }}'\r\n  unit_of_measurement: \"W\"<\/pre>\n<p>I then make a template sensor that converts that power reading into the actual fan speed:<\/p>\n<pre>- platform: template\r\n  sensors:\r\n    fan_speed_actual:\r\n      friendly_name: Actual Fan Speed\r\n      value_template: &gt;-\r\n        {% if states.sensor.fan_power.state | float &lt;= 5 %}\r\n          Off\r\n        {% elif states.sensor.fan_power.state | float &lt;= 29 %}\r\n          Low\r\n        {% elif states.sensor.fan_power.state | float &lt;= 34 %}\r\n          Medium\r\n        {% elif states.sensor.fan_power.state | float &gt; 34 %}\r\n          High\r\n        {% else %}\r\n          Unknown\r\n        {% endif %}<\/pre>\n<p>For my IR commands I make a script so I can just have the IR packet in one place. This is in my <strong>scripts.yaml<\/strong> file:<\/p>\n<pre>fan_power_toggle:\r\n  alias: Fan Power Toggle\r\n  sequence:\r\n    - service: switch.broadlink_send_packet_192_168_0_xx\r\n      data:\r\n        packet:\r\n          - \"JgBoAAABJ5MTNxISExITEhMSEhMUEBUQFBEUNRU1FDUVNRQ1FTUUNRU1FDUVEBUQFBEUERQQFRAUERQRFDUVNRQ1FTUUNRU1FDUVNRQRFBAVEBQRFBEUEBUQFBEUNRQ2EzYVNRQ2EjcTAA0F\"\r\nfan_speed_toggle:\r\n  alias: Fan Speed Toggle\r\n  sequence:\r\n    - service: switch.broadlink_send_packet_192_168_0_xx\r\n      data:\r\n        packet:\r\n          - \"JgBoAAABKJMTNhQRExITERQRFBEUERMRFBEUNBU2FDYTNhQ2EzYUNhM2FDYUNRQRFBEUERMRFBEUERQRExITNhQ2EzYUNhM2FDYTNhQ2ExEUERQRFBETEhMRFBEUERM2FDYTNhQ2FDUUAA0F\"<\/pre>\n<p>&nbsp;<\/p>\n<p>I now have all the commands and info needed to automate the fan, we just need a little Node-Red logic to put it together.<\/p>\n<p><script type=\"text\/javascript\">\namzn_assoc_placement = \"adunit0\";\namzn_assoc_tracking_id = \"diyfuturism-20\";\namzn_assoc_ad_mode = \"search\";\namzn_assoc_ad_type = \"smart\";\namzn_assoc_marketplace = \"amazon\";\namzn_assoc_region = \"US\";\namzn_assoc_default_search_phrase = \"floor fan remote\";\namzn_assoc_default_category = \"All\";\namzn_assoc_linkid = \"16d5744f7ea37c73dadd15ced2c0756a\";\namzn_assoc_design = \"in_content\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n<h1>A SMART FAN IS BORN<\/h1>\n<p>Ok now for the fun part, we have all the information we need &#8211; how do we make this into a smart fan?<\/p>\n<p>Home Assistant provides us with an<a href=\"https:\/\/www.home-assistant.io\/components\/fan.mqtt\/\" target=\"_blank\" rel=\"noopener\"> MQTT fan<\/a> template. The MQTT entity kind of acts like a shell that our Node-Red logic can inject it&#8217;s smarts into. Node-Red will read the sensors we created above, and keep the state of the MQTT fan entity in sync with the observed state. When commands are issued, Node-Red will figure out what to do and issue the appropriate IR signal to the actual fan.<\/p>\n<h2>MQTT FAN<\/h2>\n<pre>fan:\r\n  - platform: mqtt\r\n    name: \"Floor Fan\"\r\n    state_topic: \"floor_fan\/on\/state\"\r\n    command_topic: \"floor_fan\/on\/set\"\r\n    speed_state_topic: \"floor_fan\/speed\/state\"\r\n    speed_command_topic: \"floor_fan\/speed\/set\"\r\n    availability_topic: \"tele\/fan\/LWT\"\r\n    payload_available: \"Online\"\r\n    payload_not_available: \"Offline\"\r\n    qos: 0\r\n    payload_on: \"true\"\r\n    payload_off: \"false\"\r\n    payload_low_speed: \"low\"\r\n    payload_medium_speed: \"medium\"\r\n    payload_high_speed: \"high\"\r\n    speeds:\r\n      - low\r\n      - medium\r\n      - high<\/pre>\n<p>The <strong>availability_topic\u00a0<\/strong>is the last-will-and-testament message from the <a href=\"https:\/\/amzn.to\/2LNbbfv\" target=\"_blank\" rel=\"noopener\">Sonoff POW<\/a> &#8211; this tells Home Assistant if the device is online or not. The rest of the fan topics and payloads I made up and you can make them whatever makes sense to you.<\/p>\n<p>Home Assistant and Node-Red will use these topics to send the defined messages back and forth.<\/p>\n<h1>NODE-RED LOGIC<\/h1>\n<p><a href=\"https:\/\/pastebin.com\/WYMAbtjF\" target=\"_blank\" rel=\"noopener\">Click here to import<\/a> this whole flow into Node-Red.<\/p>\n<h2>UPDATE FAN ENTITY WITH ACTUAL FAN STATE<\/h2>\n<p>First thing we need to do is make sure the <strong>fan.floor_fan<\/strong> entity I created above is reflecting reality accurately. If the power is at 0 it should be set to &#8216;Off&#8217;, if it&#8217;s not &#8216;Off&#8217; then I need to know what speed it&#8217;s set at.<\/p>\n<div id=\"attachment_722\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-722\" data-attachment-id=\"722\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/screenshot-from-2018-07-30-120810\/\" data-orig-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?fit=692%2C297&amp;ssl=1\" data-orig-size=\"692,297\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Fan Entity State\" data-image-description=\"&lt;p&gt;Fan Entity State&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Fan Entity State&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?fit=300%2C129&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?fit=692%2C297&amp;ssl=1\" loading=\"lazy\" class=\"size-full wp-image-722\" src=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?resize=692%2C297&#038;ssl=1\" alt=\"Fan Entity State\" width=\"692\" height=\"297\" srcset=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?w=692&amp;ssl=1 692w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?resize=300%2C129&amp;ssl=1 300w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-120810.png?resize=600%2C258&amp;ssl=1 600w\" sizes=\"(max-width: 692px) 100vw, 692px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-722\" class=\"wp-caption-text\">Fan Entity State<\/p><\/div>\n<p>As the <strong>sensor.fan_speed_actual\u00a0<\/strong>changes based on the power reading, Node-Red will send an MQTT message to Home Assistant so that it can update the <strong>fan.floor_fan entity<\/strong>.<\/p>\n<p>This means it doesn&#8217;t matter how the state of the fan is changed (via Home Assistant command, it&#8217;s own remote, MQTT message, or the button on the actual device) the state will be accurately tracked.<\/p>\n<h2>SEND ON\/OFF COMMANDS TO FAN<\/h2>\n<p>If the fan entity is changed to on or off in Home Assistant, we need to send that command to the fan via IR.<\/p>\n<div id=\"attachment_723\" style=\"width: 785px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-723\" data-attachment-id=\"723\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/screenshot-from-2018-07-30-121307\/\" data-orig-file=\"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?fit=775%2C211&amp;ssl=1\" data-orig-size=\"775,211\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2018-07-30 12:13:07\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Send On &#038; Off Commands via Infrared&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?fit=300%2C82&amp;ssl=1\" data-large-file=\"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?fit=775%2C211&amp;ssl=1\" loading=\"lazy\" class=\"size-full wp-image-723\" src=\"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?resize=775%2C211&#038;ssl=1\" alt=\"Send On &amp; Off Commands via Infrared\" width=\"775\" height=\"211\" srcset=\"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?w=775&amp;ssl=1 775w, https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?resize=300%2C82&amp;ssl=1 300w, https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?resize=768%2C209&amp;ssl=1 768w, https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121307.png?resize=600%2C163&amp;ssl=1 600w\" sizes=\"(max-width: 775px) 100vw, 775px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-723\" class=\"wp-caption-text\">Send On &amp; Off Commands via Infrared<\/p><\/div>\n<h2>CHANGING FAN SPEEDS<\/h2>\n<p>This was the only sort of tricky part. My fan has 3 speeds &#8211; low, medium, high &#8211; and only a toggle to control them. This means to switch between speeds you either have to press the toggle once or twice to get to the desired speed.<\/p>\n<p>When a command to change the fan speed is given, the actual speed (<strong>sensor.fan_speed_actual<\/strong>) is compared to the desired speed (the payload on the <strong>floor_fan\/speed\/set<\/strong>\u00a0MQTT topic). I then have a function that determines the appropriate number of toggles.<\/p>\n<div id=\"attachment_724\" style=\"width: 929px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-724\" data-attachment-id=\"724\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/screenshot-from-2018-07-30-121843\/\" data-orig-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?fit=919%2C283&amp;ssl=1\" data-orig-size=\"919,283\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Fan Speed Toggle Logic\" data-image-description=\"&lt;p&gt;Fan Speed Toggle Logic&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Fan Speed Toggle Logic&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?fit=300%2C92&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?fit=854%2C263&amp;ssl=1\" loading=\"lazy\" class=\"size-full wp-image-724\" src=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?resize=854%2C263&#038;ssl=1\" alt=\"Fan Speed Toggle Logic\" width=\"854\" height=\"263\" srcset=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?w=919&amp;ssl=1 919w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?resize=768%2C237&amp;ssl=1 768w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-121843.png?resize=600%2C185&amp;ssl=1 600w\" sizes=\"(max-width: 854px) 100vw, 854px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-724\" class=\"wp-caption-text\">Fan Speed Toggle Logic<\/p><\/div>\n<p>The function node looks like:<\/p>\n<pre>newmsg = {};\r\ncurrentSpeed = msg.payload[\"sensor.fan_speed_actual\"].toLowerCase();\r\ndesiredSpeed = msg.payload[\"floor_fan\/speed\/set\"].toLowerCase();\r\nif (currentSpeed == desiredSpeed) {\r\n  newmsg.payload = 0;\r\n}\r\nelse if (currentSpeed == \"low\" &amp;&amp; desiredSpeed == \"medium\") {\r\n  newmsg.payload = 1;\r\n}\r\nelse if (currentSpeed == \"high\" &amp;&amp; desiredSpeed == \"low\") {\r\n  newmsg.payload = 1;\r\n}\r\nelse if (currentSpeed == \"low\" &amp;&amp; desiredSpeed == \"high\") {\r\n  newmsg.payload = 2;\r\n}\r\nelse if (currentSpeed == \"medium\" &amp;&amp; desiredSpeed == \"high\") {\r\n  newmsg.payload = 1;\r\n}\r\nelse if (currentSpeed == \"medium\" &amp;&amp; desiredSpeed == \"low\") {\r\n  newmsg.payload = 2;\r\n}\r\nelse if (currentSpeed == \"high\" &amp;&amp; desiredSpeed == \"medium\") {\r\n  newmsg.payload = 2;\r\n}\r\nelse {\r\n  newmsg.payload = \"???? Current \" + currentSpeed + \" Desired \" + desiredSpeed;\r\n}\r\nreturn newmsg;<\/pre>\n<p>Pretty simple!<\/p>\n<h1>CONCLUSION<\/h1>\n<div id=\"attachment_728\" style=\"width: 418px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-728\" data-attachment-id=\"728\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/screenshot-from-2018-07-30-125841\/\" data-orig-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125841.png?fit=408%2C418&amp;ssl=1\" data-orig-size=\"408,418\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"No longer so dumb\" data-image-description=\"&lt;p&gt;No longer so dumb&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;No longer so dumb&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125841.png?fit=293%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125841.png?fit=408%2C418&amp;ssl=1\" loading=\"lazy\" class=\"size-full wp-image-728\" src=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125841.png?resize=408%2C418&#038;ssl=1\" alt=\"No longer so dumb\" width=\"408\" height=\"418\" srcset=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125841.png?w=408&amp;ssl=1 408w, https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125841.png?resize=293%2C300&amp;ssl=1 293w\" sizes=\"(max-width: 408px) 100vw, 408px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-728\" class=\"wp-caption-text\">No longer so dumb<\/p><\/div>\n<p>So now my dumb fan can be controlled by my automations in Home Assistant, and it&#8217;s state will be accurately tracked regardless of how people interact with it (whether through the remote or pushing the fan&#8217;s physical buttons). This process can be repeated for pretty much any dumb device that can be controlled through a remote!<\/p>\n<h2><strong>RESOURCES<\/strong><\/h2>\n<ul>\n<li><a href=\"https:\/\/www.home-assistant.io\/components\/fan.mqtt\/\" target=\"_blank\" rel=\"noopener\">Home Assistant MQTT Fan<\/a><\/li>\n<li><a href=\"https:\/\/www.home-assistant.io\/components\/switch.broadlink\/\" target=\"_blank\" rel=\"noopener\">Home Assistant Broadlink RM<\/a> documentation<\/li>\n<li><a href=\"https:\/\/pastebin.com\/WYMAbtjF\" target=\"_blank\" rel=\"noopener\">Pastebin link for Node-Red Flow<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/arendst\/Sonoff-Tasmota\" target=\"_blank\" rel=\"noopener\">Sonoff-Tasmota<\/a> firmware<\/li>\n<\/ul>\n<p><script type=\"text\/javascript\">\namzn_assoc_placement = \"adunit0\";\namzn_assoc_search_bar = \"true\";\namzn_assoc_tracking_id = \"diyfuturism-20\";\namzn_assoc_ad_mode = \"manual\";\namzn_assoc_ad_type = \"smart\";\namzn_assoc_marketplace = \"amazon\";\namzn_assoc_region = \"US\";\namzn_assoc_title = \"\";\namzn_assoc_asins = \"B078W1JVYK,B06XSD6PD6,B01DBXNYCS,B01GIZ4DHG\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"wpm_excerpt clearfix\"><p>Here in coastal California, air conditioning is extremely uncommon. So during a recent heat wave, I got desperate and went down to the big box store &hellip;<\/p>\n<\/div>","protected":false},"author":1,"featured_media":727,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[6,7,11,3],"tags":[229,47,225,109,223,28,222,96,36,224,226,29,42,135,227,228,25,142,221],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Automating Dumb Devices with Node-Red and Home Assistant - DIY Futurism<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Dumb Devices with Node-Red and Home Assistant - DIY Futurism\" \/>\n<meta property=\"og:description\" content=\"Here in coastal California, air conditioning is extremely uncommon. So during a recent heat wave, I got desperate and went down to the big box store &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/\" \/>\n<meta property=\"og:site_name\" content=\"DIY Futurism\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-30T20:00:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-30T23:18:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&#038;ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"939\" \/>\n\t<meta property=\"og:image:height\" content=\"759\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@diyfuturism\" \/>\n<meta name=\"twitter:site\" content=\"@diyfuturism\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"brad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/diyfuturism.com\/#website\",\"url\":\"https:\/\/diyfuturism.com\/\",\"name\":\"DIY Futurism\",\"description\":\"Adventures in Open Source Smart Home Projects\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/diyfuturism.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&ssl=1\",\"width\":939,\"height\":759,\"caption\":\"Automating a Dumb Fan\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#webpage\",\"url\":\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/\",\"name\":\"Automating Dumb Devices with Node-Red and Home Assistant - DIY Futurism\",\"isPartOf\":{\"@id\":\"https:\/\/diyfuturism.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#primaryimage\"},\"datePublished\":\"2018-07-30T20:00:05+00:00\",\"dateModified\":\"2018-07-30T23:18:34+00:00\",\"author\":{\"@id\":\"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c\"},\"breadcrumb\":{\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/diyfuturism.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Dumb Devices with Node-Red and Home Assistant\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c\",\"name\":\"brad\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/diyfuturism.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g\",\"caption\":\"brad\"},\"description\":\"I'm a professional artist who likes to tinker with building things in my spare time.\",\"sameAs\":[\"https:\/\/twitter.com\/@diyfuturism\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating Dumb Devices with Node-Red and Home Assistant - DIY Futurism","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/","og_locale":"en_US","og_type":"article","og_title":"Automating Dumb Devices with Node-Red and Home Assistant - DIY Futurism","og_description":"Here in coastal California, air conditioning is extremely uncommon. So during a recent heat wave, I got desperate and went down to the big box store &hellip;","og_url":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/","og_site_name":"DIY Futurism","article_published_time":"2018-07-30T20:00:05+00:00","article_modified_time":"2018-07-30T23:18:34+00:00","og_image":[{"width":939,"height":759,"url":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&ssl=1","path":"\/var\/www\/html\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png","size":"full","id":727,"alt":"Automating a Dumb Fan","pixels":712701,"type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@diyfuturism","twitter_site":"@diyfuturism","twitter_misc":{"Written by":"brad","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/diyfuturism.com\/#website","url":"https:\/\/diyfuturism.com\/","name":"DIY Futurism","description":"Adventures in Open Source Smart Home Projects","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/diyfuturism.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#primaryimage","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&ssl=1","contentUrl":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&ssl=1","width":939,"height":759,"caption":"Automating a Dumb Fan"},{"@type":"WebPage","@id":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#webpage","url":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/","name":"Automating Dumb Devices with Node-Red and Home Assistant - DIY Futurism","isPartOf":{"@id":"https:\/\/diyfuturism.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#primaryimage"},"datePublished":"2018-07-30T20:00:05+00:00","dateModified":"2018-07-30T23:18:34+00:00","author":{"@id":"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c"},"breadcrumb":{"@id":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/diyfuturism.com\/index.php\/2018\/07\/30\/automate-dumb-devices-ir-node-red-home-assistant\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/diyfuturism.com\/"},{"@type":"ListItem","position":2,"name":"Automating Dumb Devices with Node-Red and Home Assistant"}]},{"@type":"Person","@id":"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c","name":"brad","image":{"@type":"ImageObject","@id":"https:\/\/diyfuturism.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g","caption":"brad"},"description":"I'm a professional artist who likes to tinker with building things in my spare time.","sameAs":["https:\/\/twitter.com\/@diyfuturism"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/07\/Screenshot-from-2018-07-30-125551.png?fit=939%2C759&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9q0Cl-bA","jetpack-related-posts":[{"id":22,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/the-open-source-smart-home-getting-started-with-home-assistant-node-red\/","url_meta":{"origin":718,"position":0},"title":"The Open Source Smart Home: Getting Started with Home Assistant &#038; Node-Red","date":"November 26, 2017","format":false,"excerpt":"Home Assistant is one of the most interesting open source projects I've ever come across. It interfaces with any device, platform, or service you can think of. It can connect all of your devices to make a truly smart home. With a little creativity almost anything is possible with Home\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-26-at-10.43.33-PM.png?fit=1200%2C562&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":492,"url":"https:\/\/diyfuturism.com\/index.php\/2018\/03\/18\/the-cheapest-wifi-smart-switch-flashing-the-sonoff-basic\/","url_meta":{"origin":718,"position":1},"title":"The Cheapest WiFi Smart Switch: Flashing the Sonoff Basic","date":"March 18, 2018","format":false,"excerpt":"Setting up a smart home can be a costly affair, if every device needed an expensive proprietary smart switch you would spend quite a bit of money. With a very tiny amount of soldering and some custom firmware, the\u00a0Sonoff Basic model can be turned into a locally controlled MQTT enabled\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/03\/images.duckduckgo-1.jpg?fit=1000%2C547&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":417,"url":"https:\/\/diyfuturism.com\/index.php\/2018\/01\/31\/setting-up-lets-encrypt-with-node-red-home-assistant\/","url_meta":{"origin":718,"position":2},"title":"Setting Up Let&#8217;s Encrypt with Node-Red &#038; Home Assistant","date":"January 31, 2018","format":false,"excerpt":"Privacy is important in the smart home, and one of the primary reasons to use Home Assistant is because it is totally under control of the user, on your own network. Since writing these posts, setting up encryption with Hass & Node-Red has been the number one question I've been\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"Let's Encrypt","src":"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/01\/images.duckduckgo.png?fit=800%2C400&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":16,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/big-list-of-home-automation-nodes-for-node-red\/","url_meta":{"origin":718,"position":3},"title":"Big List of Useful Home Automation Nodes for Node-Red","date":"November 26, 2017","format":false,"excerpt":"An ongoing list of nodes I have found useful for constructing home automation flows. I have not included device platform nodes, as all state tracking and actions are performed in Home Assistant.","rel":"","context":"In &quot;Node-Red&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":410,"url":"https:\/\/diyfuturism.com\/index.php\/2018\/01\/23\/nodes-home-automation-state-machine-actionflows-dashboard-statistics\/","url_meta":{"origin":718,"position":4},"title":"More Nodes for Home Automation: state-machine, actionflows, dashboard, statistics","date":"January 23, 2018","format":false,"excerpt":"I'm keeping a running list of useful nodes I've found for home automation. Here's a couple of more I came across recently in the Node-Red library. dashboard\u00a0- Create an entirely custom, live dashboard. Amazing! statistics - Some useful statistical functions, based on\u00a0Simple Statistics state-machine\u00a0- Manage a state machine with your\u2026","rel":"","context":"In &quot;Node-Red&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":469,"url":"https:\/\/diyfuturism.com\/index.php\/2018\/03\/13\/location-aware-notification-lights-node-red-ifttt\/","url_meta":{"origin":718,"position":5},"title":"Location Aware Notification Lights with Node-Red and IFTTT","date":"March 13, 2018","format":false,"excerpt":"I am in the habit of going on cooking sprees while listening to music... loudly. I only share one wall with a neighbor here in the loft, and that neighbor is very tolerant. On a Sunday afternoon, with multiple dishes going at a time, my most used smart home feature\u2026","rel":"","context":"In &quot;Home Assistant&quot;","img":{"alt_text":"Connecting Node Red and IFTTT","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2018\/03\/36159691101_b469c9a91f_k.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/718"}],"collection":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/comments?post=718"}],"version-history":[{"count":8,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/718\/revisions"}],"predecessor-version":[{"id":733,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/718\/revisions\/733"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/media\/727"}],"wp:attachment":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/media?parent=718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/categories?post=718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/tags?post=718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}