💬 🏡 A Hubot module for interacting with Home Assistant via chat.
This repository is deprecated, unmaintained and archived.
In hubot project repo, run:
npm install hubot-home-assistant --save
Then add hubot-home-assistant to your external-scripts.json
:
[
"hubot-home-assistant"
]
Variable | Required? | Description |
---|---|---|
HUBOT_HOME_ASSISTANT_HOST |
Yes | The URL for your Home Assistant instance, e.g. https://demo.home-assistant.io or http://hassio.local:8123 . |
HUBOT_HOME_ASSISTANT_API_TOKEN |
Yes | The long-lived access token for a Home Assistant user. |
HUBOT_HOME_ASSISTANT_MONITOR_EVENTS |
No | If set to any value, whether to monitor for events |
HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES |
No | If set to any value, whether to monitor all entities for status changes |
HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION |
No | Which room/channel/chat to send events, e.g. #homeassistant or @alice ; default: #home-assistant |
The HUBOT_HOME_ASSISTANT_API_PASSWORD
environment variable has been replaced by the HUBOT_HOME_ASSISTANT_API_TOKEN
. You can obtain your long-lived access token in your v0.77
+ instance of Home Assistant by clicking on your user icon in the navigation, scrolling to the section titled "Long-Lived Access Tokens," and clicking the "Create" button.
Read more about long-lived access tokens.
Returns the current state of the entity. Note that it uses the hidden
attribute flag to reduce this list. It will also exclude Views and Zones.
<alice> hubot hass list
<hubot> sun.sun: Sun; camera.office: Office; camera.den: Den; group.commute: Commute; group.climate: Climate; ...
Returns the current state of the entity.
<alice> hubot hass state of Living Room Downlights
<hubot> @alice Living Room Downlights is off (since 2 hours ago)
Turn the entity on/off.
<alice> hubot hass turn Living Room Downlights on
<hubot> @alice Living Room Downlights turned on
Set the entity state to the given value.
<alice> hubot hass set Bob's iPhone to home
<hubot> @alice Setting Bob's iPhone to home
<hubot> @alice Bob's iPhone set to home
In addition to directly interacting with Home Assistant, this package will allow you to stream entity status changes (e.g. turn a light on, home temperature rises, etc.) into a room/channel/user of your choice.
- Set
HUBOT_HOME_ASSISTANT_MONITOR_EVENTS
to any value to enable streaming. - Set
HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION
to where you want the messages to be seen. By default, they will go to a channel/room called#home-assistant
. - Restart your Hubot
Note that Home Assistant will send a lot of change events throughout the day if you have several components configured. For example, if you have a thermostat configured, it will send an event for every detected temperature change.
- Set
HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES
to any value. - Restart your Hubot
- Ensure that
HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES
is not set in the configuration. - Update your Home Assistant configuration under the
customize
,customize_domain
orcustomize_blob
key to include thehubot_monitor: true
attribute. See documentation for more details. - Restart your Hubot
Examples:
homeassistant:
#...
# Set a specific device to monitor
customize:
climate.my_ecobee3:
hubot_monitor: true
# Monitor all devices in a particular domain
customize_domain:
alarm_control_panel:
hubot_monitor: true
light:
hubot_monitor: true
# Monitor devices matching a pattern
customize_blob:
"device_tracker.*_iphone":
hubot_monitor: true