User documentation is available on Terraform Registry.
Run the following command to build the provider
go build -o terraform-provider-ha
First, build and install the provider.
make install
Go to the examples directory :
terraform init && terraform apply
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
In order to use "ha_mediaplayer", you need to have media_extractor
integration on your Home Assistant instance.
Please, follow this tutorial.
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