Skip to content

Commit 9e6318d

Browse files
NorthernMan54github-actions[bot]banboobee
authored
Enables Thermostat type accessory to Turn Off and Turn On #605 (#608)
* Update TOC * Clean up gh-md-toc * Updates to #605, adds new setting thermostatTurnOn, and adds UI menu support * Update Dependencies --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: banboobee <[email protected]>
1 parent 87e3f8c commit 9e6318d

28 files changed

+14646
-4533
lines changed

.github/workflows/Build and Publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
5353
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
5454

55-
- uses: actions/setup-node@v3
55+
- uses: actions/setup-node@v4
5656
with:
5757
node-version: lts/*
5858

@@ -64,13 +64,14 @@ jobs:
6464
- name: Create Table of Contents
6565
run: |
6666
npm run-script document
67+
rm gh-md-toc
6768
6869
- name: Commit files
6970
run: |
7071
git config --local user.email "github-actions[bot]@users.noreply.github.com"
7172
git config --local user.name "github-actions[bot]"
7273
git add *
73-
git commit -a -m "Update TOC"
74+
git commit -a -m "Update TOC" || true
7475
7576
- name: Push changes
7677
uses: ad-m/github-push-action@master
@@ -115,4 +116,4 @@ jobs:
115116
name: Release ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
116117
generate_release_notes: true
117118
draft: false
118-
prerelease: false
119+
prerelease: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ Troubleshooting.md.orig.*
1111
alexaDiscovery.json
1212
tools/after.json
1313
tools/output.txt
14+
15+
gh-md-toc

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
44

5+
## 0.6.9 (2023-03-30)
6+
7+
## [Version 0.6.9](https://github.com/northernman54/homebridge-alexa/compare/v0.6.8...v0.6.9)
8+
9+
#### Changes
10+
11+
- Enables Thermostat type accessory to `Turn Off` and `Turn On` #605 ( Tks @banboobee ). To preserve existing functionality the inital / default behaviour for the `Turn on Thermostat` command is to return an error message `That command does not work on device` unless the new optional config setting `Thermostat Turn On Behaviour` is set.
12+
- Minor style updates to Config Menu
13+
- Updates to package dependencies
14+
515
## 0.6.8 (2023-12-13)
616

717
## [Version 0.6.8](https://github.com/northernman54/homebridge-alexa/compare/v0.6.7...v0.6.8)

Installation.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Installation and Configuration of Homebridge Alexa
2727
* [refresh - Accessory Cache Refresh Interval](#refresh---accessory-cache-refresh-interval)
2828
* [filter - Homebridge Instance Filter](#filter---homebridge-instance-filter)
2929
* [mergeServiceName - Alternate device naming](#mergeservicename---alternate-device-naming)
30+
* [thermostatTurnOn - Thermostat Turn On Behaviour](#thermostatturnon---thermostat-turn-on-behaviour)
3031
* [blind](#blind)
3132
* [door](#door)
3233
* [Speaker Settings](#speaker-settings)
@@ -39,10 +40,6 @@ Installation and Configuration of Homebridge Alexa
3940
* [Initial Testing and confirming configuration](#initial-testing-and-confirming-configuration)
4041
* [Enable Homebridge smarthome skill and link accounts](#enable-homebridge-smarthome-skill-and-link-accounts)
4142
* [Discover Devices](#discover-devices)
42-
43-
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
44-
<!-- Added by: runner, at: Wed Dec 13 14:31:10 UTC 2023 -->
45-
4643
<!--te-->
4744

4845
# Setup Instructions
@@ -322,6 +319,25 @@ sudo npm install -g homebridge-alexa
322319
],
323320
```
324321

322+
#### thermostatTurnOn - Thermostat Turn On Behaviour
323+
- Set Thermostat `Turn On` Behaviour to either Heat, Cool or Auto when Alexa is asked to turn on a Thermostat. Defaults to `That command does not work on device`.
324+
325+
Heat - 1
326+
Cool - 2
327+
Auto - 3
328+
329+
```
330+
"platforms": [
331+
{
332+
"platform": "Alexa",
333+
"name": "Alexa",
334+
"username": "....",
335+
"password": "....",
336+
"thermostatTurnOn": 2
337+
}
338+
],
339+
```
340+
325341
#### blind
326342
- Enables natural wording for opening and closing blinds, and window coverings. Not supported in all countries. Defaults to false
327343

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
[![NPM Downloads](https://img.shields.io/npm/dm/homebridge-alexa.svg?style=flat)](https://npmjs.org/package/homebridge-alexa)
44

5-
<p align="center">
6-
<img src="docs/homebridge.png" height="200">
7-
</p>
5+
<h1><p align="center">
6+
<img src="docs/README_Image.001.jpeg" width="80%" style="vertical-align:middle">
7+
</p></h1>
88

9-
Enable Amazon Alexa to control your homebridge smart home devices and accessories. Please note, that this does **NOT** bring Alexa enabled devices into homebridge, for this please try [homebridge-alexa-smarthome](https://github.com/joeyhage/homebridge-alexa-smarthome). Full support for all Amazon Alexa devices, including the echo 2nd Generation and software based solutions. Uses an Amazon smart home skill based approach for integration between HomeBridge and Amazon Alexa.
9+
Enable Amazon Alexa to control your homebridge smart home devices and accessories. Please note, that this does **NOT** bring Alexa enabled devices into homebridge, for this please try [homebridge-alexa-smarthome](https://github.com/joeyhage/homebridge-alexa-smarthome).
1010

1111
# Note to users of the service
1212

@@ -60,6 +60,7 @@ Country availability - The plugin is available in these countries, English (AU),
6060
* [Garage Door With blind = true ( Not supported in all countries )](#garage-door-with-blind--true--not-supported-in-all-countries-)
6161
* [Window coverings / blinds With blind = true ( Not supported in all countries )](#window-coverings--blinds-with-blind--true--not-supported-in-all-countries-)
6262
* [Thermostat's and Heater / Cooler's](#thermostats-and-heater--coolers)
63+
* [For Thermostat's only](#for-thermostats-only)
6364
* [Lock / Unlock Doors](#lock--unlock-doors)
6465
* [Temperature sensors](#temperature-sensors)
6566
* [AppleTV ( homebridge-apple-tv or homebridge-apple-tv-remote )](#appletv--homebridge-apple-tv-or-homebridge-apple-tv-remote-)
@@ -82,10 +83,6 @@ Country availability - The plugin is available in these countries, English (AU),
8283
* [Homebridge Accessory Dump](#homebridge-accessory-dump)
8384
* [Roadmap](#roadmap)
8485
* [Credits](#credits)
85-
86-
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
87-
<!-- Added by: runner, at: Wed Dec 13 14:31:09 UTC 2023 -->
88-
8986
<!--te-->
9087

9188
# Supported devices
@@ -217,6 +214,13 @@ See [example](https://github.com/NorthernMan54/homebridge-alexa/wiki/Garage-Door
217214
* Alexa, set thermostat to 20
218215
* Alexa, set thermostat to heat/cool/automatic/off
219216

217+
### For Thermostat's only
218+
219+
* Alexa, turn off thermostat
220+
* Alexa, turn on thermostat
221+
222+
The `Turn On` thermostat behaviour is configured in the Optional Setting config menu under `Thermostat Turn On Behaviour`, and unless this is configured `Turn On` is disabled, and alexa will respond with `That command does not work on device`.
223+
220224
Adamo Maisano provided a deeper [comparison](https://github.com/NorthernMan54/homebridge-alexa/wiki/Thermostat-Voice-Control-Comparison) of Thermostat Voice Control [here](https://github.com/NorthernMan54/homebridge-alexa/wiki/Thermostat-Voice-Control-Comparison).
221225

222226
## Lock / Unlock Doors

Troubleshooting.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!--ts-->
44
* [Initial Setup](#initial-setup)
55
* [[Alexa] ERROR: ( homebridge-alexa) Login to homebridge.ca failed, please validate your credentials in config.json and restart homebridge.](#alexa-error--homebridge-alexa-login-to-homebridgeca-failed-please-validate-your-credentials-in-configjson-and-restart-homebridge)
6-
* [- Bad login or password in your config.json for <a href="https://www.homebridge.ca" rel="nofollow">https://www.homebridge.ca</a>](#--bad-login-or-password-in-your-configjson-for-httpswwwhomebridgeca)
6+
* [- Bad login or password in your config.json for <a href="https://www.homebridge.ca" rel="nofollow">https://www.homebridge.ca</a>](https://www.homebridge.ca)
77
* [[Alexa] ERROR: ( homebridge-alexa) You have an issue with your installation, please review the README.](#alexa-error--homebridge-alexa-you-have-an-issue-with-your-installation-please-review-the-readme)
88
* [- Cloud Server DDOS Protection has blocked your IP address](#--cloud-server-ddos-protection-has-blocked-your-ip-address)
99
* [- Multiple copies of homebridge-alexa on your network](#--multiple-copies-of-homebridge-alexa-on-your-network)
@@ -32,14 +32,11 @@
3232
* [Unsuccessful event message ( No event gateway token )](#unsuccessful-event-message--no-event-gateway-token-)
3333
* [Successful event message being sent to Alexa](#successful-event-message-being-sent-to-alexa)
3434
* [[Alexa] ERROR: Event gateway token refresh error: 400](#alexa-error--event-gateway-token-refresh-error-400)
35-
36-
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
37-
<!-- Added by: runner, at: Wed Dec 13 14:31:10 UTC 2023 -->
38-
3935
<!--te-->
4036

4137
# Initial Setup
4238

39+
4340
## [Alexa] ERROR: ( homebridge-alexa) Login to homebridge.ca failed, please validate your credentials in config.json and restart homebridge.
4441

4542
### - Bad login or password in your config.json for https://www.homebridge.ca

config.schema.json

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,76 @@
22
"pluginAlias": "Alexa",
33
"pluginType": "platform",
44
"singular": true,
5-
"headerDisplay": "<h1><p align='center'>Allow your Amazon Alexa to control your homebridge devices</H1></p><h1><p align='center'> <img width='18%' src='https://user-images.githubusercontent.com/19808920/210089307-7622bb91-49d0-4d90-b2c3-31118e1a76c0.png'><b> => </b><img width='20%' src='https://user-images.githubusercontent.com/19808920/210090318-9e8ddc2a-a025-40ac-9718-7b5a2aa9a518.png'></p></h1> <br>To setup the service:<br>1 - First <b>create</b> an account on <a href='https://www.homebridge.ca/'>https://www.homebridge.ca/</a>. <br>2 - Then <b>enter</b> the username and password for your account <b>below</b>. <br>3 - <b>Save</b> the settings and <b>restart</b> homebridge. <br>4 - In the Amazon Alexa Application on your smart phone, <b>search</b> for the Homebridge Skill and enable it. When you enable the skill, it will take you to the <b>https://www.homebridge.ca/</b> website to <b>enable</b> and link the skill to the plugin. <br>5 - You can now ask Alexa to <b>`discover devices`</b> and it should discover your homebridge devices.<br><br>Detailed setup instructions are available <a href='https://github.com/NorthernMan54/homebridge-alexa/blob/master/Installation.md#setup-instructions'>here</a>.",
5+
"headerDisplay": "<h1><p align='center'>Allow your Amazon Alexa to control your homebridge devices</H1></p><h1><p align='center'><img src='https://raw.githubusercontent.com/NorthernMan54/homebridge-alexa/main/docs/README_Image.001.jpeg' width='80%' style='vertical-align:middle'></p></h1> <br><b>To setup the service:</b><br><br>1 - First <b>create</b> an account on <a href='https://www.homebridge.ca/'>https://www.homebridge.ca/</a>. <br>2 - Then <b>enter</b> the username and password for your account <b>below</b>. <br>3 - <b>Save</b> the settings and <b>restart</b> homebridge. <br>4 - In the Amazon Alexa Application on your smart phone, <b>search</b> for the Homebridge Skill and enable it. When you enable the skill, it will take you to the <b>https://www.homebridge.ca/</b> website to <b>enable</b> and link the skill to the plugin. <br>5 - You can now ask Alexa to <b>`discover devices`</b> and it should discover your homebridge devices.<br><br>Detailed setup instructions are available <a href='https://github.com/NorthernMan54/homebridge-alexa/blob/master/Installation.md#setup-instructions'>here</a>.<br>",
66
"footerDisplay": "Homebridge Alexa Skill: https://www.amazon.com/Northern-Man-54-Homebridge/dp/B07B9QMTFQ",
77
"schema": {
88
"type": "object",
99
"properties": {
1010
"name": {
11-
"title": "Name",
11+
"title": "<b>Name</b>",
1212
"type": "string",
1313
"required": true,
1414
"default": "Alexa",
1515
"description": "Plugin name as displayed in the Homebridge log"
1616
},
1717
"username": {
18-
"title": "Username",
18+
"title": "<b>Username</b>",
1919
"type": "string",
2020
"required": true,
2121
"description": "Username for https://www.homebridge.ca/"
2222
},
2323
"password": {
24-
"title": "Password",
24+
"title": "<b>Password</b>",
2525
"type": "string",
2626
"required": true,
2727
"description": "Password for https://www.homebridge.ca/"
2828
},
2929
"pin": {
30-
"title": "Homebridge Pin",
30+
"title": "<b>Homebridge Pin</b>",
3131
"type": "string",
3232
"placeholder": "031-45-154",
3333
"description": "This needs to match the Homebridge pin set in your config.json file"
3434
},
3535
"routines": {
36-
"title": " Routines - enables passing of Motion and Contact sensor events to Alexa. For use in the Alexa app to create Routines triggered by these sensors.",
36+
"title": "<b>Routines</b>",
3737
"type": "boolean",
38-
"placeholder": false
38+
"placeholder": false,
39+
"description": "Enables passing of Motion and Contact sensor events to Alexa. For use in the Alexa app to create Routines triggered by these sensors."
3940
},
4041
"blind": {
41-
"title": "Enables natural wording for opening and closing blinds, and window coverings. Not supported in all countries. Defaults to false",
42+
"title": "<b>Blind</b>",
4243
"type": "boolean",
43-
"placeholder": false
44+
"placeholder": false,
45+
"description": "Enables natural wording for opening and closing blinds, and window coverings. Not supported in all countries. Defaults to false"
4446
},
4547
"door": {
46-
"title": "Enables natural wording for opening and closing garage doors. Not supported in all countries. Please note that opening a garage door requires setting a voice pin within the Alexa app. Defaults to false",
48+
"title": "<b>Door</b>",
4749
"type": "boolean",
48-
"placeholder": false
50+
"placeholder": false,
51+
"description": "Enables natural wording for opening and closing garage doors. Not supported in all countries. Please note that opening a garage door requires setting a voice pin within the Alexa app. Defaults to false"
4952
},
5053
"debug": {
51-
"title": "Enable debug level logging to assist in problem investigation",
54+
"title": "<b>Debug</b>",
5255
"type": "boolean",
53-
"placeholder": false
56+
"placeholder": false,
57+
"description": "Enable debug level logging to assist in problem investigation."
58+
},
59+
"beta": {
60+
"title": "<b>beta</b>",
61+
"type": "boolean",
62+
"placeholder": false,
63+
"description": "Enable beta test environment. Only available by invitation."
5464
},
5565
"refresh": {
56-
"title": "Accessory Cache Refresh Interval",
66+
"title": "<b>Accessory Cache Refresh Interval</b>",
5767
"type": "integer",
5868
"default": 900,
5969
"description": "Frequency of refreshes of the homebridge accessory cache, in seconds. Defaults to 900 Seconds ( 15 minutes ). This is the interval before new devices/homebridge instances are discovered. This should never require changing, unless you are frequently changing your homebridge configuration without restarting the plugin.",
6070
"minimum": 120,
6171
"maximum": 86400
6272
},
6373
"keepalive": {
64-
"title": "Cloud Server Connection Keepalive",
74+
"title": "<b>Cloud Server Connection Keepalive</b>",
6575
"type": "integer",
6676
"default": "5",
6777
"description": "Frequency of keepalive messages to cloud server, in minutes. Defaults to 5 minutes. Do not change from default unless requested as part of problem investigation.",
@@ -72,13 +82,38 @@
7282
}
7383
},
7484
"mergeServiceName": {
75-
"title": "Alternate device naming approach",
85+
"title": "<b>Alternate device naming approach</b>",
7686
"type": "boolean",
7787
"description": "This is an alternate device naming approach, which combines the internal HomeKit names for a device. It may resolve duplicate device name issues. Do not enable on an existing implementation, as you will lose control of your existing devices.",
7888
"placeholder": false
7989
},
90+
"thermostatTurnOn": {
91+
"title": "<b>Thermostat Turn On Behaviour</b>",
92+
"description": "Set Thermostat `Turn On` Behaviour to either Heat, Cool or Auto when Alexa is asked to turn on a Thermostat. Defaults to doing nothing and saying `That command does not work on device ...`.",
93+
"type": "integer",
94+
"oneOf": [
95+
{
96+
"title": "Heat",
97+
"enum": [
98+
1
99+
]
100+
},
101+
{
102+
"title": "Cool",
103+
"enum": [
104+
2
105+
]
106+
},
107+
{
108+
"title": "Auto",
109+
"enum": [
110+
3
111+
]
112+
}
113+
]
114+
},
80115
"CloudTransport": {
81-
"title": "Cloud Server Connection Transport",
116+
"title": "<b>Cloud Server Connection Transport</b>",
82117
"description": "Transport options for cloud server connection. MQTTS - this is the recommended setting. MQTT - this is the original/legacy option. WSS - this is the an alternative transport option.",
83118
"type": "string",
84119
"default": "mqtts",
@@ -105,15 +140,16 @@
105140
]
106141
},
107142
"filter": {
108-
"title": "Homebridge Instance Filter",
143+
"title": "<b>Homebridge Instance Filter</b>",
109144
"type": "string",
110145
"placeholder": "eg. 192.168.1.122:51826",
111-
"description": "Limits accessories shared with Alexa to a single homebridge instance.",
146+
"description": "Limits accessories shared with Alexa to a single homebridge instance. Uses ip address and port of homebridge instance.",
112147
"pattern": "^[^{}/ :\\\\]+(?::\\d+)?$"
113148
},
114149
"deviceListHandling": {
115-
"title": "<b>Filtering of devices by name, either allow or ignore.</b>",
150+
"title": "<b>Device List</b>",
116151
"type": "string",
152+
"description": "Allows filtering of devices by name. You can either allow or ignore a list of device names.",
117153
"default": "none",
118154
"required": true,
119155
"oneOf": [
@@ -144,7 +180,7 @@
144180
"type": "string"
145181
},
146182
"condition": {
147-
"functionBody": "return model.deviceListHandling !== 'null';"
183+
"functionBody": "if (model.deviceListHandling === 'allow' || model.deviceListHandling === 'deny') { return true } else { return false };"
148184
}
149185
},
150186
"combine": {
@@ -214,6 +250,7 @@
214250
"pin",
215251
"routines",
216252
"debug",
253+
"thermostatTurnOn",
217254
"deviceListHandling",
218255
{
219256
"key": "deviceList",
@@ -239,7 +276,9 @@
239276
"keepalive",
240277
"refresh",
241278
"filter",
242-
"mergeServiceName"
279+
"mergeServiceName",
280+
"blind",
281+
"door"
243282
]
244283
},
245284
{

docs/Alexa_Logo_RGB_BLUE.png

6.47 KB
Loading

docs/README_Image.key

416 KB
Binary file not shown.

docs/echo_1st.jpg

26.3 KB
Loading

0 commit comments

Comments
 (0)