Ok…… after thinking a few minutes…. I think I need to work on getting the new firmware installed as that is the easiest way probably to integrate MQTT.
Unauthorized is probably due to a bad username/password.
Can HA connect or can you connect with another client (MQTT Explorer or something else)?
Also make sure to disable TLS.
ps vyscon also has a discord which might be easier getting support
This is my first attempt at using MQTT on HA. I did copy-paste my username and password between the HA and OHS2. My assumption is that they are identical.
I think I might try to flash the latest firmware with auto discovery in case that will help. May not help, but at least I will be up to date.
I probably will need to migrate some questions to discord, but I built this thread to shed some light on this product to the HA community.
Thanks for the reply!
Ok, after way too much effort, I have my fork compiled into a bin file and downloaded into my OHS2. For about 45 minutes I tried driver updates and all kinds of things only to find out my long usb cable was power only. I then found a 6 inch cable and had to hold everything in my hands while trying to update. Needless to say…. I now have auto discovery buttons.
I am still not connecting to the MQTT broker, so it is still not working right. But now at least I have the latest firmware.
Small victory.
I am having trouble getting MQTT to work. I keep getting:
2024-11-13 10:11:26: New connection from 192.xxx.x.x:52610 on port 1883.
2024-11-13 10:11:26: Client OHS2 disconnected, not authorised.
The x’s are actually numbers I removed…. But they were the correct IP address for my OHS2
I have my OHS2 in a dedicated subnet and my HA is in another subnet. I allowed MQTT ports in both directions…
I changed the settings to allow remote access…. Nothing.
I changed passwords a few times…. Nothing.
Opened all ports between the two pi addresses…. Nothing
I followed multiple tutorials on setting HA MQTT using Mosquitto …. Multiple times.
I updated the firmware last night to my 56 zones fork…. Now I see MQTT auto-discovery options in my settings, but still no connection to the broker.
Any thoughts on what to try next?
HA appear as to be connecting fine. I can see another IP address connecting that appears to be the Docker Container from HA. At least that is what I concluded doing a WHOIS on the IP address. That IP is listed as a 172.xx.xx.x
I have certificates turned off. All that is running is the default settings but with a username and password. I can see the HA IP address connecting using the programmed in Broker password set in the integration.
I tried the same password and user for OHS, built also made a dedicated user and password for OHS and I get the same result.
@p2baron Thanks for your help……
Ok… tried password of ”1234567890”. One that I could type easily in both places to test…. Now it works…… I think the issue was I was using a really long password and OHS was not allowing the last few digits or my iPad was autocorrecting or auto capitalizing a letter.
Will change the password now.
MQTT user and password are limited to 15 chars max. It is embedded device with C, so predefined string length works best.
System appears to be working and auto discovery is super convenient.
Adam, the developer of the OHS2, was super helpful. Not only did he write a custom firmware for my build so I could add extra zones, he helped me debug issues when I updated the firmware with my fork of his code. Now everything appears to be working. This is unheard of support. Thanks Adam!
Me next step is to add all of the sensors and my cellular SIM card.
As I add a sensor, I will label the zone, then integrate the zone into Home Assistant.
You are welcome
This a neat and nice build I must say. And also, I’m quite happy that the system scales above 20 zones that is normally installed by others quite well with minimal changes.
Maybe make the larger scale version the standard for new purchases? Or offer 2 options?
I plan to keep my fork up to date.
All,
Just an update. For some reason, I only ordered 20 window sensors, so yesterday I installed 20 sensors.
The auto-discovery worked out great! My house was prewired but the wires were never labeled. So I would wire in a sensor, look at the OHS2 zone tab, then when I found the new zone that showed a closed circuit, I labeled the zone, turned on Auto-Discovery, and then the sensor automatically appeared in HA. I have 20 more sensors coming this week, then I hope to finish up my wiring.
After the zones are finished, I plan to add my hardware rfid buttons, add cellular, and start arming the system.
Last step will be the motion sensors.
One of my door sensors is now showing “on” which is troubling because it does not have a magnet yet. Since I rebooted my HA, everything else is showing unknown. This tells me that I have an intermittent short that told the GW that the zone changed. I am going to add that zone to a group and arm it ti see if I get an alarm on that group.
Not sure, but if you keep it up to date, then I can forward all such use cases to your repository.
So, yesterday I was an idiot. I thought the SIM card slid in from the side and snapped off my contacts for the SIM holder.
Important…… the SIM holder lid slides and lifts out of the way so you can drop the SIM card into place…… do NOT do what I did
Adam was kind enough to send me a replacement holder. I can re-solder the new SIM holder here (easier than shipping the board back).
Thanks Adam!
Short update. I have HA sending me notifications for arming and disarming. I have critical notifications working for alarm triggered. Will post a detailed how to once I finalize it. I plan to make the critical alerts actionable so I can disarm the alarm.
I am still coding HA trying to make the notifications more interactive. I will update everyone once I get code working.
In the meantime, I ordered some large relays to control my sirens which draw more amps than the regular relays could handle.
Here is the link for the ones I picked:
I used a HA supervised install with GPIO pins to watch hard wired door contact sensors, zigbee contact sensors for windows and zigbee motion sensors. HA for alarm control, alert notification and picture captures. At one point I used noonlight for 24/7 monitoring, but haven’t used that in a while. A wall mounted cell phone provides a fixed location access to the GUI and cellular backup for controller communications. It’s been working well for about three years now.
Nice build, the HA and its features are just great!
One the other hand the OHS GW is more like stand alone solution with HA connectivity. It does not need any external connectivity, service or cloud solution. The system allows easy expansion and connection of any wired standard commercial 12V PIR/microwave sensors. Also it is build to survive power outages. Basically it is good to replace your old alarm system and reuse all wiring. Or to create new one if you need.
I do not want to give advises to burglars. But if I would come to rob a house, I would first take it’s power off, and then use short wave radio jammer to block all wireless signals. That’s why the good commercial alarms relay on wires. OHS is still DIY though. What I understood, also your solution somehow covers that.
And the fun part, I hope, is that the nodes are basically Arduinos. So people can add authentication methods like NFC or fingerprints. Or to add sensors or relays. And the GW functionality grew to so many features over the years that it is worth reading just for inspiration.
Yeah, and it is open source.
Adam
I think when you build a smart house it should include alarm functionality as you can dual use your sensors. I’m surprised that there is relatively little discussion on HA with alarm capabilities on this forum. It looks like you have a great approach when you have lots of wired sensors. If I hadn’t had enough GPIO pins on the odroid N2+ to handle all of my wired sensors, I’d probably would have gone a different route. A couple of my reasons for using a solution that was tightly integrated with HA:
- Single backup power solution to keeps my main smart features and alarm working when the power is out. I was looking to minimize the number of components that needed to be backed up so I could minimize the UPS size.
- All the alarm sensors also work to drive smart house features. Like turning on lights when motion is detected, or door is open. Or put another way all my smart sensors that drive automations are available to do double duty and provide a house alarm system.
- Single simple solution to provide cellular backup to both smart house and alarm system. I basically have a cellular phone, connected to a USB port on the controller and providing tethered internet.
- Minimize the number of components to reduce complexity.
- No cloud services required.
I’m going to look over your approach more to see if there are features I should be looking to add.
Thanks for documenting your effort!