Skip to content

Mikescops/terraform-provider-homeassistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Provider Home Assistant

User documentation is available on Terraform Registry.

Building provider

Run the following command to build the provider

go build -o terraform-provider-ha

Install the addon

First, build and install the provider.

make install

Go to the examples directory :

terraform init && terraform apply

Requirements

You can setup the provider in TF or use env variables like:

export HA_BEARER_TOKEN=xxxxxx
export HA_HOST_URL=https://<insert_domain_or_ip>/api

Using media players

In order to use "ha_mediaplayer", you need to have media_extractor integration on your Home Assistant instance. Please, follow this tutorial.

How to run tests

You need to have a Home Assistant instance running with a dummy light setup. To do so, add the following configuration to your configuration.yaml file :

# Dummy light
light:
  - platform: template
    lights:
      dummy_light:
        friendly_name: 'Dummy Light'
        turn_on:
        turn_off:
        set_level:

You also need to setup env variables in your terminal :

export HA_BEARER_TOKEN=xxxxxx
export HA_HOST_URL=https://<insert_domain_or_ip>/api

Then run the following command :

make testacc