├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ └── ha-lint.yml ├── .gitignore ├── .vscodeignore ├── README.md ├── diyhue-beta ├── CHANGELOG.md ├── DOCS.md ├── Dockerfile ├── LICENSE.md ├── README.md ├── build.json ├── config.json ├── icon.png ├── logo.png └── rootfs │ ├── run.sh │ └── select.sh ├── diyhue ├── CHANGELOG.md ├── DOCS.md ├── Dockerfile ├── LICENSE.md ├── README.md ├── build.json ├── config.json ├── icon.png ├── logo.png └── rootfs │ ├── run.sh │ └── select.sh ├── images ├── diyHue-logo-dev.svg ├── diyhue-hassio.png └── logo-small.svg └── repository.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: maxbec 2 | custom: ["https://www.paypal.com/donate?hosted_button_id=S95PWMZ3S6WJU"] 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | -------------------------------------------------------------------------------- /.github/workflows/ha-lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | on: [push, pull_request] 3 | jobs: 4 | build: 5 | name: Add-on configuration 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: ⤵️ Check out code from GitHub 9 | uses: actions/checkout@v2.3.4 10 | - name: 🚀 Run Home Assistant Add-on Lint 11 | uses: frenck/action-addon-linter@v2.2 12 | with: 13 | path: "./diyhue" 14 | - name: 🚀 Run Home Assistant Add-on Lint for BETA 15 | uses: frenck/action-addon-linter@v2.2 16 | with: 17 | path: "./diyhue-beta" 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Own custom entries ### 2 | *.vsix 3 | *.todo 4 | *.zip 5 | **/out 6 | 7 | ### General generated List 8 | 9 | # Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode 10 | # Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,visualstudiocode 11 | 12 | ### Linux ### 13 | *~ 14 | 15 | # temporary files which can be created if a process still has a handle open of a deleted file 16 | .fuse_hidden* 17 | 18 | # KDE directory preferences 19 | .directory 20 | 21 | # Linux trash folder which might appear on any partition or disk 22 | .Trash-* 23 | 24 | # .nfs files are created when an open file is removed but is still being accessed 25 | .nfs* 26 | 27 | ### macOS ### 28 | # General 29 | .DS_Store 30 | .AppleDouble 31 | .LSOverride 32 | 33 | # Icon must end with two \r 34 | Icon 35 | 36 | # Thumbnails 37 | ._* 38 | 39 | # Files that might appear in the root of a volume 40 | .DocumentRevisions-V100 41 | .fseventsd 42 | .Spotlight-V100 43 | .TemporaryItems 44 | .Trashes 45 | .VolumeIcon.icns 46 | .com.apple.timemachine.donotpresent 47 | 48 | # Directories potentially created on remote AFP share 49 | .AppleDB 50 | .AppleDesktop 51 | Network Trash Folder 52 | Temporary Items 53 | .apdisk 54 | 55 | ### Node ### 56 | # Logs 57 | logs 58 | *.log 59 | npm-debug.log* 60 | yarn-debug.log* 61 | yarn-error.log* 62 | lerna-debug.log* 63 | 64 | # Diagnostic reports (https://nodejs.org/api/report.html) 65 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 66 | 67 | # Runtime data 68 | pids 69 | *.pid 70 | *.seed 71 | *.pid.lock 72 | 73 | # Directory for instrumented libs generated by jscoverage/JSCover 74 | lib-cov 75 | 76 | # Coverage directory used by tools like istanbul 77 | coverage 78 | *.lcov 79 | 80 | # nyc test coverage 81 | .nyc_output 82 | 83 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 84 | .grunt 85 | 86 | # Bower dependency directory (https://bower.io/) 87 | bower_components 88 | 89 | # node-waf configuration 90 | .lock-wscript 91 | 92 | # Compiled binary addons (https://nodejs.org/api/addons.html) 93 | build/Release 94 | 95 | # Dependency directories 96 | **/node_modules/ 97 | jspm_packages/ 98 | 99 | # TypeScript v1 declaration files 100 | typings/ 101 | 102 | # TypeScript cache 103 | *.tsbuildinfo 104 | 105 | # Optional npm cache directory 106 | .npm 107 | 108 | # Optional eslint cache 109 | .eslintcache 110 | 111 | # Optional REPL history 112 | .node_repl_history 113 | 114 | # Output of 'npm pack' 115 | *.tgz 116 | 117 | # Yarn Integrity file 118 | .yarn-integrity 119 | 120 | # dotenv environment variables file 121 | .env 122 | .env.test 123 | 124 | # parcel-bundler cache (https://parceljs.org/) 125 | .cache 126 | 127 | # next.js build output 128 | .next 129 | 130 | # nuxt.js build output 131 | .nuxt 132 | 133 | # react / gatsby 134 | public/ 135 | 136 | # vuepress build output 137 | .vuepress/dist 138 | 139 | # Serverless directories 140 | .serverless/ 141 | 142 | # FuseBox cache 143 | .fusebox/ 144 | 145 | # DynamoDB Local files 146 | .dynamodb/ 147 | 148 | ### VisualStudioCode ### 149 | .vscode/* 150 | !.vscode/settings.json 151 | !.vscode/tasks.json 152 | !.vscode/launch.json 153 | !.vscode/extensions.json 154 | 155 | ### VisualStudioCode Patch ### 156 | # Ignore all local history of files 157 | .history 158 | 159 | ### Windows ### 160 | # Windows thumbnail cache files 161 | Thumbs.db 162 | Thumbs.db:encryptable 163 | ehthumbs.db 164 | ehthumbs_vista.db 165 | 166 | # Dump file 167 | *.stackdump 168 | 169 | # Folder config file 170 | [Dd]esktop.ini 171 | 172 | # Recycle Bin used on file shares 173 | $RECYCLE.BIN/ 174 | 175 | # Windows Installer files 176 | *.cab 177 | *.msi 178 | *.msix 179 | *.msm 180 | *.msp 181 | 182 | # Windows shortcuts 183 | *.lnk 184 | 185 | # End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts 11 | ._* 12 | **/*.map 13 | ISSUE_TEMPLATE.md 14 | CONTRIBUTING.md 15 | LICENSE.md 16 | AUTHORS -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |

Home Assistant Add-on: diyHue

4 |
5 |

Run diyHue as a Home Assistant Add-on

6 |
7 | 8 | ## About 9 | 10 | diyHue provides a Ecosystem for several Smart Home Solutions, eliminating the need for vendor specific Bridges and Hardware. Written in Python and Open Source, you are now able to import and control all your Lights and Sensors into one System. Lightweight and resource friendly, to run on small 11 | devices like the RPi .... 24/7 12 | 13 | The Best part? No Cloud connection by Design! 14 | 15 | Enjoy your diyHue enlighted Home. 16 | 17 | If you've found the Add-on helpful or useful, then please consider throwing a coffee my way to help support my work. As i am a student and would like to invest more time and effort in this project this would really help me: 18 | 19 | [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C01XTXB) 20 | 21 | [![paypal](https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=S95PWMZ3S6WJU) 22 | 23 | This repo is not longer maintained. It was integrated into the official diyhue project. 24 | You find it here: https://github.com/diyhue/hassio-addon 25 | -------------------------------------------------------------------------------- /diyhue-beta/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 4 | 5 | 6 | ## [1.4.1 - 05.04.2021] 7 | 8 | ### Changed 9 | 10 | - Deleted the host_network entry in the config.json. #16 11 | 12 | ### Fixed 13 | - Added changes from the diyhue flask repo. web-ui is now flaskUI. 14 | 15 | ## [1.4.0 - 25.3.2021] 16 | 17 | ### Added 18 | 19 | - Updated the diyhue version to the latest master branch. 20 | 21 | ## [1.3.2 - 8.02.2021] 22 | 23 | ### Fixed 24 | 25 | - Issue with alpine apk commands. Results in docker build error. 26 | 27 | ## [1.3.1 - 18.01.2021] 28 | 29 | ### Fixed 30 | 31 | - Issue with https connection. Hassio doesn't allow to use SSL with websocket at the moment. 32 | 33 | ### Added 34 | 35 | - Option to force no https usage with `no-serve-https: true` 36 | 37 | ## [1.2.0 - 30.12.2020 38 | 39 | Changes to the config.json creation and saving procedure. 40 | 41 | ### Fixed 42 | 43 | - Correct creation of the config.json 44 | - Correct path of the config.json 45 | 46 | ## [1.1.0] - 26.12.2020 47 | 48 | Big update for the Add-on. diyHue moved there default branch from master-refactor to master. With this change there is a completely new folder structure. So there was the need do adapt this Add-on as well. 49 | 50 | ### Fixed 51 | 52 | - Minor fixes for the final release of the Add-on. 53 | 54 | ### Added 55 | 56 | - Merged the whole Add-on to the new master branch of diyhue. 57 | - New Readme file for the repository and the Add-on 58 | - New logo specifically for the hassio Add-on 59 | -------------------------------------------------------------------------------- /diyhue-beta/DOCS.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Add-on: diyHue 2 | 3 | The Home Assistant diyHue Add-on allows users to run a fully working diyHue instance right inside Home Assistant. So there is no more need for running a separate instance of diyHue on a separate device. With this Add-on you can manage all your Philips Hue lightbulbs, sensors and switches together 4 | with some third-party devices right from inside Home Assistant. 5 | 6 | ## Installation 7 | 8 | The installation process is pretty easy and straight forward, like for any other third-party Home Assistang Add-on. 9 | 10 | Add the repository URL under **Supervisor → Add-on store → ⋮ → Manage add-on repositories**: 11 | 12 | https://github.com/MaxBec/diyHue-hassio 13 | 14 | The repository includes two add-ons: 15 | 16 | - **diyHue** is a stable release that tracks the released versions of diyHue. 17 | - **diyHue-beta** tracks the `dev` branch of diyHue, so you can install the edge version if there are features or fixes in the dev branch that are not yet released. _NOT AVAILABLE YET_ 18 | 19 | ## Configuration 20 | 21 | **Note**: _Remember to restart the add-on when the configuration is changed._ 22 | 23 | Example add-on configuration: 24 | 25 | ```yaml 26 | config_path: /config/diyhue 27 | mac: "XX:XX:XX:XX:XX:XX" 28 | debug: true 29 | no-serve-https: false 30 | deconz_ip: 192.168.0.0 31 | ``` 32 | 33 | **Note**: _This is just an example, don't copy and paste it! Create your own!_ 34 | 35 | ### Option: `config_path` 36 | 37 | The `config_path` option controls the folder where your diyHue config gets stored. It has to start with **/config** and i highly recommend to name the folder **/config/diyhue**. 38 | 39 | ### Option: `mac` 40 | 41 | The mac-address of your device. 42 | 43 | **Note**: You have to stick to this format `XX:XX:XX:XX:XX:XX`. 44 | 45 | ### Option: `debug` 46 | 47 | If you turn the debug option to true you will get extended logs in the output section of the add-on. 48 | 49 | Valid values: `false`, `true`. 50 | 51 | ### Option: `no-serve-https` 52 | 53 | You have to set this value to true if you are running hassio under https. Hassio doesn't allow the usage of SSL on the websocket at the moment. So you have to force diyhue to not use https. 54 | 55 | Valid values: `false`, `true`. 56 | 57 | ### Option: `deconz_ip` 58 | 59 | Here you can enter the IP-Address of your Deconz instance. 60 | 61 | ## Known issues and limitations 62 | 63 | - No special limitations at the moment. ;) 64 | 65 | ## Changelog & Releases 66 | 67 | This repository keeps a change log using [GitHub's releases][releases] functionality. The format of the log is based on [Keep a Changelog][keepchangelog]. 68 | 69 | Releases are based on [Semantic Versioning][semver], and use the format of `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented based on the following: 70 | 71 | - `MAJOR`: Incompatible or major changes. 72 | - `MINOR`: Backwards-compatible new features and enhancements. 73 | - `PATCH`: Backwards-compatible bugfixes and package updates. 74 | 75 | ## Support 76 | 77 | Got questions? 78 | 79 | You have several options to get them answered: 80 | 81 | - The [Home Assistant Discord chat server][discord-ha] for general Home Assistant discussions and questions. 82 | - The Home Assistant [Community Forum][forum]. 83 | - The diyHue Discord Channel [diyHue Discord](https://diyhue.discourse.group) 84 | - The diyHue Slack Channel [diyHue Slack](https://join.slack.com/t/diyhue/shared_invite/enQtNzAwNDE1NDY2MzQxLTljNGMwZmE0OWRhNDIwM2FjOGM1ZTcxNjNmYjc5ZmE3MjZlNmNjMmUzYmRkZjhhOGNjOTc4NzA0MGVkYzE2NWM) 85 | 86 | You could also [open an issue here](https://github.com/MaxBec/hassio-diyHue/issues) GitHub. 87 | 88 | ## Authors & contributors 89 | 90 | The original setup of this repository is by Max Beckenbauer. 91 | 92 | For a full list of all authors and contributors, check credits section of the main README.md. 93 | 94 | [discord-ha]: https://discord.gg/c5DvZ4e 95 | [forum]: https://community.home-assistant.io 96 | [keepchangelog]: http://keepachangelog.com/en/1.0.0/ 97 | [releases]: https://github.com/diyhue/diyHue/releases 98 | [semver]: http://semver.org/spec/v2.0.0.htm 99 | -------------------------------------------------------------------------------- /diyhue-beta/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BUILD_FROM=hassioaddons/base-python:5.3.4 2 | # hadolint ignore=DL3006 3 | FROM ${BUILD_FROM} 4 | 5 | # Set shell 6 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] 7 | 8 | # Set the build architecture and convert it from hassio to diyhue style 9 | # armhf, armv7, aarch64, amd64, i386 10 | ARG BUILD_ARCH=aarch64 11 | ENV BUILD_ARCHI = ${BUILD_ARCH} 12 | 13 | # Other settings 14 | ENV LANG C.UTF-8 15 | ENV DIYHUE_VERSION=master 16 | ENV WORKING_DIR=/opt/hue-emulator 17 | 18 | # Create the needed folders 19 | RUN mkdir diyhue config ${WORKING_DIR} 20 | 21 | # Install all needed dependencies 22 | RUN apk add -q -u python3 openssl nmap psmisc iproute2 alpine-sdk build-base 23 | 24 | # Download diyhue and untar it 25 | RUN curl -J -L -o $diyhue.tar.gz "https://github.com/diyhue/diyHue/archive/refs/heads/beta.tar.gz" \ 26 | && tar xzvf $diyhue.tar.gz --strip-components=1 -C diyhue \ 27 | && rm -rf $diyhue.tar.gz \ 28 | && pip3 install -r /diyhue/requirements.txt --no-cache-dir 29 | 30 | # Set working directory to the Archive folder 31 | WORKDIR /opt/hue-emulator 32 | 33 | # Install diyHue 34 | RUN mv /diyhue/BridgeEmulator/HueObjects/ ./HueObjects/ 35 | RUN mv /diyhue/BridgeEmulator/configManager/ ./configManager/ 36 | RUN mv /diyhue/BridgeEmulator/flaskUI/ ./flaskUI/ 37 | RUN mv /diyhue/BridgeEmulator/functions/ ./functions/ 38 | RUN mv /diyhue/BridgeEmulator/lights/ ./lights/ 39 | RUN mv /diyhue/BridgeEmulator/logManager/ ./logManager/ 40 | RUN mv /diyhue/BridgeEmulator/sensors/ ./sensors/ 41 | RUN mv /diyhue/BridgeEmulator/services/ ./services/ 42 | RUN mv /diyhue/BridgeEmulator/HueEmulator3.py ./ 43 | RUN mv /diyhue/BridgeEmulator/genCert.sh /diyhue/BridgeEmulator/openssl.conf ./ 44 | 45 | # Copy additional local build files 46 | COPY rootfs ./ 47 | 48 | # Modify user rights of additional files 49 | RUN chmod +x ./select.sh ./genCert.sh && chmod a+x ./run.sh 50 | 51 | # Sleect the right binaries depending on the arch 52 | RUN ./select.sh 53 | 54 | # Build arguments 55 | ARG BUILD_DATE 56 | ARG BUILD_REF 57 | ARG BUILD_VERSION 58 | 59 | ## Document volume 60 | VOLUME ["/config"] 61 | 62 | # Labels 63 | LABEL \ 64 | io.hass.name="diyHue" \ 65 | io.hass.description="Fully configurable Philips Hue emulator" \ 66 | io.hass.arch="${BUILD_ARCH}" \ 67 | io.hass.type="addon" \ 68 | io.hass.version=${BUILD_VERSION} \ 69 | maintainer="Max Beckenbauer " \ 70 | org.opencontainers.image.title="diyHue" \ 71 | org.opencontainers.image.description="Fully configurable Philips Hue emulator" \ 72 | org.opencontainers.image.vendor="Max Beckenbauer" \ 73 | org.opencontainers.image.authors="Max Beckenbauer " \ 74 | org.opencontainers.image.licenses="MIT" \ 75 | org.opencontainers.image.url="" \ 76 | org.opencontainers.image.source="" \ 77 | org.opencontainers.image.documentation="" \ 78 | org.opencontainers.image.created=${BUILD_DATE} \ 79 | org.opencontainers.image.revision=${BUILD_REF} \ 80 | org.opencontainers.image.version=${BUILD_VERSION} 81 | 82 | CMD [ "./run.sh" ] 83 | -------------------------------------------------------------------------------- /diyhue-beta/LICENSE.md: -------------------------------------------------------------------------------- 1 | # Project Licenses 2 | - All code under the Lights directory is under the CC BY-NC 4.0 license. See: https://creativecommons.org/licenses/by-nc/4.0/ 3 | - The code contained in the BridgeEmulator and Sensors directory is under an Apache 2.0. A copy of the Apache 2.0 license is included in this file. 4 | - Images, documentation and PCB designs are under a CC BY-SA 4.0 license. See: https://creativecommons.org/licenses/by-sa/4.0/ 5 | 6 | 7 | 8 | ## Apache 2.0 License Text 9 | Apache License 10 | Version 2.0, January 2004 11 | http://www.apache.org/licenses/ 12 | 13 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 14 | 15 | 1. Definitions. 16 | 17 | "License" shall mean the terms and conditions for use, reproduction, 18 | and distribution as defined by Sections 1 through 9 of this document. 19 | 20 | "Licensor" shall mean the copyright owner or entity authorized by 21 | the copyright owner that is granting the License. 22 | 23 | "Legal Entity" shall mean the union of the acting entity and all 24 | other entities that control, are controlled by, or are under common 25 | control with that entity. For the purposes of this definition, 26 | "control" means (i) the power, direct or indirect, to cause the 27 | direction or management of such entity, whether by contract or 28 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 29 | outstanding shares, or (iii) beneficial ownership of such entity. 30 | 31 | "You" (or "Your") shall mean an individual or Legal Entity 32 | exercising permissions granted by this License. 33 | 34 | "Source" form shall mean the preferred form for making modifications, 35 | including but not limited to software source code, documentation 36 | source, and configuration files. 37 | 38 | "Object" form shall mean any form resulting from mechanical 39 | transformation or translation of a Source form, including but 40 | not limited to compiled object code, generated documentation, 41 | and conversions to other media types. 42 | 43 | "Work" shall mean the work of authorship, whether in Source or 44 | Object form, made available under the License, as indicated by a 45 | copyright notice that is included in or attached to the work 46 | (an example is provided in the Appendix below). 47 | 48 | "Derivative Works" shall mean any work, whether in Source or Object 49 | form, that is based on (or derived from) the Work and for which the 50 | editorial revisions, annotations, elaborations, or other modifications 51 | represent, as a whole, an original work of authorship. For the purposes 52 | of this License, Derivative Works shall not include works that remain 53 | separable from, or merely link (or bind by name) to the interfaces of, 54 | the Work and Derivative Works thereof. 55 | 56 | "Contribution" shall mean any work of authorship, including 57 | the original version of the Work and any modifications or additions 58 | to that Work or Derivative Works thereof, that is intentionally 59 | submitted to Licensor for inclusion in the Work by the copyright owner 60 | or by an individual or Legal Entity authorized to submit on behalf of 61 | the copyright owner. For the purposes of this definition, "submitted" 62 | means any form of electronic, verbal, or written communication sent 63 | to the Licensor or its representatives, including but not limited to 64 | communication on electronic mailing lists, source code control systems, 65 | and issue tracking systems that are managed by, or on behalf of, the 66 | Licensor for the purpose of discussing and improving the Work, but 67 | excluding communication that is conspicuously marked or otherwise 68 | designated in writing by the copyright owner as "Not a Contribution." 69 | 70 | "Contributor" shall mean Licensor and any individual or Legal Entity 71 | on behalf of whom a Contribution has been received by Licensor and 72 | subsequently incorporated within the Work. 73 | 74 | 2. Grant of Copyright License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | copyright license to reproduce, prepare Derivative Works of, 78 | publicly display, publicly perform, sublicense, and distribute the 79 | Work and such Derivative Works in Source or Object form. 80 | 81 | 3. Grant of Patent License. Subject to the terms and conditions of 82 | this License, each Contributor hereby grants to You a perpetual, 83 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 84 | (except as stated in this section) patent license to make, have made, 85 | use, offer to sell, sell, import, and otherwise transfer the Work, 86 | where such license applies only to those patent claims licensable 87 | by such Contributor that are necessarily infringed by their 88 | Contribution(s) alone or by combination of their Contribution(s) 89 | with the Work to which such Contribution(s) was submitted. If You 90 | institute patent litigation against any entity (including a 91 | cross-claim or counterclaim in a lawsuit) alleging that the Work 92 | or a Contribution incorporated within the Work constitutes direct 93 | or contributory patent infringement, then any patent licenses 94 | granted to You under this License for that Work shall terminate 95 | as of the date such litigation is filed. 96 | 97 | 4. Redistribution. You may reproduce and distribute copies of the 98 | Work or Derivative Works thereof in any medium, with or without 99 | modifications, and in Source or Object form, provided that You 100 | meet the following conditions: 101 | 102 | (a) You must give any other recipients of the Work or 103 | Derivative Works a copy of this License; and 104 | 105 | (b) You must cause any modified files to carry prominent notices 106 | stating that You changed the files; and 107 | 108 | (c) You must retain, in the Source form of any Derivative Works 109 | that You distribute, all copyright, patent, trademark, and 110 | attribution notices from the Source form of the Work, 111 | excluding those notices that do not pertain to any part of 112 | the Derivative Works; and 113 | 114 | (d) If the Work includes a "NOTICE" text file as part of its 115 | distribution, then any Derivative Works that You distribute must 116 | include a readable copy of the attribution notices contained 117 | within such NOTICE file, excluding those notices that do not 118 | pertain to any part of the Derivative Works, in at least one 119 | of the following places: within a NOTICE text file distributed 120 | as part of the Derivative Works; within the Source form or 121 | documentation, if provided along with the Derivative Works; or, 122 | within a display generated by the Derivative Works, if and 123 | wherever such third-party notices normally appear. The contents 124 | of the NOTICE file are for informational purposes only and 125 | do not modify the License. You may add Your own attribution 126 | notices within Derivative Works that You distribute, alongside 127 | or as an addendum to the NOTICE text from the Work, provided 128 | that such additional attribution notices cannot be construed 129 | as modifying the License. 130 | 131 | You may add Your own copyright statement to Your modifications and 132 | may provide additional or different license terms and conditions 133 | for use, reproduction, or distribution of Your modifications, or 134 | for any such Derivative Works as a whole, provided Your use, 135 | reproduction, and distribution of the Work otherwise complies with 136 | the conditions stated in this License. 137 | 138 | 5. Submission of Contributions. Unless You explicitly state otherwise, 139 | any Contribution intentionally submitted for inclusion in the Work 140 | by You to the Licensor shall be under the terms and conditions of 141 | this License, without any additional terms or conditions. 142 | Notwithstanding the above, nothing herein shall supersede or modify 143 | the terms of any separate license agreement you may have executed 144 | with Licensor regarding such Contributions. 145 | 146 | 6. Trademarks. This License does not grant permission to use the trade 147 | names, trademarks, service marks, or product names of the Licensor, 148 | except as required for reasonable and customary use in describing the 149 | origin of the Work and reproducing the content of the NOTICE file. 150 | 151 | 7. Disclaimer of Warranty. Unless required by applicable law or 152 | agreed to in writing, Licensor provides the Work (and each 153 | Contributor provides its Contributions) on an "AS IS" BASIS, 154 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 155 | implied, including, without limitation, any warranties or conditions 156 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 157 | PARTICULAR PURPOSE. You are solely responsible for determining the 158 | appropriateness of using or redistributing the Work and assume any 159 | risks associated with Your exercise of permissions under this License. 160 | 161 | 8. Limitation of Liability. In no event and under no legal theory, 162 | whether in tort (including negligence), contract, or otherwise, 163 | unless required by applicable law (such as deliberate and grossly 164 | negligent acts) or agreed to in writing, shall any Contributor be 165 | liable to You for damages, including any direct, indirect, special, 166 | incidental, or consequential damages of any character arising as a 167 | result of this License or out of the use or inability to use the 168 | Work (including but not limited to damages for loss of goodwill, 169 | work stoppage, computer failure or malfunction, or any and all 170 | other commercial damages or losses), even if such Contributor 171 | has been advised of the possibility of such damages. 172 | 173 | 9. Accepting Warranty or Additional Liability. While redistributing 174 | the Work or Derivative Works thereof, You may choose to offer, 175 | and charge a fee for, acceptance of support, warranty, indemnity, 176 | or other liability obligations and/or rights consistent with this 177 | License. However, in accepting such obligations, You may act only 178 | on Your own behalf and on Your sole responsibility, not on behalf 179 | of any other Contributor, and only if You agree to indemnify, 180 | defend, and hold each Contributor harmless for any liability 181 | incurred by, or claims asserted against, such Contributor by reason 182 | of your accepting any such warranty or additional liability. 183 | -------------------------------------------------------------------------------- /diyhue-beta/README.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Add-on: diyHue 2 | 3 | diyHue adds a fully compatible Philips Hue emulator to Home-Assistant. 4 | 5 | ## About 6 | 7 | This project emulates a Philips Hue Bridge that is able to control ZigBee lights (using Raspbee module, original Hue Bridge or IKEA Trådfri Gateway), Mi-Light bulbs (using MiLight Hub), Neopixel strips (WS2812B and SK6812) and any cheap ESP8266 based bulb by replacing the firmware with a custom one. 8 | It is written in Python and will run on all small devices such as the Raspberry Pi. Arduino sketches are provided for the Hue Dimmer Switch, Hue Tap Switch and Hue Motion Sensor. Lights are two-way synchronized so any change made from original Philips/Trådfri sensors and switches will also be 9 | applied to the bridge emulator. 10 | 11 | If you've found the extension helpful or useful, then please consider throwing a coffee my way to help support my work. As i am a student and would like to invest more time and effort in this project this would really help me. 12 | 13 | [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C01XTXB) 14 | 15 | [![paypal](https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=S95PWMZ3S6WJU) 16 | 17 | ![diyHue ecosystem](https://raw.githubusercontent.com/diyhue/diyhue.github.io/master/assets/images/hue-map.png) 18 | 19 | ## Getting Started 20 | 21 | **See Documentation tab for more details.** 22 | 23 | ## Credits 24 | 25 | - Ben ([@cheesemarathon](https://github.com/cheesemarathon)) All fancy github integrations 26 | - [Stephan van Rooij](https://github.com/svrooij) - zigbee2mqtt integration 27 | - [@avinashraja98](https://github.com/avinashraja98) - Hue Entertainment server 28 | - Federico Zivolo ([@FezVrasta](https://github.com/FezVrasta)) Internal WebGUI 29 | - [@J3n50m4t](https://github.com/J3n50m4t) - Yeelight integration 30 | - Martin Černý ([@mcer12](https://github.com/mcer12)) - Yeelight color bulb 31 | - probonopd https://github.com/probonopd/ESP8266HueEmulator 32 | - sidoh https://github.com/sidoh/esp8266_milight_hub 33 | - StefanBruens https://github.com/StefanBruens/ESP8266_new_pwm 34 | - Cédric @ticed35 for linkbutton implementation 35 | - [@cheesemarathon](https://github.com/cheesemarathon) - Help with Docker images 36 | - [@Mevel](https://github.com/Mevel) - 433Mhz devices 37 | - [@Nikfinn99](https://github.com/Nikfinn99) - PCB designs 38 | - [@crankyoldgit](https://github.com/crankyoldgit) - IR Remote library 39 | -------------------------------------------------------------------------------- /diyhue-beta/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "build_from": { 3 | "aarch64": "hassioaddons/base-python-aarch64:5.3.4", 4 | "amd64": "hassioaddons/base-python-amd64:5.3.4", 5 | "armv7": "hassioaddons/base-python-armv7:5.3.4", 6 | "i386": "hassioaddons/base-python-i386:5.3.4" 7 | }, 8 | "args": { 9 | "network": "host" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /diyhue-beta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "diyHue Beta", 3 | "version": "1.5.0", 4 | "slug": "diyhue-beta-branch", 5 | "description": "Philips Hue Bridge Emulator BETA", 6 | "webui": "http://[HOST]:[PORT:80]", 7 | "panel_icon": "mdi:home-lightbulb", 8 | "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], 9 | "ports": { 10 | "80/tcp": 80, 11 | "443/tcp": 443, 12 | "1900/udp": 1901, 13 | "1982/udp": 1982, 14 | "2100/udp": 2100 15 | }, 16 | "ports_description": { 17 | "80/tcp": "Hue API", 18 | "443/tcp": "Hue API SSL", 19 | "1900/udp": "ssdp discover", 20 | "1982/udp": "Yeelight detection", 21 | "2100/udp": "Hue Entertainment" 22 | }, 23 | "auth_api": true, 24 | "hassio_api": true, 25 | "host_network": true, 26 | "uart": true, 27 | "map": ["config:rw", "share:rw"], 28 | "options": { 29 | "config_path": "/config/diyhue", 30 | "mac": "XX:XX:XX:XX:XX:XX", 31 | "debug": false, 32 | "deconz_ip": "", 33 | "no_serve_https": false 34 | }, 35 | "schema": { 36 | "config_path": "str", 37 | "mac": "str", 38 | "debug": "bool", 39 | "deconz_ip": "str", 40 | "no_serve_https": "bool" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /diyhue-beta/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxbec/hassio-diyHue/9e09dc4cda3df138228bad3f00aedbf9cbea6d1b/diyhue-beta/icon.png -------------------------------------------------------------------------------- /diyhue-beta/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxbec/hassio-diyHue/9e09dc4cda3df138228bad3f00aedbf9cbea6d1b/diyhue-beta/logo.png -------------------------------------------------------------------------------- /diyhue-beta/rootfs/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bashio 2 | 3 | CONFIG_PATH=/data/options.json 4 | 5 | export MAC="$(bashio::config 'mac')" 6 | export CONFIG_PATH="$(bashio::config 'config_path')" 7 | export DEBUG="$(bashio::config 'debug')" 8 | 9 | if [[ ! -z "$(bashio::config 'deconz_ip')" ]]; then 10 | export DECONZ="$(bashio::config 'deconz_ip')" 11 | fi 12 | 13 | export NO_SERVE_HTTPS="$(bashio::config 'no_serve_https')" 14 | 15 | if [[ -d $CONFIG_PATH ]]; then 16 | echo "$CONFIG_PATH exists." 17 | else 18 | mkdir -p $CONFIG_PATH 19 | echo "$CONFIG_PATH created." 20 | fi 21 | 22 | 23 | echo "Your Architecture is $BUILD_ARCHI" 24 | 25 | if [ "$NO_SERVE_HTTPS" = "true" ] ; then 26 | echo "No serve HTTPS" 27 | python3 -u /opt/hue-emulator/HueEmulator3.py --docker --no-serve-https 28 | else 29 | echo "Serve HTTPS" 30 | python3 -u /opt/hue-emulator/HueEmulator3.py --docker 31 | fi 32 | -------------------------------------------------------------------------------- /diyhue-beta/rootfs/select.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # echo "Target platform is: $TARGETPLATFORM" 4 | # Hassio: armhf, armv7, aarch64, amd64, i386 5 | 6 | case "$BUILD_ARCH" in 7 | "i386") SELECTED="i686" ;; 8 | "amd64") SELECTED="x86_64" ;; 9 | "armv7") SELECTED="arm" ;; 10 | "armhf") SELECTED="arm" ;; 11 | "aarch64") SELECTED="aarch64" ;; 12 | *) SELECTED="unsupported" ;; 13 | esac 14 | 15 | wget https://github.com/ARMmbed/mbedtls/archive/1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482.zip 16 | unzip 1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482.zip 17 | cd mbedtls-1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482/ 18 | wget https://raw.githubusercontent.com/mariusmotea/diyHue/master/BridgeEmulator/ssl_server2_diyhue.c 19 | make no_test 20 | gcc -I./include ssl_server2_diyhue.c -o ../entertain-srv -L./library -lmbedtls -lmbedx509 -lmbedcrypto 21 | cd .. 22 | 23 | rm -rf 1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482.zip 24 | rm -rf mbedtls-1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482 25 | 26 | # echo "Got file suffix: $SELECTED" 27 | #mv /diyhue/BridgeEmulator/entertainment-$SELECTED ./entertain-srv 28 | mv /diyhue/BridgeEmulator/coap-client-$SELECTED ./coap-client-linux 29 | 30 | # Fix permissions vor hue Entertain 31 | chmod +x ./entertain-srv 32 | chmod +x ./coap-client-linux 33 | 34 | 35 | # echo "Files in out folder" 36 | ls -la 37 | -------------------------------------------------------------------------------- /diyhue/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 4 | 5 | ## [1.4.1 - 05.04.2021] 6 | 7 | ### Changed 8 | 9 | - Deleted the host_network entry in the config.json. #16 10 | 11 | 12 | ## [1.4.0 - 25.3.2021] 13 | 14 | ### Added 15 | 16 | - Updated the diyhue version to the latest master branch. 17 | 18 | ## [1.3.2 - 8.02.2021] 19 | 20 | ### Fixed 21 | 22 | - Issue with alpine apk commands. Results in docker build error. 23 | 24 | ## [1.3.1 - 18.01.2021] 25 | 26 | ### Fixed 27 | 28 | - Issue with https connection. Hassio doesn't allow to use SSL with websocket at the moment. 29 | 30 | ### Added 31 | 32 | - Option to force no https usage with `no-serve-https: true` 33 | 34 | ## [1.2.0 - 30.12.2020 35 | 36 | Changes to the config.json creation and saving procedure. 37 | 38 | ### Fixed 39 | 40 | - Correct creation of the config.json 41 | - Correct path of the config.json 42 | 43 | ## [1.1.0] - 26.12.2020 44 | 45 | Big update for the Add-on. diyHue moved there default branch from master-refactor to master. With this change there is a completely new folder structure. So there was the need do adapt this Add-on as well. 46 | 47 | ### Fixed 48 | 49 | - Minor fixes for the final release of the Add-on. 50 | 51 | ### Added 52 | 53 | - Merged the whole Add-on to the new master branch of diyhue. 54 | - New Readme file for the repository and the Add-on 55 | - New logo specifically for the hassio Add-on 56 | -------------------------------------------------------------------------------- /diyhue/DOCS.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Add-on: diyHue 2 | 3 | The Home Assistant diyHue Add-on allows users to run a fully working diyHue instance right inside Home Assistant. So there is no more need for running a separate instance of diyHue on a separate device. With this Add-on you can manage all your Philips Hue lightbulbs, sensors and switches together 4 | with some third-party devices right from inside Home Assistant. 5 | 6 | ## Installation 7 | 8 | The installation process is pretty easy and straight forward, like for any other third-party Home Assistang Add-on. 9 | 10 | Add the repository URL under **Supervisor → Add-on store → ⋮ → Manage add-on repositories**: 11 | 12 | https://github.com/MaxBec/diyHue-hassio 13 | 14 | The repository includes two add-ons: 15 | 16 | - **diyHue** is a stable release that tracks the released versions of diyHue. 17 | - **diyHue-beta** tracks the `dev` branch of diyHue, so you can install the edge version if there are features or fixes in the dev branch that are not yet released. _NOT AVAILABLE YET_ 18 | 19 | ## Configuration 20 | 21 | **Note**: _Remember to restart the add-on when the configuration is changed._ 22 | 23 | Example add-on configuration: 24 | 25 | ```yaml 26 | config_path: /config/diyhue 27 | mac: "XX:XX:XX:XX:XX:XX" 28 | debug: true 29 | no-serve-https: false 30 | deconz_ip: 192.168.0.0 31 | ``` 32 | 33 | **Note**: _This is just an example, don't copy and paste it! Create your own!_ 34 | 35 | ### Option: `config_path` 36 | 37 | The `config_path` option controls the folder where your diyHue config gets stored. It has to start with **/config** and i highly recommend to name the folder **/config/diyhue**. 38 | 39 | ### Option: `mac` 40 | 41 | The mac-address of your device. 42 | 43 | **Note**: You have to stick to this format `XX:XX:XX:XX:XX:XX`. 44 | 45 | ### Option: `debug` 46 | 47 | If you turn the debug option to true you will get extended logs in the output section of the add-on. 48 | 49 | Valid values: `false`, `true`. 50 | 51 | ### Option: `no-serve-https` 52 | 53 | You have to set this value to true if you are running hassio under https. Hassio doesn't allow the usage of SSL on the websocket at the moment. So you have to force diyhue to not use https. 54 | 55 | Valid values: `false`, `true`. 56 | 57 | ### Option: `deconz_ip` 58 | 59 | Here you can enter the IP-Address of your Deconz instance. 60 | 61 | ## Known issues and limitations 62 | 63 | - No special limitations at the moment. ;) 64 | 65 | ## Changelog & Releases 66 | 67 | This repository keeps a change log using [GitHub's releases][releases] functionality. The format of the log is based on [Keep a Changelog][keepchangelog]. 68 | 69 | Releases are based on [Semantic Versioning][semver], and use the format of `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented based on the following: 70 | 71 | - `MAJOR`: Incompatible or major changes. 72 | - `MINOR`: Backwards-compatible new features and enhancements. 73 | - `PATCH`: Backwards-compatible bugfixes and package updates. 74 | 75 | ## Support 76 | 77 | Got questions? 78 | 79 | You have several options to get them answered: 80 | 81 | - The [Home Assistant Discord chat server][discord-ha] for general Home Assistant discussions and questions. 82 | - The Home Assistant [Community Forum][forum]. 83 | - The diyHue Discord Channel [diyHue Discord](https://diyhue.discourse.group) 84 | - The diyHue Slack Channel [diyHue Slack](https://join.slack.com/t/diyhue/shared_invite/enQtNzAwNDE1NDY2MzQxLTljNGMwZmE0OWRhNDIwM2FjOGM1ZTcxNjNmYjc5ZmE3MjZlNmNjMmUzYmRkZjhhOGNjOTc4NzA0MGVkYzE2NWM) 85 | 86 | You could also [open an issue here](https://github.com/MaxBec/hassio-diyHue/issues) GitHub. 87 | 88 | ## Authors & contributors 89 | 90 | The original setup of this repository is by Max Beckenbauer. 91 | 92 | For a full list of all authors and contributors, check credits section of the main README.md. 93 | 94 | [discord-ha]: https://discord.gg/c5DvZ4e 95 | [forum]: https://community.home-assistant.io 96 | [keepchangelog]: http://keepachangelog.com/en/1.0.0/ 97 | [releases]: https://github.com/diyhue/diyHue/releases 98 | [semver]: http://semver.org/spec/v2.0.0.htm 99 | -------------------------------------------------------------------------------- /diyhue/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BUILD_FROM=hassioaddons/base-python:5.3.4 2 | # hadolint ignore=DL3006 3 | FROM ${BUILD_FROM} 4 | 5 | # Set shell 6 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] 7 | 8 | # Set the build architecture and convert it from hassio to diyhue style 9 | # armhf, armv7, aarch64, amd64, i386 10 | ARG BUILD_ARCH=aarch64 11 | ENV BUILD_ARCHI = ${BUILD_ARCH} 12 | 13 | # Other settings 14 | ENV LANG C.UTF-8 15 | ENV DIYHUE_VERSION=master 16 | ENV WORKING_DIR=/opt/hue-emulator 17 | 18 | # Create the needed folders 19 | RUN mkdir diyhue config ${WORKING_DIR} 20 | 21 | # Install all needed dependencies 22 | RUN apk add -q -u python3 openssl nmap psmisc iproute2 alpine-sdk build-base 23 | 24 | # Download diyhue and untar it 25 | RUN curl -J -L -o $diyhue.tar.gz "https://github.com/diyhue/diyHue/archive/refs/heads/master.tar.gz" \ 26 | && tar xzvf $diyhue.tar.gz --strip-components=1 -C diyhue \ 27 | && rm -rf $diyhue.tar.gz \ 28 | && pip3 install -r /diyhue/requirements.txt --no-cache-dir 29 | 30 | # Set working directory to the Archive folder 31 | WORKDIR /opt/hue-emulator 32 | 33 | # Install diyHue 34 | RUN mv /diyhue/BridgeEmulator/web-ui/ ./web-ui/ 35 | RUN mv /diyhue/BridgeEmulator/functions/ ./functions/ 36 | RUN mv /diyhue/BridgeEmulator/protocols/ ./protocols/ 37 | RUN mv /diyhue/BridgeEmulator/HueEmulator3.py /diyhue/BridgeEmulator/debug/clip.html ./ 38 | RUN mv /diyhue/BridgeEmulator/genCert.sh /diyhue/BridgeEmulator/openssl.conf ./ 39 | 40 | # Copy additional local build files 41 | COPY rootfs ./ 42 | 43 | # Modify user rights of additional files 44 | RUN chmod +x ./select.sh ./genCert.sh && chmod a+x ./run.sh 45 | 46 | # Sleect the right binaries depending on the arch 47 | RUN ./select.sh 48 | 49 | # Build arguments 50 | ARG BUILD_DATE 51 | ARG BUILD_REF 52 | ARG BUILD_VERSION 53 | 54 | ## Document volume 55 | VOLUME ["/config"] 56 | 57 | # Labels 58 | LABEL \ 59 | io.hass.name="diyHue" \ 60 | io.hass.description="Fully configurable Philips Hue emulator" \ 61 | io.hass.arch="${BUILD_ARCH}" \ 62 | io.hass.type="addon" \ 63 | io.hass.version=${BUILD_VERSION} \ 64 | maintainer="Max Beckenbauer " \ 65 | org.opencontainers.image.title="diyHue" \ 66 | org.opencontainers.image.description="Fully configurable Philips Hue emulator" \ 67 | org.opencontainers.image.vendor="Max Beckenbauer" \ 68 | org.opencontainers.image.authors="Max Beckenbauer " \ 69 | org.opencontainers.image.licenses="MIT" \ 70 | org.opencontainers.image.url="" \ 71 | org.opencontainers.image.source="" \ 72 | org.opencontainers.image.documentation="" \ 73 | org.opencontainers.image.created=${BUILD_DATE} \ 74 | org.opencontainers.image.revision=${BUILD_REF} \ 75 | org.opencontainers.image.version=${BUILD_VERSION} 76 | 77 | CMD [ "./run.sh" ] 78 | -------------------------------------------------------------------------------- /diyhue/LICENSE.md: -------------------------------------------------------------------------------- 1 | # Project Licenses 2 | - All code under the Lights directory is under the CC BY-NC 4.0 license. See: https://creativecommons.org/licenses/by-nc/4.0/ 3 | - The code contained in the BridgeEmulator and Sensors directory is under an Apache 2.0. A copy of the Apache 2.0 license is included in this file. 4 | - Images, documentation and PCB designs are under a CC BY-SA 4.0 license. See: https://creativecommons.org/licenses/by-sa/4.0/ 5 | 6 | 7 | 8 | ## Apache 2.0 License Text 9 | Apache License 10 | Version 2.0, January 2004 11 | http://www.apache.org/licenses/ 12 | 13 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 14 | 15 | 1. Definitions. 16 | 17 | "License" shall mean the terms and conditions for use, reproduction, 18 | and distribution as defined by Sections 1 through 9 of this document. 19 | 20 | "Licensor" shall mean the copyright owner or entity authorized by 21 | the copyright owner that is granting the License. 22 | 23 | "Legal Entity" shall mean the union of the acting entity and all 24 | other entities that control, are controlled by, or are under common 25 | control with that entity. For the purposes of this definition, 26 | "control" means (i) the power, direct or indirect, to cause the 27 | direction or management of such entity, whether by contract or 28 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 29 | outstanding shares, or (iii) beneficial ownership of such entity. 30 | 31 | "You" (or "Your") shall mean an individual or Legal Entity 32 | exercising permissions granted by this License. 33 | 34 | "Source" form shall mean the preferred form for making modifications, 35 | including but not limited to software source code, documentation 36 | source, and configuration files. 37 | 38 | "Object" form shall mean any form resulting from mechanical 39 | transformation or translation of a Source form, including but 40 | not limited to compiled object code, generated documentation, 41 | and conversions to other media types. 42 | 43 | "Work" shall mean the work of authorship, whether in Source or 44 | Object form, made available under the License, as indicated by a 45 | copyright notice that is included in or attached to the work 46 | (an example is provided in the Appendix below). 47 | 48 | "Derivative Works" shall mean any work, whether in Source or Object 49 | form, that is based on (or derived from) the Work and for which the 50 | editorial revisions, annotations, elaborations, or other modifications 51 | represent, as a whole, an original work of authorship. For the purposes 52 | of this License, Derivative Works shall not include works that remain 53 | separable from, or merely link (or bind by name) to the interfaces of, 54 | the Work and Derivative Works thereof. 55 | 56 | "Contribution" shall mean any work of authorship, including 57 | the original version of the Work and any modifications or additions 58 | to that Work or Derivative Works thereof, that is intentionally 59 | submitted to Licensor for inclusion in the Work by the copyright owner 60 | or by an individual or Legal Entity authorized to submit on behalf of 61 | the copyright owner. For the purposes of this definition, "submitted" 62 | means any form of electronic, verbal, or written communication sent 63 | to the Licensor or its representatives, including but not limited to 64 | communication on electronic mailing lists, source code control systems, 65 | and issue tracking systems that are managed by, or on behalf of, the 66 | Licensor for the purpose of discussing and improving the Work, but 67 | excluding communication that is conspicuously marked or otherwise 68 | designated in writing by the copyright owner as "Not a Contribution." 69 | 70 | "Contributor" shall mean Licensor and any individual or Legal Entity 71 | on behalf of whom a Contribution has been received by Licensor and 72 | subsequently incorporated within the Work. 73 | 74 | 2. Grant of Copyright License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | copyright license to reproduce, prepare Derivative Works of, 78 | publicly display, publicly perform, sublicense, and distribute the 79 | Work and such Derivative Works in Source or Object form. 80 | 81 | 3. Grant of Patent License. Subject to the terms and conditions of 82 | this License, each Contributor hereby grants to You a perpetual, 83 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 84 | (except as stated in this section) patent license to make, have made, 85 | use, offer to sell, sell, import, and otherwise transfer the Work, 86 | where such license applies only to those patent claims licensable 87 | by such Contributor that are necessarily infringed by their 88 | Contribution(s) alone or by combination of their Contribution(s) 89 | with the Work to which such Contribution(s) was submitted. If You 90 | institute patent litigation against any entity (including a 91 | cross-claim or counterclaim in a lawsuit) alleging that the Work 92 | or a Contribution incorporated within the Work constitutes direct 93 | or contributory patent infringement, then any patent licenses 94 | granted to You under this License for that Work shall terminate 95 | as of the date such litigation is filed. 96 | 97 | 4. Redistribution. You may reproduce and distribute copies of the 98 | Work or Derivative Works thereof in any medium, with or without 99 | modifications, and in Source or Object form, provided that You 100 | meet the following conditions: 101 | 102 | (a) You must give any other recipients of the Work or 103 | Derivative Works a copy of this License; and 104 | 105 | (b) You must cause any modified files to carry prominent notices 106 | stating that You changed the files; and 107 | 108 | (c) You must retain, in the Source form of any Derivative Works 109 | that You distribute, all copyright, patent, trademark, and 110 | attribution notices from the Source form of the Work, 111 | excluding those notices that do not pertain to any part of 112 | the Derivative Works; and 113 | 114 | (d) If the Work includes a "NOTICE" text file as part of its 115 | distribution, then any Derivative Works that You distribute must 116 | include a readable copy of the attribution notices contained 117 | within such NOTICE file, excluding those notices that do not 118 | pertain to any part of the Derivative Works, in at least one 119 | of the following places: within a NOTICE text file distributed 120 | as part of the Derivative Works; within the Source form or 121 | documentation, if provided along with the Derivative Works; or, 122 | within a display generated by the Derivative Works, if and 123 | wherever such third-party notices normally appear. The contents 124 | of the NOTICE file are for informational purposes only and 125 | do not modify the License. You may add Your own attribution 126 | notices within Derivative Works that You distribute, alongside 127 | or as an addendum to the NOTICE text from the Work, provided 128 | that such additional attribution notices cannot be construed 129 | as modifying the License. 130 | 131 | You may add Your own copyright statement to Your modifications and 132 | may provide additional or different license terms and conditions 133 | for use, reproduction, or distribution of Your modifications, or 134 | for any such Derivative Works as a whole, provided Your use, 135 | reproduction, and distribution of the Work otherwise complies with 136 | the conditions stated in this License. 137 | 138 | 5. Submission of Contributions. Unless You explicitly state otherwise, 139 | any Contribution intentionally submitted for inclusion in the Work 140 | by You to the Licensor shall be under the terms and conditions of 141 | this License, without any additional terms or conditions. 142 | Notwithstanding the above, nothing herein shall supersede or modify 143 | the terms of any separate license agreement you may have executed 144 | with Licensor regarding such Contributions. 145 | 146 | 6. Trademarks. This License does not grant permission to use the trade 147 | names, trademarks, service marks, or product names of the Licensor, 148 | except as required for reasonable and customary use in describing the 149 | origin of the Work and reproducing the content of the NOTICE file. 150 | 151 | 7. Disclaimer of Warranty. Unless required by applicable law or 152 | agreed to in writing, Licensor provides the Work (and each 153 | Contributor provides its Contributions) on an "AS IS" BASIS, 154 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 155 | implied, including, without limitation, any warranties or conditions 156 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 157 | PARTICULAR PURPOSE. You are solely responsible for determining the 158 | appropriateness of using or redistributing the Work and assume any 159 | risks associated with Your exercise of permissions under this License. 160 | 161 | 8. Limitation of Liability. In no event and under no legal theory, 162 | whether in tort (including negligence), contract, or otherwise, 163 | unless required by applicable law (such as deliberate and grossly 164 | negligent acts) or agreed to in writing, shall any Contributor be 165 | liable to You for damages, including any direct, indirect, special, 166 | incidental, or consequential damages of any character arising as a 167 | result of this License or out of the use or inability to use the 168 | Work (including but not limited to damages for loss of goodwill, 169 | work stoppage, computer failure or malfunction, or any and all 170 | other commercial damages or losses), even if such Contributor 171 | has been advised of the possibility of such damages. 172 | 173 | 9. Accepting Warranty or Additional Liability. While redistributing 174 | the Work or Derivative Works thereof, You may choose to offer, 175 | and charge a fee for, acceptance of support, warranty, indemnity, 176 | or other liability obligations and/or rights consistent with this 177 | License. However, in accepting such obligations, You may act only 178 | on Your own behalf and on Your sole responsibility, not on behalf 179 | of any other Contributor, and only if You agree to indemnify, 180 | defend, and hold each Contributor harmless for any liability 181 | incurred by, or claims asserted against, such Contributor by reason 182 | of your accepting any such warranty or additional liability. 183 | -------------------------------------------------------------------------------- /diyhue/README.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Add-on: diyHue 2 | 3 | diyHue adds a fully compatible Philips Hue emulator to Home-Assistant. 4 | 5 | ## About 6 | 7 | This project emulates a Philips Hue Bridge that is able to control ZigBee lights (using Raspbee module, original Hue Bridge or IKEA Trådfri Gateway), Mi-Light bulbs (using MiLight Hub), Neopixel strips (WS2812B and SK6812) and any cheap ESP8266 based bulb by replacing the firmware with a custom one. 8 | It is written in Python and will run on all small devices such as the Raspberry Pi. Arduino sketches are provided for the Hue Dimmer Switch, Hue Tap Switch and Hue Motion Sensor. Lights are two-way synchronized so any change made from original Philips/Trådfri sensors and switches will also be 9 | applied to the bridge emulator. 10 | 11 | If you've found the extension helpful or useful, then please consider throwing a coffee my way to help support my work. As i am a student and would like to invest more time and effort in this project this would really help me. 12 | 13 | [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C01XTXB) 14 | 15 | [![paypal](https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=S95PWMZ3S6WJU) 16 | 17 | ![diyHue ecosystem](https://raw.githubusercontent.com/diyhue/diyhue.github.io/master/assets/images/hue-map.png) 18 | 19 | ## Getting Started 20 | 21 | **See Documentation tab for more details.** 22 | 23 | ## Credits 24 | 25 | - Ben ([@cheesemarathon](https://github.com/cheesemarathon)) All fancy github integrations 26 | - [Stephan van Rooij](https://github.com/svrooij) - zigbee2mqtt integration 27 | - [@avinashraja98](https://github.com/avinashraja98) - Hue Entertainment server 28 | - Federico Zivolo ([@FezVrasta](https://github.com/FezVrasta)) Internal WebGUI 29 | - [@J3n50m4t](https://github.com/J3n50m4t) - Yeelight integration 30 | - Martin Černý ([@mcer12](https://github.com/mcer12)) - Yeelight color bulb 31 | - probonopd https://github.com/probonopd/ESP8266HueEmulator 32 | - sidoh https://github.com/sidoh/esp8266_milight_hub 33 | - StefanBruens https://github.com/StefanBruens/ESP8266_new_pwm 34 | - Cédric @ticed35 for linkbutton implementation 35 | - [@cheesemarathon](https://github.com/cheesemarathon) - Help with Docker images 36 | - [@Mevel](https://github.com/Mevel) - 433Mhz devices 37 | - [@Nikfinn99](https://github.com/Nikfinn99) - PCB designs 38 | - [@crankyoldgit](https://github.com/crankyoldgit) - IR Remote library 39 | -------------------------------------------------------------------------------- /diyhue/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "build_from": { 3 | "aarch64": "hassioaddons/base-python-aarch64:5.3.4", 4 | "amd64": "hassioaddons/base-python-amd64:5.3.4", 5 | "armv7": "hassioaddons/base-python-armv7:5.3.4", 6 | "i386": "hassioaddons/base-python-i386:5.3.4" 7 | }, 8 | "args": { 9 | "network": "host" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /diyhue/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "diyHue", 3 | "version": "1.5.0", 4 | "slug": "diyhue-beta", 5 | "description": "Philips Hue Bridge Emulator", 6 | "webui": "http://[HOST]:[PORT:80]", 7 | "panel_icon": "mdi:home-lightbulb", 8 | "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], 9 | "ports": { 10 | "80/tcp": 80, 11 | "443/tcp": 443, 12 | "1900/udp": 1901, 13 | "1982/udp": 1982, 14 | "2100/udp": 2100 15 | }, 16 | "ports_description": { 17 | "80/tcp": "Hue API", 18 | "443/tcp": "Hue API SSL", 19 | "1900/udp": "ssdp discover", 20 | "1982/udp": "Yeelight detection", 21 | "2100/udp": "Hue Entertainment" 22 | }, 23 | "auth_api": true, 24 | "hassio_api": true, 25 | "host_network": true, 26 | "uart": true, 27 | "map": ["config:rw", "share:rw"], 28 | "options": { 29 | "config_path": "/config/diyhue", 30 | "mac": "XX:XX:XX:XX:XX:XX", 31 | "debug": false, 32 | "deconz_ip": "", 33 | "no_serve_https": false 34 | }, 35 | "schema": { 36 | "config_path": "str", 37 | "mac": "str", 38 | "debug": "bool", 39 | "deconz_ip": "str", 40 | "no_serve_https": "bool" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /diyhue/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxbec/hassio-diyHue/9e09dc4cda3df138228bad3f00aedbf9cbea6d1b/diyhue/icon.png -------------------------------------------------------------------------------- /diyhue/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxbec/hassio-diyHue/9e09dc4cda3df138228bad3f00aedbf9cbea6d1b/diyhue/logo.png -------------------------------------------------------------------------------- /diyhue/rootfs/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bashio 2 | 3 | CONFIG_PATH=/data/options.json 4 | 5 | export MAC="$(bashio::config 'mac')" 6 | export CONFIG_PATH="$(bashio::config 'config_path')" 7 | export DEBUG="$(bashio::config 'debug')" 8 | 9 | if [[ ! -z "$(bashio::config 'deconz_ip')" ]]; then 10 | export DECONZ="$(bashio::config 'deconz_ip')" 11 | fi 12 | 13 | export NO_SERVE_HTTPS="$(bashio::config 'no_serve_https')" 14 | 15 | if [[ -d $CONFIG_PATH ]]; then 16 | echo "$CONFIG_PATH exists." 17 | else 18 | mkdir -p $CONFIG_PATH 19 | echo "$CONFIG_PATH created." 20 | fi 21 | 22 | 23 | echo "Your Architecture is $BUILD_ARCHI" 24 | 25 | if [ "$NO_SERVE_HTTPS" = "true" ] ; then 26 | echo "No serve HTTPS" 27 | python3 -u /opt/hue-emulator/HueEmulator3.py --docker --no-serve-https 28 | else 29 | echo "Serve HTTPS" 30 | python3 -u /opt/hue-emulator/HueEmulator3.py --docker 31 | fi 32 | -------------------------------------------------------------------------------- /diyhue/rootfs/select.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # echo "Target platform is: $TARGETPLATFORM" 4 | # Hassio: armhf, armv7, aarch64, amd64, i386 5 | 6 | case "$BUILD_ARCH" in 7 | "i386") SELECTED="i686" ;; 8 | "amd64") SELECTED="x86_64" ;; 9 | "armv7") SELECTED="arm" ;; 10 | "armhf") SELECTED="arm" ;; 11 | "aarch64") SELECTED="aarch64" ;; 12 | *) SELECTED="unsupported" ;; 13 | esac 14 | 15 | wget https://github.com/ARMmbed/mbedtls/archive/1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482.zip 16 | unzip 1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482.zip 17 | cd mbedtls-1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482/ 18 | wget https://raw.githubusercontent.com/mariusmotea/diyHue/master/BridgeEmulator/ssl_server2_diyhue.c 19 | make no_test 20 | gcc -I./include ssl_server2_diyhue.c -o ../entertain-srv -L./library -lmbedtls -lmbedx509 -lmbedcrypto 21 | cd .. 22 | 23 | rm -rf 1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482.zip 24 | rm -rf mbedtls-1ab9b5714852c6810c0a0bfd8c3b5c60a9a15482 25 | 26 | # echo "Got file suffix: $SELECTED" 27 | #mv /diyhue/BridgeEmulator/entertainment-$SELECTED ./entertain-srv 28 | mv /diyhue/BridgeEmulator/coap-client-$SELECTED ./coap-client-linux 29 | 30 | # Fix permissions vor hue Entertain 31 | chmod +x ./entertain-srv 32 | chmod +x ./coap-client-linux 33 | 34 | 35 | # echo "Files in out folder" 36 | ls -la 37 | -------------------------------------------------------------------------------- /images/diyHue-logo-dev.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/diyhue-hassio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxbec/hassio-diyHue/9e09dc4cda3df138228bad3f00aedbf9cbea6d1b/images/diyhue-hassio.png -------------------------------------------------------------------------------- /images/logo-small.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | logo-small 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /repository.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MaxBec Home Assistant Add-on diyHue", 3 | "url": "https://github.com/MaxBec/hassio-diyHue", 4 | "maintainer": "Max Beckenbauer " 5 | } 6 | --------------------------------------------------------------------------------