Home Assistant Web API Client for Python
from hassapi import Hass
hass = Hass(hassurl="http://IP_ADDRESS:8123/", token="YOUR_HASS_TOKEN")
hass.turn_on("light.bedroom_light")
hass.run_script("good_morning")
# If you want to bypass certificate verification. Default set to True
hass = Hass(hassurl="http://IP_ADDRESS:8123/", token="YOUR_HASS_TOKEN", verify=False)
pip install hassapi