Using HA-Bridge with Mozilla Gateway

I do not know how many of us are using the HA-Bridge with the Mozilla Gateway (MG), but it certainly does allow much added capability. It integrates very nicely with MG in both directions. It is especially useful for creating custom scripts, adding it to the HA-Bridge with a device name. Then, going back to MG, scan for new devices and your script will show up as a new device. Just add it, and you now have a very easy way to run custom scrips. I am running HA-Bridge on a separate computer, which is never turned off. It also allows me to control what few X10 devices I have left as well, with the MG.

Also, as it is a full two way communication with MG<>HA-Bridge, it allows full Alexa control of all your MG devices. I have been using HA-Bridge for a few years now, and once I discovered the total integration with MG, I highly recommend it for all MG users. HA-Bridge will run on nearly all devices.

This is really interesting, thanks for the pointer!

Thanks @mrstegeman. Some things I am using HABridge for:

  • Alexa voice audio control on my Linux PC. It is a script which controls PulseAudio allowing me to mute/unmute under varying conditions. Now bridged into MG so I also have a button to control it via the Gateway.

  • Voice control over my security cameras, using MotionEye software. I can turn it on and off remotely via the Gateway (I am not viewing the cameras via MG, just turning them on/off. I have a port forward to the MotionEye web interface).

  • Groups, such as “Evening Lights On” This voice command or MG button will turn on the Living room lamps, family room lamp, breezway light and backyard light. This also automatically turn off at 12:30am via the Gateway rule.

  • Allows for TRUE dimming control using intensity percents in a single command (I wish MG did this too).

Anyway, if you only want to add very good Alexa integration to Mozilla Gateway, or if you want control of non-standard types of devices, you all should give HABridge a try.

I had been running HA with my security system. I’m converting to a different system, so I migrated my Z-Wave stuff to Mozilla IoT on Raspberry Pi. I was hoping to simply continue using my Mozilla gateway, instead of the security system (and the monthly premium) but I would lose Alexa integration. Until the HA-Bridge. Is it safe to assume I can run this on my Pi alongside the Mozilla gateway? What happens to existing rules on the gateway?

I don’t run HABridge alongside IoT. I run it on my Fedora PC which is always on. You could probably get away with it on a Raspberry Pi 4 with 2-4 GB RAM, but I would think anything less would be overwhelmed by memory limitations.

Your existing rules on the gateway would be unaffected and as long as you have a rule set assigned to a gateway button, it will carry across to HA and can be voice controlled. Rules do not directly carry across to HA otherwise.

Something to watch out for, when you add a IoT thing into HA, it will come back across to IoT as a newly discovered item, since it is completely a two way connection. It’s a round robin so to speak. I wish there was a way to avoid this as it can be confusing sometimes.

I had to run the Mozilla gateway on my Pi 3 because the z-wave dongle wouldn’t work on the Pi 4. Sigh. This, I don’t want to mix with what is running on my Pi 4. I may need another Pi with enough RAM. Thanks…something to think about.

Very odd the dongle would not work on a Pi 4. That should make no difference.

There is a hardware issue with the Z-Stick that makes it not work with the Pi 4’s USB-3 ports. However, you can plug it into a USB hub to make it work.

@mrstegeman: Just to re-confirm what I think I read and need to do.

I’m moving my current docker-based MIOT GW instance to a RPI Raspian Lite Docker environment. Would like to copy the existing working directory to the RPI onto a USB stick on the RPI (avoid excessive SD card wear). My plan is to:

  • stop RPI GW
  • backup the current MIOT GW folder
  • insert a 64G USB stick in the RPI, format and mount: e.g.: /media/MyUSB
  • restore the MIOT GW folder to the RPI on the usb
  • Execute docker on the RPI GW with appropriate -v option to map the /media/MyUSB folder as GW home directory

In a previous thread, it was mentioned some of the add-ons may need to be re-installed.

Q: Are there any other issues to worry about? Permissions, USB file system type, or other issues?

I only have a handful of Z-Wave GE V2 devices which have worked flawlessly on the original laptop.

Thanks for any reminders or pointers to other posts…

Eric L. Edberg

ps: I originally attempted to use Ubuntu Core as the OS. How needlessly confusing it was attempting to transition to snaps. It was too locked-down I guess.

  1. The directory you need is ~/.mozilla-iot, which contains things like addons, log, etc. You don’t need the gateway source itself or the entire home directory.
  2. Since you seem to be changing architectures, you will definitely need to reinstall some add-ons, including the Z-Wave one.
  3. As for permissions, just make sure that whole directory is owned by the user running the gateway. With our Docker image, that would be 1000:1000, or node:node.
  4. There are some instructions in the README for sharing your Z-Wave dongle into your Docker container.

You will most likely need to format your USB storage as ext4 for Linux permissions to work properly. Also, if you mount the USB as /home then move your existing pi home there it would make things a little easier in my opinion.