Skip to content

Mikescops/terraform-provider-homeassistant

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
ha
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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