http component serves all files and data required for the Home Assistant frontend. You only need to add this to your configuration file if you want to change any of the default settings.
It’s HIGHLY recommended that you set the
api_password, especially if you are planning to expose your installation to the internet.
# Example configuration.yaml entry http: api_password: YOUR_PASSWORD
- api_password (Optional): Protect Home Assistant with a password.
- server_host (Optional): Only listen to incoming requests on specific ip/host (default: accept all)
- server_port (Optional): Let you set a port to use. Defaults to 8123.
- development (Optional): Disable caching and load unvulcanized assets. Useful for Frontend development.
- ssl_certificate (Optional): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
- ssl_key (Optional): Path to your TLS/SSL key to serve Home Assistant over a secure connection.
- cors_allowed_origins (Optional): A list of origin domain names to allow CORS requests from. Enabling this will set the
Access-Control-Allow-Originheader to the Origin header if it is found in the list, and the
Origin, Accept, X-Requested-With, Content-type, X-HA-access. You must provide the exact Origin, i.e.
https://home-assistant.iowill allow requests from
- approved_ips (Optional): A list of approved ips. Then it will be possible to login from given ips without providing a password.
The sample below shows a configuration entry with possible values:
# Example configuration.yaml entry http: api_password: YOUR_PASSWORD server_port: 12345 ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem cors_allowed_origins: - https://google.com - https://home-assistant.io approved_ips: - 127.0.0.1 - 192.168.1.9
http platforms are not real platforms within the meaning of the terminology used around Home Assistant. Home Assistant’s REST API sends and receives messages over HTTP.
To use those kind of sensors or binary sensors in your installation no configuration in Home Assistant is needed. All configuration is done on the devices themselves. This means that you must be able to edit the target URL or endpoint and the payload. The entity will be created after the first message has arrived.
All requests need to be sent to the endpoint of the device and must be POST.
If you want to use Home Assistant to host or serve static files then create a directory called
www under the
.homeassistant configuration path. The static files in
.homeassistant/www/ can be accessed by the following URL