Telegram robot for Hubitat - https://github.com/vdbg/hubibot
3.4K
This container allows a Telegram user to issue commands against devices managed by Hubitat through a Telegram bot.
Notable pros compared to alternatives are fine-grained access control and not requiring a VPN.
/on Office Light to turn on the device named "Office Light"./on hw doing the same as /on Hot Water.touch config.yamlsudo docker run --name my_hubibot -v "`pwd`/config.yaml:/app/config.yaml" vdbg/hubibotsudo docker cp my_hubibot:/app/template.config.yaml config.yamlconfig.yaml by following the instructions in the filesudo docker start my_hubibot -iCtrl-C to stop the container if config.yaml is changedsudo docker container rm my_hubibotsudo docker run -d --name my_hubibot -v "`pwd`/config.yaml:/app/config.yaml" --restart=always --memory=100m vdbg/hubibotsudo docker container logs -f my_hubibotFrom your Telegram account, write /h to the bot to get the list of available commands.
User and device groups allow for fine-grained access control, for example giving access to different devices to parents, kids, friends and neighbors.
While three user groups ("admins", "family", "guests") and three device groups ("all","regular","limited") are provided in the template config file as examples, any positive number of user and device groups are supported (names are free-form, alphabetical). For example, if only one single user is using the bot, only keeping "admins" user group & "all" device group will suffice.
Device groups represent collection of Hubitat devices that can be accessed by user groups. In the template config file "admins" user group has access to "all" device group, "family" to "regular", and "guests" to "limited".
User groups represent collection of Telegram users that have access to device groups. User groups can contain any number of Telegram user ids (those with no user ids are ignored) and reference any number of device groups. User groups with an access_level set to:
NONE: cannot use any commands. Useful to disable a user group.DEVICE: can use device commands e.g., /list, /on, /off, /open, /close, /dim, /status, /info.SECURITY: can use the same commands as access_level: DEVICE, and also act on locks with /lock & /unlock commands, the /arm command for Hubitat Safety Monitor, the /mode command to view and change the mode, the /events command to see a device's history, and the /tz command to change the timezone for /events and /lastevent.ADMIN: can use the same commands as access_level: SECURITY, and also admin commands e.g., /users, /groups, /refresh. In addition some commands have more detailed output (e.g., /list, /status).A user can only belong to one user group, but a device can belong to multiple device groups and a device group can be referenced by multiple user groups.
main:logverbosity to DEBUG in config.yaml to get more details. Note: Hubitat's token is printed in plain text when main:logverbosity is DEBUGconfig.yaml<hubitat:url>/apps/api/<hubitat:appid>/devices?access_token=<hubitat:token> url from that device (replace placeholders with values from config.yaml)/list command:
hubitat:device_groups:<name>:allowed_device_ids setting in config.yaml for the device group(s) of the current user is either empty or includes the device's id/refresh command/users commandThe config.yaml file takes user Ids instead of user handles because the later are neither immutable nor unique.
There are two methods for getting a Telegram user Id:
main:logVerbosity is set to WARNING or higher in config.yaml and ask that user to write to the bot. There will be a warning in the logs with that user's Id and handle.Content type
Image
Digest
sha256:931107c6b…
Size
28.3 MB
Last updated
9 months ago
docker pull vdbg/hubibot