{"id":2157,"date":"2021-12-10T13:09:33","date_gmt":"2021-12-10T21:09:33","guid":{"rendered":"https:\/\/partofthething.com\/thoughts\/?p=2157"},"modified":"2021-12-10T13:09:34","modified_gmt":"2021-12-10T21:09:34","slug":"controlling-a-fujitsu-heat-pump-air-conditioner-with-home-assistant-over-ir","status":"publish","type":"post","link":"https:\/\/partofthething.com\/thoughts\/controlling-a-fujitsu-heat-pump-air-conditioner-with-home-assistant-over-ir\/","title":{"rendered":"Controlling a Fujitsu heat pump\/air conditioner with Home Assistant over IR"},"content":{"rendered":"\n<p>I have some of those mini-split Fujitsu heat pumps in my house that have infrared (IR) remote controls. This post explains how I set up my smart house to be able to automate the heat and air conditioning with a raspberry pi and Home Assistant. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/partofthething.com\/thoughts\/wp-content\/uploads\/image-23.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/partofthething.com\/thoughts\/wp-content\/uploads\/image-23.png\" alt=\"\" class=\"wp-image-2158\" width=\"315\" height=\"376\" srcset=\"https:\/\/partofthething.com\/thoughts\/wp-content\/uploads\/image-23.png 514w, https:\/\/partofthething.com\/thoughts\/wp-content\/uploads\/image-23-252x300.png 252w\" sizes=\"auto, (max-width: 315px) 100vw, 315px\" \/><\/a><figcaption>The Home Assistant control panel<\/figcaption><\/figure><\/div>\n\n\n\n<!--more-->\n\n\n\n<p>In a past residence, I had done something similar with a portable floor-unit A\/C, and that post really is a prerequisite to this one. See: <a href=\"https:\/\/partofthething.com\/thoughts\/adding-a-ir-send-and-receive-capabilities-to-my-home-assistant-based-smart-home\/\" data-type=\"post\" data-id=\"1010\">Adding IR send and receive capabilities to my home-assistant based smart home<\/a><\/p>\n\n\n\n<p>Given that exact IR LED setup (the receive circuit is not necessary), I had to find the lirc configuration for the air conditioner. This time, <a href=\"https:\/\/github.com\/mattjm\/Fujitsu_IR\">one already existed<\/a>. I loaded up the config from that repo into my <code>\/etc\/lirc\/lirc.config.d\/<\/code> directory and renamed it to <code>fujitsu.conf<\/code> and restarted the <code>lirc<\/code> daemon. <\/p>\n\n\n\n<p>Then I tested it out while pointing the IR led at the wall unit:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">irsend send_once fujitsu_heat_ac heat-high-70F<\/pre>\n\n\n\n<p>&#8220;Beep beep!&#8221; Nice. It totally works. <\/p>\n\n\n\n<p>So then I hopped into Home Assistant configuration and made some input_selects and an input slider to specify the operation mode, fan mode, and target temperature:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input_number:\n  ac_temperature:\n    name: Heatpump Temperature\n    initial: 68\n    min: 64\n    max: 88\n    step: 2\n\ninput_select:                                                                                            \n  heatpump_fan:\n    name: Turn on Fan\n    options:\n     - Auto\n     - Quiet\n     - Low\n     - Medium\n     - High\n    initial: Medium\n    icon: mdi:weather-snowy\n  heatpump_mode:\n    name: Heatpump mode\n    options:\n     - Cool\n     - Heat\n     - Dry\n     - Fan\n    initial: Heat\n    icon: mdi:weather-snowy\n<\/pre>\n\n\n\n<p>Then we need some templated shell commands to package up the values of the input selects\/sliders and send them off to the raspberry pi and then to lirc. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">shell_command:\n  ac_on: ssh pi@pi3 irsend SEND_ONCE fujitsu_heat_ac cool-on                                         \n  ac_off: ssh pi@pi3 irsend SEND_ONCE fujitsu_heat_ac turn-off\n  set_ac_to_slider: 'ssh pi@pi3 irsend SEND_ONCE fujitsu_heat_ac {{states.input_select.heatpump_mode.state|lower}}-{{states.input_select.heatpump_fan.state|lower}}-{{states.input_number.ac_temperature.state|int}}F'\n  set_ac_fan: 'ssh pi@pi3 irsend SEND_ONCE fujitsu_heat_ac fan-{{states.input_select.heatpump_fan.state|lower}}-64F'\n<\/pre>\n\n\n\n<p>And then I just added those new entities to Lovelace using the GUI, as shown at the top of the post. <\/p>\n\n\n\n<p>Finally I just made sure the LED from the raspberry pi was in a place where it had good line of sight with the unit, and that was that!<\/p>\n\n\n\n<p>I&#8217;ll add some automations to turn the temperature up and down at night later on, but so far I&#8217;m pretty happy with this. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have some of those mini-split Fujitsu heat pumps in my house that have infrared (IR) remote controls. This post explains how I set up my smart house to be able to automate the heat and air conditioning with a raspberry pi and Home Assistant.<\/p>\n","protected":false},"author":1,"featured_media":2159,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[75],"tags":[],"class_list":["post-2157","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-automation"],"_links":{"self":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/2157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/comments?post=2157"}],"version-history":[{"count":4,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/2157\/revisions"}],"predecessor-version":[{"id":46668,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/2157\/revisions\/46668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/media\/2159"}],"wp:attachment":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/media?parent=2157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/categories?post=2157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/tags?post=2157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}