Skip to content

Commit

Permalink
Fix incorrect use of "warning" in logger function.
Browse files Browse the repository at this point in the history
Remove "Skill" from much of documentation.
  • Loading branch information
coldfire84 committed Feb 6, 2020
1 parent d1fe7d3 commit 4b50ba3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions docs/deploy-your-own.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To deploy your own instance you are going to need:
4. A registered domain
5. A CloudFlare account, configured to perform DNS for your registered domain

You will require two DNS host names/ A records to be defined for the skill:
You will require two DNS host names/ A records to be defined for the API and MQTT service:
1. Web interface/ API - where you/ your users will login and define their devices
2. MQTT service

Expand All @@ -27,8 +27,8 @@ Define Service Accounts
You need to define three user accounts/ passwords:

1. MongoDB admin account
2. MongoDB account for the skill to connect to the database
3. Superuser account for the skill to connect with to the MQTT server/ your admin account for the Web API
2. MongoDB account for the API to connect to the database
3. Superuser account for the API to connect with to the MQTT server/ your admin account for the Web API

Define these as environment variables to make container setup easier::

Expand All @@ -41,7 +41,7 @@ Define these as environment variables to make container setup easier::

These will also be copied into a .env file later in the deployment process.

.. warning:: Once the skill is setup you should clear your shell history.
.. warning:: Once the API is setup you should clear your shell history.

.. _docker:

Expand Down Expand Up @@ -69,7 +69,7 @@ MongoDB Container/ Account Creation
***************
Docker image is used for mongo, with auth enabled.

Skill-required user accounts are created automatically via docker-entrypoint-initdb.d script, use the following commands to setup the MongoDB database (modifying the environment variables to suit)::
API-required user accounts are created automatically via docker-entrypoint-initdb.d script, use the following commands to setup the MongoDB database (modifying the environment variables to suit)::

sudo mkdir -p /var/docker/mongodb/docker-entrypoint-initdb.d
sudo mkdir -p /var/docker/mongodb/etc
Expand Down
18 changes: 9 additions & 9 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Getting Started
Before you can use this service with Alexa or Google Home you need to:

1. Create and verify an account via `https://red.cb-net.co.uk/new-user. <https://red.cb-net.co.uk/new-user>`_
2. Link your Amazon and/ or Google account with the Node-RED Smart Home Control skill
2. Link your Amazon and/ or Google account with the Node-RED Smart Home Control API
3. Define one or more `devices. <https://red.cb-net.co.uk/devices>`_
4. Install required Node-RED Nodes
5. Setup Node-RED flows using your devices.
Expand All @@ -17,7 +17,7 @@ A `Raspberry Pi <https://www.raspberrypi.org/>`_ is the ideal "work horse" for b

.. tip:: If you get stuck, don't forget to review the :ref:`troubleshooting section <troubleshooting>`.

.. note:: Looking to migrate from another skill? See `Migrating from the "V2" Skill`_
.. note:: Looking to migrate from another service? See `Migrating from Another Service`_

Account Linking
################
Expand All @@ -35,7 +35,7 @@ To link your Amazon account:

Link your Google Account
***************
.. warning:: You currently have to request extension of the skill to your Google account. Please contact `node-red@cb-net.co.uk <mailto:node-red@cb-net.co.uk>`_ for access.
.. warning:: You currently have to request extension of the service to your Google account. Please contact `node-red@cb-net.co.uk <mailto:node-red@cb-net.co.uk>`_ for access.

Once granted access you may need to browse to https://console.actions.google.com/u/0/project/node-red-208520/simulatorcreate?isDeepLink to accept Google Terms and Conditions to use the service.

Expand Down Expand Up @@ -192,7 +192,7 @@ Enter your Node-RED Smart Home Control username and password and click 'Add' to

You can now start to build flows using the concept and example flows in this documentation for inspiration.

.. tip:: Unless you are hosting your own instance of the skill, you can leave the default "MQTT Hostname" and "Web API Hostname" fields as-is.
.. tip:: Unless you are hosting your own instance of the API, you can leave the default "MQTT Hostname" and "Web API Hostname" fields as-is.

.. warning:: You only need to define your account configuration once, re-use this configuration across all of your flow.

Expand Down Expand Up @@ -258,17 +258,17 @@ It is possible to disable "Auto Acknowledge" and use your own logic to establish

.. warning:: This is the most advanced flow type, the majority of scenarios do not warrant/ require this level of complexity - it's just available should you want it!

Migrating from the "V2" Skill
Migrating from Another Service
################
The Node-RED nodes for the original `Alexa Smart Home Skill API "v2" <https://alexa-node-red.bm.hardill.me.uk/>`_ service and this Smart home API "v3" service can co-exist, but your existing flows will need to be modified if you want them to use the "v3" service/ devices.
The Node-RED nodes from other services such as `https://alexa-node-red.bm.hardill.me.uk/ <https://alexa-node-red.bm.hardill.me.uk/>`_ service and this API can co-exist, but your existing flows will need to be modified if you want them to use the "v3" service/ devices.

You are able to test new flows, using the v3 skill nodes alongside the v2 skill, prior to moving your devices.
You are able to test new flows, using the the nodes associated with this API alongside another service, prior to moving your devices.

A typical migration path would look like:

1. Follow initial setup instructions, as-per `Getting Started`_
2. Redefine your devices via `https://red.cb-net.co.uk/devices <https://red.cb-net.co.uk/devices>`_ - you'll need different names if co-existing with API version 2 skill
3. Review `Default Node Outputs </node-outputs.html>`_ - namely response nodes change to msg.acknowledge from msg.payload plus the addition on State nodes with the required function nodes to handle input from outside of the pre-defined Alexa Home Skill nodes
2. Redefine your devices via `https://red.cb-net.co.uk/devices <https://red.cb-net.co.uk/devices>`_ - you'll need different names if co-existing with another service
3. Review `Default Node Outputs </node-outputs.html>`_ - namely response nodes change to msg.acknowledge from msg.payload plus the addition on State nodes with the required function nodes to handle input from outside of the pre-defined nodes
4. Replace legacy/ V2 Nodes with nodes associated with new nodes, removing devices from the v2 service and the Alexa App

.. note:: These services do not share any data, therefore you must create a new account on the v3 service/ define your devices.
Expand Down
10 changes: 5 additions & 5 deletions docs/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If, after issuing voice or Alexa/ Google Home application based commands, you se

Review Node-RED Console Log
################
A more "involved" approach is to look at the Node-RED console logs. The skill related Nodes/ contrib output significant information to the console log. Include any output here, and from the commands/ views above if you end up raising an issue on GuitHub.
A more "involved" approach is to look at the Node-RED console logs. The service related Nodes/ contrib output significant information to the console log. Include any output here, and from the commands/ views above if you end up raising an issue on GuitHub.

For Docker-deployed instances, this is as simple as executing the command (container name dependant)::

Expand All @@ -57,11 +57,11 @@ For Docker-deployed instances, this is as simple as executing the command (conta

Re-link Your Account
################
If you are still struggling to get the skill working it is definitely worth un-linking/ disabling the skill via your smart assistant application and re-linking/ enabling the skill.
If you are still struggling to get the service working it is definitely worth un-linking/ disabling the service via your smart assistant application and re-linking/ enabling the service.

Some long-term users of the service have been linked with a **development-only** edition of the skill which can expire after 90 days of development inactivity. Since the majority of development work occurs in the API/ back-end it is highly likely that this can be a re-occurring issue.
Some long-term users of the service have been linked with a **development-only** edition of the service which can expire after 90 days of development inactivity. Since the majority of development work occurs in the API/ back-end it is highly likely that this can be a re-occurring issue.

The production version of the skill is a "permanent" fixture.
The production version of the service is a "permanent" fixture.

.. tip:: Before re-linking your account it is worth clearing your account "tokens" - use the "Delete Tokens" button found on the "My Account" page.

Expand All @@ -77,7 +77,7 @@ There is also a new `Slack Workspace <https://join.slack.com/t/cb-net/shared_inv

Throttling?
################
Yes, throttling. Due to the architecture of Alexa skills, there is an AWS Lambda function that supports this service/ any Amazon interactions. In order to limit potential costs and ensure a good service experience for users across Node-RED Smart Home Control, a rate limiter is in-place for:
Yes, throttling. There is an AWS Lambda function that supports this service/ any Amazon Alexa interactions. In order to limit potential costs and ensure a good service experience for users across Node-RED Smart Home Control, a rate limiter is in-place for:

* Viewing state in the Alexa Application

Expand Down
6 changes: 3 additions & 3 deletions src/routes/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,12 @@ router.put('/devices', defaultLimiter,
// Check for duplicate device name
var checkDevice = await Devices.findOne({username:user, friendlyName: device.friendlyName});
if (checkDevice) {
logger.log('warning' , "[Create Device] User tried to create a device with duplicate friendly name");
logger.log('warn' , "[Create Device] User tried to create a device with duplicate friendly name");
return res.status(500).send('Please ensure your devices have unique names!');
}
// Require 2FA PIN on Google Home-enabled user Smart Lock
if (req.user.activeServices.indexOf('Google') > -1 && device.displayCategories == 'SMARTLOCK' && (!device.attributes.require2FA || !device.attributes.pin || !device.attributes.type2FA)){
logger.log('warning' , "[Create Device] Google Home user tried to create new Smart Lock device without a PIN");
logger.log('warn' , "[Create Device] Google Home user tried to create new Smart Lock device without a PIN");
return res.status(500).send('As a Google Home user you must set a PIN on your lock!');
}

Expand Down Expand Up @@ -705,7 +705,7 @@ router.post('/device/:dev_id', defaultLimiter,

// Require 2FA PIN on Google Home-enabled user Smart Lock
if (req.user.activeServices.indexOf('Google') > -1 && device.displayCategories == 'SMARTLOCK' && (!device.attributes.require2FA || !device.attributes.pin || !device.attributes.type2FA)){
logger.log('warning' , "[Create Device] Google Home user tried to create new Smart Lock device without a PIN");
logger.log('warn' , "[Create Device] Google Home user tried to create new Smart Lock device without a PIN");
return res.status(500).send('As a Google Home user you must set a PIN on your lock!');
}

Expand Down

0 comments on commit 4b50ba3

Please sign in to comment.