Repository: Apollon77/ioBroker.alexa2 Branch: master Commit: 688158d21f92 Files: 41 Total size: 774.7 KB Directory structure: gitextract_dh1xzp4m/ ├── .eslintrc.json ├── .gitattributes ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── auto-merge.yml │ ├── copilot-instructions.md │ ├── dependabot.yml │ ├── stale.yml │ └── workflows/ │ ├── codeql.yml │ ├── dependabot-automerge.yml │ └── test-and-release.yml ├── .gitignore ├── .mocharc.json ├── .npmignore ├── .releaseconfig.json ├── LICENSE ├── README.md ├── admin/ │ ├── i18n/ │ │ ├── de/ │ │ │ └── translations.json │ │ ├── en/ │ │ │ └── translations.json │ │ ├── es/ │ │ │ └── translations.json │ │ ├── fr/ │ │ │ └── translations.json │ │ ├── hu/ │ │ │ └── translations.json │ │ ├── it/ │ │ │ └── translations.json │ │ ├── nl/ │ │ │ └── translations.json │ │ ├── pl/ │ │ │ └── translations.json │ │ ├── pt/ │ │ │ └── translations.json │ │ ├── ru/ │ │ │ └── translations.json │ │ ├── uk/ │ │ │ └── translations.json │ │ └── zh-cn/ │ │ └── translations.json │ ├── index_m.html │ └── words.js ├── io-package.json ├── lib/ │ ├── smarthomedevices.js │ └── tools.js ├── main.js ├── package.json └── test/ ├── lib/ │ └── setup.js ├── mocha.setup.js ├── testAdapter.js └── testPackageFiles.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .eslintrc.json ================================================ { "root": true, "env": { "es6": true, "node": true, "mocha": true }, "extends": [ "eslint:recommended" ], "plugins": [], "rules": { "indent": [ "error", 4, { "SwitchCase": 1 } ], "no-console": "off", "no-var": "error", "no-trailing-spaces": "error", "prefer-const": "error", "quotes": [ "error", "single", { "avoidEscape": true, "allowTemplateLiterals": true } ], "semi": [ "error", "always" ] }, "parserOptions": { "ecmaVersion": 2018 } } ================================================ FILE: .gitattributes ================================================ # Auto detect text files and perform LF normalization * text=auto # Custom for Visual Studio *.cs diff=csharp # Standard to msysgit *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: Apollon77 patreon: Apollon77 custom: ['https://paypal.me/Apollon77'] ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Something is not working as it should title: '' labels: '' assignees: '' --- **Check if the Bug maybe is with Amazon** The adapter is using the same API as the Alexa mobile App. This means: * If you can not do this what you want with the App then the Adapter also can not do it! * Also if the App can do it please test if the same effect then the bug also happens with the App (e.g. a speak command do not work on a certain device ... can you do a speak via Alexa App? If not - Amazon problem!) **Describe the bug** A clear and concise description of what the bug is. Especially describe what you verified using the Alexa App (see above). **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '...' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots & Logfiles** If applicable, add screenshots and logfiles to help explain your problem. **Versions:** - Adapter version: - JS-Controller version: - Node version: - Operating system: **Additional context** Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Consider the Reality** The adapter is using the same API as the Alexa mobile App. This means: If you can not do this what you want with the App then the Adapter also can not do it! Also a feature rewuest most likely will not be possible. **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/auto-merge.yml ================================================ # Configure here which dependency updates should be merged automatically. # The recommended configuration is the following: - match: # Only merge patches for production dependencies dependency_type: production update_type: "semver:patch" - match: # Except for security fixes, here we allow minor patches dependency_type: production update_type: "security:minor" - match: # and development dependencies can have a minor update, too dependency_type: development update_type: "semver:minor" # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: # https://dependabot.com/docs/config-file/#automerged_updates ================================================ FILE: .github/copilot-instructions.md ================================================ # ioBroker.alexa2 Adapter ioBroker.alexa2 is a Node.js adapter for ioBroker that provides remote control for Amazon Alexa devices (Amazon Echo). The adapter integrates with the ioBroker home automation platform and allows control of Alexa devices, smart home devices, routines, and more. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. ## Working Effectively ### Bootstrap, Build, and Test the Repository: - `npm install` -- Install dependencies. Takes ~40 seconds. NEVER CANCEL. - `npm test` -- Run complete test suite. Takes ~55 seconds. NEVER CANCEL. Set timeout to 90+ seconds. - `npx eslint main.js lib/ test/ --ext .js` -- Lint main code files. Admin files have known translation issues. ### Timing Expectations: - **NEVER CANCEL**: npm install takes 40 seconds. Wait for completion. - **NEVER CANCEL**: npm test takes 55 seconds total. Set timeout to 90+ seconds minimum. - **NEVER CANCEL**: The test includes full ioBroker js-controller setup which can take 30+ seconds just for initialization. ### Manual Validation After Changes: - ALWAYS run `npm test` after making any code changes to ensure adapter functionality - ALWAYS run ESLint on modified files: `npx eslint --ext .js` - The adapter cannot be run standalone - it requires ioBroker infrastructure - Tests automatically validate adapter startup, configuration, and shutdown sequences - DO NOT attempt to run main.js directly - it requires ioBroker adapter-core framework ## Project Structure and Navigation ### Key Directories and Files: ``` /home/runner/work/ioBroker.alexa2/ioBroker.alexa2/ ├── main.js # Main adapter entry point (352KB, core logic) ├── package.json # Dependencies and npm scripts ├── io-package.json # ioBroker adapter configuration ├── README.md # Comprehensive adapter documentation ├── lib/ │ ├── smarthomedevices.js # Smart home device definitions and controllers │ └── tools.js # Utility functions ├── admin/ # Web UI configuration files │ ├── index_m.html # Material Design admin interface │ ├── words.js # i18n translations (has known ESLint issues) │ └── icons/ # Device type icons ├── test/ │ ├── testAdapter.js # Main adapter functionality tests │ ├── testPackageFiles.js # Package validation tests │ └── lib/setup.js # Test infrastructure and js-controller setup └── .github/workflows/ # CI/CD pipeline configuration ``` ### Important Code Areas: - **main.js**: Core adapter logic, Alexa API integration, device management - **lib/smarthomedevices.js**: Smart home device capability definitions for various device types - **admin/index_m.html**: Admin configuration interface for credentials and settings - **test/lib/setup.js**: Complex test infrastructure that sets up js-controller environment ## Validation Scenarios ### Always Run These Validation Steps: 1. **Install and Test**: `npm install && npm test` - Ensures all dependencies work and adapter can start properly 2. **Lint Check**: `npx eslint main.js lib/ test/ --ext .js` - Check code quality (ignore admin/words.js issues) 3. **Package Validation**: Tests automatically validate package.json and io-package.json consistency ### Manual Testing Scenarios: - The adapter requires Amazon Alexa account credentials which cannot be tested in CI - Tests validate adapter initialization, configuration loading, and proper shutdown - Real functionality requires proxy-based authentication flow with Amazon - Tests use mock/stub behavior for core adapter lifecycle validation ## Common Tasks ### Dependencies and Requirements: - **Node.js**: 16+ required (package.json engines), tested with 20.x - **npm**: Standard package manager, uses package-lock.json - **@iobroker/adapter-core**: ^3.2.3 - Core ioBroker adapter framework - **alexa-remote2**: ^8.0.2 - Amazon Alexa API integration library ### npm Scripts Available: ```bash npm test # Run mocha test suite (takes ~55s) npm run release # Release automation (requires tokens) npm run translate # Translation management ``` ### Linting and Code Quality: - ESLint configured in .eslintrc.json with strict rules - Use single quotes, 4-space indentation, prefer const over let/var - Main code files should lint cleanly - admin/words.js has known translation format issues - ignore ESLint errors in this file ### GitHub Actions Workflow: - Runs on Node.js 18.x, 20.x, 22.x, 24.x across Ubuntu, Windows, macOS - check-and-lint job: `npm ci` only (linting commented out in workflow) - adapter-tests job: `npm ci && npm test` - Deployment triggers on tagged releases ## Architecture Notes ### ioBroker Adapter Pattern: - Extends @iobroker/adapter-core.Adapter class - Uses state-based communication with ioBroker objects/states databases - Implements standard adapter lifecycle: ready, unload, stateChange, objectChange - Creates device/state hierarchies under adapter namespace (alexa2.0.*) ### External Dependencies: - alexa-remote2: Amazon Alexa API integration - https, nearest-color, rrule: Utility libraries - Sentry integration for error reporting (optional) ### Test Infrastructure: - Uses complex test setup that installs and configures js-controller - Creates temporary ioBroker instance with Redis backends - Tests adapter lifecycle, not actual Amazon Alexa functionality - Mock/stub approach for external API dependencies ## Troubleshooting ### Common Issues: - **Test timeouts**: Always set 90+ second timeouts for npm test - **ESLint errors in admin/words.js**: These are translation files with specific format requirements - ignore - **Cannot run main.js directly**: Requires ioBroker adapter-core framework and configuration - **Missing dependencies**: Always run `npm install` before any other commands ### Development Environment: - Use any modern IDE with Node.js support - ESLint integration recommended for code quality - Git hooks not configured - manually run linting before commits - No TypeScript - pure JavaScript codebase ### CI/CD Pipeline: - Tests run automatically on pushes and PRs - Linting step commented out in workflow due to admin file issues - Releases automated via @alcalzone/release-script - Sentry integration for production error tracking ================================================ FILE: .github/dependabot.yml ================================================ # Dependabot will run on day 19 of each month at 02:38 (Europe/Berlin timezone) version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "cron" timezone: "Europe/Berlin" cronjob: "38 2 19 * *" open-pull-requests-limit: 15 - package-ecosystem: "npm" directory: "/" schedule: interval: "cron" timezone: "Europe/Berlin" cronjob: "38 2 19 * *" open-pull-requests-limit: 20 versioning-strategy: "increase" ================================================ FILE: .github/stale.yml ================================================ # Configuration for probot-stale - https://github.com/probot/stale # Number of days of inactivity before an Issue or Pull Request becomes stale daysUntilStale: 90 # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. daysUntilClose: 7 # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) onlyLabels: [] # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - enhancement - security - bug # Set to true to ignore issues in a project (defaults to false) exemptProjects: true # Set to true to ignore issues in a milestone (defaults to false) exemptMilestones: true # Set to true to ignore issues with an assignee (defaults to false) exemptAssignees: false # Label to use when marking as stale staleLabel: wontfix # Comment to post when marking as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung. # Comment to post when removing the stale label. # unmarkComment: > # Your comment here. # Comment to post when closing a stale Issue or Pull Request. closeComment: > This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions. Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, Logs und Reproduktionsschritte enthalten sind. Vielen Dank für Eure Unterstützung. # Limit the number of actions per hour, from 1-30. Default is 30 limitPerRun: 30 # Limit to only `issues` or `pulls` only: issues # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': # pulls: # daysUntilStale: 30 # markComment: > # This pull request has been automatically marked as stale because it has not had # recent activity. It will be closed if no further activity occurs. Thank you # for your contributions. # issues: # exemptLabels: # - confirmed ================================================ FILE: .github/workflows/codeql.yml ================================================ name: "CodeQL" on: push: branches: [ "master" ] pull_request: # The branches below must be a subset of the branches above branches: [ "master" ] schedule: - cron: '31 17 * * 1' jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'javascript' ] steps: - name: Checkout repository uses: actions/checkout@v5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} - name: Autobuild uses: github/codeql-action/autobuild@v4 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" ================================================ FILE: .github/workflows/dependabot-automerge.yml ================================================ # Automatically merge Dependabot PRs when version comparison is within the range # that is configured in .github/auto-merge.yml name: Auto-Merge Dependabot PRs on: pull_request_target: jobs: auto-merge: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v5 - name: Check if PR should be auto-merged uses: ahmadnassri/action-dependabot-auto-merge@v2 with: # This must be a personal access token with push access github-token: ${{ secrets.AUTO_MERGE_TOKEN }} # By default, squash and merge, so Github chooses nice commit messages command: squash and merge ================================================ FILE: .github/workflows/test-and-release.yml ================================================ # This is a composition of lint and test scripts # Make sure to update this file along with the others name: Test and Release # Run this job on all pushes and pull requests # as well as tags with a semantic version on: push: branches: - '*' tags: # normal versions - "v?[0-9]+.[0-9]+.[0-9]+" # pre-releases - "v?[0-9]+.[0-9]+.[0-9]+-**" pull_request: {} # Cancel previous PR/branch runs when a new commit is pushed concurrency: group: ${{ github.ref }} cancel-in-progress: true permissions: id-token: write # Required for OIDC contents: write pull-requests: read jobs: # Performs quick checks before the expensive test runs check-and-lint: if: contains(github.event.head_commit.message, '[skip ci]') == false runs-on: ubuntu-latest strategy: matrix: node-version: [22.x] steps: - uses: actions/checkout@v5 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies run: npm ci # - name: Perform a type check # run: npm run check:ts # env: # CI: true # - name: Lint TypeScript code # run: npm run lint # - name: Test package files # run: npm run test:package # Runs adapter tests on all supported node versions and OSes adapter-tests: if: contains(github.event.head_commit.message, '[skip ci]') == false needs: [check-and-lint] runs-on: ${{ matrix.os }} strategy: matrix: node-version: [18.x, 20.x, 22.x, 24.x] os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v5 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies run: npm ci - name: Run local tests run: npm test # - name: Run unit tests # run: npm run test:unit # - name: Run integration tests # (linux/osx) # if: startsWith(runner.OS, 'windows') == false # run: DEBUG=testing:* npm run test:integration # - name: Run integration tests # (windows) # if: startsWith(runner.OS, 'windows') # run: set DEBUG=testing:* & npm run test:integration # Deploys the final package to NPM deploy: needs: [adapter-tests] # Trigger this step only when a commit on master is tagged with a version number if: | contains(github.event.head_commit.message, '[skip ci]') == false && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest strategy: matrix: node-version: [22.x] steps: - name: Checkout code uses: actions/checkout@v5 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - name: Extract the version and commit body from the tag shell: bash id: extract_release # The body may be multiline, therefore newlines and % need to be escaped run: | VERSION="${{ github.ref }}" VERSION=${VERSION##*/v} echo "VERSION=$VERSION" >> $GITHUB_OUTPUT EOF=$(od -An -N6 -x /dev/urandom | tr -d ' ') BODY=$(git show -s --format=%b) echo "BODY<<$EOF" >> $GITHUB_OUTPUT echo "$BODY" >> $GITHUB_OUTPUT echo "$EOF" >> $GITHUB_OUTPUT if [[ $VERSION == *"-"* ]] ; then echo "TAG=--tag next" >> $GITHUB_OUTPUT fi - name: Install Dependencies run: npm ci # - name: Create a clean build # run: npm run build - name: Publish package to npm run: | npm install -g npm@latest npm publish ${{ steps.extract_release.outputs.TAG }} - name: Create Github Release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} name: Release v${{ steps.extract_release.outputs.VERSION }} draft: false # Prerelease versions create prereleases on Github prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }} body: ${{ steps.extract_release.outputs.BODY }} - name: Notify Sentry.io about the release run: | npm i -g @sentry/cli export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} export SENTRY_URL=https://sentry.iobroker.net export SENTRY_ORG=iobroker export SENTRY_PROJECT=iobroker-alexa2 export SENTRY_VERSION=iobroker.alexa2@${{ steps.extract_release.outputs.VERSION }} sentry-cli releases new $SENTRY_VERSION sentry-cli releases set-commits $SENTRY_VERSION --auto sentry-cli releases finalize $SENTRY_VERSION # Add the following line BEFORE finalize if sourcemap uploads are needed # sentry-cli releases files $SENTRY_VERSION upload-sourcemaps build/ ================================================ FILE: .gitignore ================================================ # Created by .ignore support plugin (hsz.mobi) ### Node template # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* # Runtime data pids *.pid *.seed *.pid.lock admin/i18n/flat.txt admin/i18n/*/flat.txt # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Typescript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .idea # ioBroker dev-server .dev-server/ # Test temporary files tmp/ #ignore .commitinfo created by ioBroker release script .commitinfo ================================================ FILE: .mocharc.json ================================================ { "require": [ "./test/mocha.setup.js" ] } ================================================ FILE: .npmignore ================================================ # exclude all dot-files and directories .* admin/i18n tasks node_modules .idea .git /node_modules test .travis.yml appveyor.yml .github package-lock.json .gitattributes ================================================ FILE: .releaseconfig.json ================================================ { "plugins": ["iobroker", "license"] } ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2018-2025 Ingo Fischer , 2017-2018 soef Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ ![Logo](admin/alexa.png) # ioBroker.alexa2 ![Number of Installations](http://iobroker.live/badges/alexa2-installed.svg) ![Number of Installations](http://iobroker.live/badges/alexa2-stable.svg) [![NPM version](http://img.shields.io/npm/v/iobroker.alexa2.svg)](https://www.npmjs.com/package/iobroker.alexa2) ![Test and Release](https://github.com/Apollon77/iobroker.alexa2/workflows/Test%20and%20Release/badge.svg) [![Translation status](https://weblate.iobroker.net/widgets/adapters/-/alexa2/svg-badge.svg)](https://weblate.iobroker.net/engage/adapters/?utm_source=widget) [![Downloads](https://img.shields.io/npm/dm/iobroker.alexa2.svg)](https://www.npmjs.com/package/iobroker.alexa2) **This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0. This adapter allows you to remotely control your Alexa (Amazon Echo) devices. Big thanks go to soef for version 1 of the adapter and to Hauke and ruhr70 for ideas in their scripts from ioBroker-Forum (especially the media progress updates)! Also, big thanks to meicker for support in documenting all of this and numerous users from ioBroker Forum for their testing support! ## Disclaimer **All product and company names or logos are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them or any associated subsidiaries! This personal project is maintained in spare time and has no business goal.** **ALEXA is a trademark of AMAZON TECHNOLOGIES, INC.** ## States and their meanings: In the adapter namespace (e.g., alexa2.0) some channels are created ### alexa2.0 | State name | meaning | |----------------------|--------------------------------------------------------| | Echo-Devices.* | States per Echo device, see below | | History.* | Infos for command history, see below | | Smart-Home-Devices.* | States per smart home device and in general, see below | | info.* | General information about the adapter status | | requestResult | Error info for TuneIn and smart-home device requests | ### alexa2.0.Contacts.ContactId.* All Alexa-Contacts that can be used to send Text Messages to, including himself. The own contact gets a special "(Self)" after his name. | State name | meaning | |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------| | #clearOwnMessages | Only exists in own contact and a trigger deletes all messages that are send to himself (also includes messages to himself via App or devices!) | | textMessage | Sends this text as message to the user. It is shown on all devices of this user with a "yellow ring" | ### alexa2.0.Echo-Devices.CommandsAll.* Commands to be sent to all devices in the account. | State name | meaning | Comments | |--------------------|-------------------------------------------------|--------------------------------------------------------------------------------------------------------------| | deviceStop | Stop all actions on device | Button | | deviceDoNotDisturb | Switch on/off "Do not Disturb" for all devices. | true/false, or number in seconds to enable (max 12h) or string in form "HH:MM" until this time it is enabled | ### alexa2.0.Echo-Devices.Serialnumber.* Under "echo-devices" every amazon echo device is listed with its serial number. Not every device shows all the states. Every device has its own states as described below: ### alexa2.0.Echo-Devices.Serialnumber.Alarm.* Alarm (Wecker) settings for each device, if available. | State name | meaning | value | |-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | .customVolume | Set a custom Volume for this Reminder. The volume is set 2s before the reminder triggers and re-set to the value before as soon as the timer is (or adapter thinks!) stopped - latest after 120s! When custom volumes and trigger times overlap it will be restored at the end once! | Number 0..100 | | .date | Overwrite the date for existing alarm to set a new date for this alarm. In case you have an existing alarm you can change the date here by simply overwrite the time in format YYYY-MM-DD. Might have no effect when multiple-times-per-day recurring settings were used! | Date Output | | .delete | Button to delete the Alarm | delete with true | | .enabled | Shows status of alarm and allows to change it: Activate alarm with true - Deactivate alarm with false | true / false | | .musicEntity | Shows the track info if this alarm is a music alarm | String or null | | .musicProvider | Shows the provider of the music if this alarm is a music alarm | String or null | | .nextTriggerDate | Contains the timepoint of the next expected triggering as unix epoch in ms | Number | | .recurringDays | Shows the list of days configured if the Alarm has recurring settings | US notation of weekdays (e.g. MO,TU,WE,TH,FR,SA,SU) | | .recurringPattern | Shows the recurring pattern of alarm | 0 = one time, no recurring
P1D = daily
XXXX-WD = on weekdays
XXXX-WE = on weekends
XXXX-WXX-1 = every monday
XXXX-WXX-2 = every tuesday
XXXX-WXX-3 = every wednesday
XXXX-WXX-4 = every thursday
XXXX-WXX-5 = every friday
XXXX-WXX-6 = every saturday
XXXX-WXX-7 = every sunday | | .snoozed | true if the Alarm is snoozed at the moment | true/false | | .sound | Contains the set sound for this alarm. Can be changed. Also changing between music sound entry and "build in sounds" is possible. | ID from list | | .time | Time for alarm. Overwrite the time for existing alarm to set a new time for this alarm. In case you have an existing alarm you can change the time here by simply overwrite the time in format hh:mm:ss, seconds are not needed to set. Might have no effect when multiple-times-per-day recurring settings were used! | Time Input | | .triggered | true if alarm is reached and triggered. Clock must be in sync with Amazon and iobroker, Use this to trigger other action as soon as the alarm time is reached | true / false | | New | Data to create a new Reminder as String in following format separated by ; as "timestamp;[label];[sound];[recurring]. timestamp as unix timestamp in ms, label as Text, sound as sound ID, recurring either empty for once, "DAILY" for daily or "WEEKLY=MO,TU,WE,TH,FR,SA,SU" with comma separated weekly day list. Fields in example above in brackets mean that they are optional! | String | | triggered | ID of the Alarm that triggered last on this device | ID | When changing an Alarm does not work, please make sure that the Alarm timepoint is in the future - so changing e.g. "sound" on an Alarm in the past will _not_ work! ### alexa2.0.Echo-Devices.Serialnumber.Bluetooth.* Here you find all connected or known bluetooth device(s) with MAC address(es). The states of each device: | State name | meaning | |------------|----------------------------------------------------------------------------------------------------| | connected | Shows current connection status and allow connection (set to true) or disconnection (set to false) | | unpair | Button to unpair this device from the echo device | ### alexa2.0.Echo-Devices.Serialnumber.Commands.* With Commands, you can trigger some actions on your Alexa-Device. If you use these on a multiroom device, then they are executed independently and *will not* run in sync on the single devices! | State name | meaning | value | |---------------|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| | doNotDisturb | Switch on/off "Do not Disturb" for this device or group. Value is updated with Device Configuration updates from Cloud too | true/false, or number in seconds to enable (max 12h) or string in form "HH:MM" until this time it is enabled | | flashbriefing | Briefing in 100 seconds - news etc.pp | Button | | goodmorning | Good morning from Alexa ... | Button | | funfact | Fun fact from Alexa ... (Only USA at the moment) | Button | | joke | Joke from Alexa ... | Button | | cleanup | Plays a "gong" tone like for start/end of listening mode ... | Button | | curatedtts | Random sentence from the chosen area from Alexa ... | Text (allowed: "goodbye", "confirmations", "goodmorning", "compliments", "birthday", "goodnight", "iamhome") | | singasong | Alexa sings a song ... | Button | | speak | Alexa says what you type in here ... | Text Input | | speakvolume | Adjust the speak volume of Alexa, this volume is set before the speak and reset afterwards | 0-100 | | skill | Launch a defined Skill | Skill-ID as String | | skillYours | launch a defined Skill - is prefilled with "Your Skills" as displayed in Alexa App too | Skill-ID as String | | tellstory | Alexa tells a story | Button | | traffic | Traffic news | Button | | weather | Weather news | Button | | deviceStop | Stop all actions on device | Button | | notification | Send text notification to customer of the device | Text, optionally specify title "title;text" | | announcement | Play announcement (like speak but with Bing before text)
*Note: will only work if announcements (for this device) are activated and the device is not in "do not disturb"-mode* | Text | | ssml | Speak SSML XML string
*Note: will only work if announcements (for this device) are activated and the device is not in "do not disturb"-mode* | Text | | textcommand | Send a Text command to Alexa,. Make sure to only use text (e.g. also 3 -> three and such, else Alexa might not correctly react to it!) | Text | | sound | Play a sound on the device. | Text | Detailed information Speak and Announcement: Type in here what you want Alexa to say. You can also adjust the volume of Alexa by giving a percentage before your text. Example: 10;Alexa is saying Alexa with 10% volume, while 100;Alexa is 100% volume. Normally, you only can send 250 characters per speak command. By using the semicolon, it is possible to write as much as you want, as long as you separate 250 characters with a semicolon. Alexa will then speak the text after each other with a small break. You also can use the volume together with more 255 blocks by writing #Volume;#Block1;#Block2, a.s.o A volume set here will be used over a defined speak-volume. Partially also sounds from https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html work. Specify in speak or ssml as `