Use Home Assistant to control Enjoyable Warmth heaters and fireplaces

Home Assistant can be installed on a windows or Linux PC, a Raspberry PI, or hosted in the cloud.

Why integrate with Home Assistant?

The smart devices from Enjoyable Warmth can be used in many ways already. They come with an App that can be used on your SmartPhone, tablet, laptop or PC (because the App is a so called Progressive Web App (PWA), which means it runs in the browser, even though it looks like a "normal" app on Android and iOS). Integrations with Google Assistant, Amazon Alexa and Samsung SmartThings are available as well, which means those platforms can be used to operate the Enjoyable Warmth devices as well - including speech instructions. And if that's not enough, you can even use Zapier to orchestrate smart actions with different services.

However, if you already use Home Assistant, or if you are looking at an open source home automation platform, you can use another way to integrate the Enjoyable Warmth devices: use the device's REST interface. That may sound more complex than it is, as you will see in this article. That way, you also don't need cloud services (like Google, Amazon or Samsung) to operate the device(s) - it can all be done locally within your house.

This same technique can be used for many other home automation platforms, including OpenHAB, Domoticz, Fibaro and many others.

What we will do

We will install Home Assistant on a Windows PC. Next, we will add a bio-ethanol fireplace to the Home Assistant so we can switch it on and off through Home Assistant. Adding controls for up/down will be left as an excercise to the readers, just like getting more information from the fireplace (like fuel level).

Note: if you intent to use Home Automation, the windows platform may not be the best choice - you might want to consider running it on a Raspberry PI instead.

Installing Home Assistant

Installing prerequisites

Before you can install Home Assistant, you need to install Python. Python can be downloaded from https://www.python.org/downloads/windows/ and installing it is easy by following the installation wizard.

Also download and install the "Build Tools for Visual Studio", which can be downloaded as part of the "Tools for Visual Studio" from https://visualstudio.microsoft.com/downloads/.

Finally, a prerequisite that was not documented in the Home Assistant installation instructions, is the CORS module. Start a command prompt and execute the following command:

   pip3 install aiohttp_cors

Installing Home Assistant

Installing Home Assistant is documented at https://www.home-assistant.io/docs/installation/windows/. Start a command prompt and execute the following command:

   pip3 install homeassistant

This will start and complete the installation of the Home Assistant software:

Installation of Home Assistant

When the installation is finished, you can start Home Assistant by executing the following statement at the command prompt (see the documentation on how to automatically start Home Assistant as a service upon starting windows):

   py -m homeassistant --open-ui

This will start Home Assistant and open it in a webbrowser. An onboarding process will start:

After you've entered a password and setup location information, you will be redirected to the home screen which starts almost empty (since you haven't added any devices yet):

Adding the fireplace to Home Assistant

Now, we will add the fireplace to Home Assistant. To do this, you will need the fireplace's IP address. This can be easily obtained from the Enjoyable Warmth App by expanding the device's details:

 

The IP address of the fireplace is 192.168.2.143.

Now, navigate to the Home Assistant configuration directory by opening a windows explorer window and typing the following in the address bar:

   %APPDATA%/.homeassistant

You will be directed to the Home Assistant configuration directory:

Next, open the "configuration.yaml" file in a text editor and add the following text:

switch:

  platform: command_line

  switches:

    fireplace:

      command_on: 'C:\Windows\System32\curl -X PUT "http://192.168.2.143/v1/device/on"'

      command_off: 'C:\Windows\System32\curl -X PUT http://192.168.2.143/v1/device/off'

      command_state: 'C:\Windows\System32\curl -X GET http://192.168.2.143/v1/device'

      value_template: '{{ value_json["state"]=="On" }}'

      friendly_name: Fireplace

This will look something like:

Finally, restart Home Assistant, and you will see the results. You can now start and stop the fireplace through Home Assistant:

For an overview of REST commands that can be used, see the product documentation. An example to get the fireplace's status information (which is used above as well) is shown below: