Python API


In the package homeassistant.remote a Python API on top of the HTTP API can be found.

The two snippets below shows how to use the homeassistant.remote package:

1
2
3
4
import homeassistant.remote as remote

api = remote.API("host", "password")
living_room = remote.get_state(api, 'group.living_room')
1
2
3
4
5
6
import homeassistant.remote as remote

api = remote.API("host", "password")
hass = remote.HomeAssistant(api)
hass.start()
living_room = hass.states.get('group.living_room')