-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing /dev/hidraw* through to HA in docker #66
Comments
I don't have much experience with docker but if you mount the whole /dev dir you don't need to run in privileged mode right? It should still be able to read / write to the device? |
@ff4500, here's how I did it:
|
This worked perfectly for me in my container. |
Forgive me for my lack of knowledge, but when you refer to docker-compose.yml, do you mean one that we have set up previously, or is there one somewhere on the hassio-supervisor image that can be edited for launching the homeassistant container? Obviously I'm running hassio, not sure if this was meant specifically for HA Core? |
@bepstein111 Did you ever figure this out by chance? I'm migrating to Hassio in docker and this is the one sticking point that I can't seem to get around. |
unfortunately not. I ended up just buying a Nabu Casa subscription and adding the devices via Wyze App > Amazon Alexa Wyze Skill > HA Alexa Integration. Bit of a workaround, but most things in hassio seem to be, and it added some other features I was looking for like automagic SSL/HTTPS. I did notice that I hadn't actually tagged the original commenter, so I just did that and maybe we'll get a reply. |
@bepstein111 Thanks for the quick reply. They have an Alexa skill now?! That's good enough for me, and I don't think I would've thought to look at that option. Thank you! |
Just curious, how quick is the alexa trigger method? Honestly even though I
developed this I'd prefer a more first-party supported integration given
the weird quirks the custom component has.
…On Wed, Apr 8, 2020 at 7:20 PM Colten Lumley ***@***.***> wrote:
@bepstein111 <https://github.com/bepstein111> Thanks for the quick reply.
They have an Alexa skill now?! That's good enough for me, and I don't
think I would've thought to look at that option. Thank you!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKJUZPEIKAYZD6RZSL5Q2LRLUWFPANCNFSM4JR2M7YA>
.
|
Of note, I haven't tried the suggested steps above yet, since I moved my HA environment over to a NUC from my Hypervisor (Proxmox, Alpine VM running on a Dell server with USB passthrough setup). The NUC doesn't seem to reassign the hidraw device on reboot, and it's been rock solid. If I move it back to the Hypervisor, I will definitely try the link steps again. And @kevinvincent, I have tried the Alexa HA integration before and it wasn't quick like local polling. As much as we lose power/internet in the spring, I appreciate being able to still use sensors to turn my lights on and off when I can't connect to the internet. |
@kevinvincent If you do it within the Alexa app, it's immediate - I have motion sensors on mine and they're quite responsive. I hate not having EVERYTHING running through HA, but honestly, it works well, and I'm not opposed to opening up a second app when I need to. That said, I TOTALLY understand @ff4500 sentiment about losing power/internet. Not sure if Alexa remembers triggers during outages (internet, that is), so it may or may not work without internet. |
@tomhoover Thanks for your solution with the symbolic link to the hidraw device. I see the link getting created,sometimes to hidraw0, sometimes hidraw1, etc. The only problem is that I don't know how to update the Docker containers used by Home Assistant Supervised. |
@bepstein111, @TheColtron, @sdunnagan, I do not use Home Assistant Supervised, so the following suggestion is based upon a quick review of the Home Assistant Supervised installer. Beware this is untested, and should only be used if you're comfortable with the command line.
If anything breaks, please restore the backup file you made earlier, and reboot your system. As mentioned above, this has not been tested by me, so BE CAREFUL! |
Very helpful, thanks! My HA config looks like:
Docker is getting run as you suggested with the volume mount of the device file:
But device isn't detected, and I see this in the log:
However, udev did in fact create the symbolic link:
Anyway, I can live with configuring HA with "device: auto". But it's an interesting problem. |
@sdunnagan with hassio supervised, the problem is that /dev/wyzesense exists on the local machine, but not inside the container that HA runs inside of. @tomhoover 's latest reply should fix that, hopefully. |
The issue with @tomhoover 's changes is that that only passes the device into the container for the supervisor. This does not actually pass the device into the container where Home Assistant actually runs. I've been looking through all of the supervisor configuration/script but I can't find where or what it uses to create the container running home assistant. |
This was the brick wall I faced as well. Bummer that the latest attempt by tom wasn't successful. Definitely interested in any solutions, but for now, 5 bucks a month was worth it to me. |
I finally got some time to test the Alexa integration and ended up reverting back to this component pretty quickly. The Alexa route is very responsive, but the major downside is that node-red control is much more difficult. Some of my motion rules are pretty elaborate and can't really be translated into Alexa routines, so this component is much more valuable imo. |
Following this issue, as if we can determine how to make this work for HA supervised, it will unlock my ability to create auto-restart for the sensors not responding issue: #114. I'm noticing occasionally my sensors stop responding, and the hidraw device has changed. When I try re-initializing the entire component, it says the new /dev/hidrawN file is not found, even though I can see it in /sys/class/hidraw. Suspect I'm running into the issue you all are, and keen to see if someone figures out how to fix it. |
@haxx0r07 I think this is where supervisor runs the homeassistant container, and this is where they configure which volumes are to be used/bound. Perhaps we can add a volume binding here? The only issue is I'm not exactly sure how to locally make a change to this and run it locally. The README for homeassistant supervisor seems to make it sound like you need to use hassio-builder with custom tagged image, it's not clear to me at all how I'd modify this and test it locally. |
Talking with Supervisor devs, sounds like Supervisor has a hardware abstraction layer to support udev devices. Looks like "hidraw" devices are not yet looked for in this abstraction layer, so we should look into adding them: https://github.com/home-assistant/supervisor/blob/dev/supervisor/misc/hardware.py |
Nice work @RonSpawnson I'm not the best with python, but I'll look through that file and see if I can come up with anything. |
I've got a diff I can share this evening, I just cannot figure out how to use hassio-build to create a test image to try it out as per README, so I have no way of testing. I opened an issue asking for clarification and did receive a tip, so that's next on my plan of action when I get more free time home-assistant/supervisor#1685 (comment) |
I am running hassio in a VM on unraid installed witha a quecow2 file.
I have added the appropriate binary sensor in my yaml file. |
I am also I am running hassio in a VM on unraid installed witha a quecow2 file @carltonwb did you ever find a resolution? |
Did you ever get it working? |
Sadly no, I think I got them showing up in HA but they weren't mounting in
the container still. I've resolved most of my stability issues with USB 3,
and with pulling my SSD and WyzeSense to externally powered USB hub. But I
do think getting supervisor support of hidraw would be best, it seems
supervisor is on some strange depreciation path.
…On Wed, Nov 11, 2020, 2:23 PM Mendel Greenberg ***@***.***> wrote:
I've got a diff I can share this evening, I just cannot figure out how to
use hassio-build to create a test image to try it out as per README, so I
have no way of testing. I opened an issue asking for clarification and did
receive a tip, so that's next on my plan of action when I get more free
time home-assistant/supervisor#1685 (comment)
<home-assistant/supervisor#1685 (comment)>
Did you ever get it working?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACC5JUSR2R2H3X243NFLWY3SPLXERANCNFSM4JR2M7YA>
.
|
tomhoover commented on Dec 28, 2019. |
Previously, I had the component setup in my compose file to pass through with:
That worked out pretty well, until a reboot of the host system which changed the hidraw device. HA didn't open, had to remove from the config, yadda yadda.
So, I thought that the new version with
device: auto
would be the ticket. I'm sure that that it works great, but how would I go about passing a randomly assigned device to pass through in my compose file? I don't really want to mount the whole /dev dir and run in privileged mode if I can help it.The text was updated successfully, but these errors were encountered: