I’m running HA on a Mac and don’t have the addon store so can’t install the assistant relay. Anyone know how to manually install it?
The repo is non-compliant with HACS.
I’m running HA on a Mac and don’t have the addon store so can’t install the assistant relay. Anyone know how to manually install it?
The repo is non-compliant with HACS.
@ashscott Addon is just a wrapper for Assistant Relay application. It’s regular node.js application, so you can setup it manually, please look https://github.com/greghesp/assistant-relay
Here is a link to the file
The best way to do this is to console into the container and run
find / -name light.py
Find out where your template folder and cd into it. Ex: for me it is
cd /usr/src/homeassistant/homeassistant/components/template/
You will need to remove the light.py before you can wget so simply
rm -rf light.py
After that wget the new light.py
wget https://raw.githubusercontent.com/home-assistant/home-assist
ant/538b45f0793cdfb56dc228facef51c9cce746ed4/homeassistant/components/template/light.py
Restart home assistant and there you go.
Thank you, Vexlar. I’m not running it in a docker container though, just on my Mac.
If you are running on a mac there must be a file system somewhere right?
Since mac is based on linux, open your terminal and type
find / -name light.py
Do you see the home assistant file system?
That is perfect, so you indeed have access to the folder, you need to find the “template” component. so it should be something like
cd /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/components/template/
Just confirm that is your correct directory by typing
ls
To make sure light.py is in the folder and follow my steps.
Copy my package.yaml for the light template and import my node-red flow. (Make sure to update the home assistant nodes, and also alexa remote 2 node.
In node red you will need the following Palettes
Do I need to use node red or just have the companion component installed?
Well my method uses node red and alexa, allowing you to control color temperature, brightness, and colors. @Jacek_Paszkowski’s method uses google assistant but only allows for on/off, so basically choose what works best for you.
All I really need is on/off so the assistant relay will suffice.
I’m getting a failure when running though. This is what the error log contains:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /Users/ashscott/.npmrc. (matches userconfig)
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info lifecycle [email protected]~prestart: [email protected]
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/ashscott/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle [email protected]~start: CWD: /Users/ashscott
11 silly lifecycle [email protected]~start: Args: [ '-c', 'pm2 start ./bin/www && pm2 log www' ]
12 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `pm2 start ./bin/www && pm2 log www`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
14 verbose stack at EventEmitter.emit (events.js:321:20)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack at ChildProcess.emit (events.js:321:20)
14 verbose stack at maybeClose (internal/child_process.js:1026:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
15 verbose pkgid [email protected]
16 verbose cwd /Users/ashscott
17 verbose Darwin 18.2.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
19 verbose node v13.7.0
20 verbose npm v6.13.6
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] start: `pm2 start ./bin/www && pm2 log www`
23 error Exit status 1
24 error Failed at the [email protected] start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
A bit beyond my understanding to figure out what’s not right here.
Where should the unzipped ‘release’ folder be placed?
Any ideas?
@Vexlar so far because it is enough for me for this moment
Using Assistant Relay you can “tell” GA to do everything what is supported by particular integration in GA.
This looks similar to the one I purchased a couple months ago. I ended up reverse engineering the bluetooth to find the below settings.
https://www.amazon.com/gp/product/B07HRHDV1T/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
Dim (1%?) gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3304140000000000000000000000000000000023
Dim (58%) gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3304530000000000000000000000000000000064
Dim (98%) gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 33049800000000000000000000000000000000af
music mode
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3305030000000000000000000000000000000035
need scene mode
Value: 330502 ff0000 00ffe9d900000000000000000004 - RED
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 330502ff000000ffe9d900000000000000000004
Value: 330502 ff7f00 00ffe9d90000000000000000007b - Orange
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 330502ffff0000ffe9d9000000000000000000fb
Value: 330502 ffff00 00ffe9d9000000000000000000fb - Yellow
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 33050200ff0000ffe9d900000000000000000004
Value: 330502 00ff00 00ffe9d900000000000000000004 - Green
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3305020000ff00ffe9d900000000000000000004
Value: 330502 0000ff 00ffe9d900000000000000000004 - Blue
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 33050200ffff00ffe9d9000000000000000000fb
Value: 330502 00ffff 00ffe9d9000000000000000000fb - Light Blue
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3305028b00ff00ffe9d90000000000000000008f
Value: 330502 8b00ff 00ffe9d90000000000000000008f - Purple
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 330502ffffff00ffe9d900000000000000000004
Value: 330502 ffffff 00ffe9d900000000000000000004 - White
Power Off
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3301000000000000000000000000000000000032
Power On
gatttool -i hci0 -b <insert bluetooth mac> --char-write-req -a 0x0015 -n 3301010000000000000000000000000000000033
I wanted to replace my lights.py script with the one from the PR, however I am discovering multiple identical files. I’ve got a quite clean install (from yesterday) restored from a snapshot running in Docker on a RPi4 with Stretch. Seems like there are two images still and three files. So I am quite confused why this occurs even I only got one image of Hassio / HA. These are the three locations:
/var/lib/docker/overlay2/edba048715a328b8db838292ba72a954b63fb657081a1397e0322252ecd104c0/diff/usr/src/homeassistant/homeassistant/components/template/light.py
/var/lib/docker/overlay2/d2f4a15c0889b5cbf194effc9920fe646e0aa9b1acde2155378d1f8b91fae5d2/merged/usr/src/homeassistant/homeassistant/components/template/light.py
/var/lib/docker/overlay2/d2f4a15c0889b5cbf194effc9920fe646e0aa9b1acde2155378d1f8b91fae5d2/diff/usr/src/homeassistant/homeassistant/components/template/light.py
I just could change all three but still I want to know why there are three of them. Maybe someone can enlighten me, since I am quite new to docker. Ty in advance.
I am not quite sure at all, If it were me, not say at all this is the best way but I would just replace all three. Odds are you are using the merged directory, since by chance it pulled the source from github and there was a difference? Merged was the final product of the two different folders?
That is awesome! I will have to look into that for sure. Thanks for the information, I tried to reverse engineer the api but had no success…
Here’s the info I used to sniff the bluetooth.
https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb?view=all
Getting log from android
Color info:
https://www.color-hex.com/color/8b00ff
Good info, but the char-write-req was wrong, used top link to get better information, you want the handle not the write request (example 0x00015 for minger led strip)
Thank you, Jacek, I have this working now.
A lot of work for a simple ‘on and off’ but worth it.
However, when my Mac restarts, i have to use npm run start
again in terminal to restart the relay. Can this be made to auto start?
Thank you for your help.
Thank you for your reply. I indeed ended up replacing all three of them and I can use the new interface/entities of the light section. Also got my node red setting up, just waiting for my LED strip light to be delivered now and start testing/messing with it And your theory may be right but to confirm that I need to have a closer look what was happening under the hood of the docker.
FYI, in the next HA release the temperature and color will be added for the light template. The custom component won’t be required anymore