1st time poster, another noob - with a functional design concept question

Hello to all openHAB2 users, coders and contributors, from Jarrod in Australia. ( and G’day to all the Aussie habbers’)

Firstly, Im an Electrical Engineer, with a very long and experience hardware career to date… Secondly, I’m an avid HA enthusiast, and have been tinkering with HA using re-purposed PLC’s and telemetry hardware for quite some time.

To that end: I have 5 independent ControlByWeb X-310 web enable IP switches https://www.controlbyweb.com/x310/ currently set up to control numerous lights, gates, gate open status and roller doors. The iOS app is very user friendly ( wife can use it) and the whole system has been solid as a rock.

In parallel, I had a surveillance platform (iSpy) https://www.ispyconnect.com/features.aspx running on a VM, with an ANPR plugin that white listed car registration plates. - On detection of a white listed plate, the iSpy ANPR plugin would generate a HTTP URL string / command? and this would pulse the corresponding relay in the gate controller and the gate would open.

String that iSpy would send:

The solution worked quite well, and family and friends could drive up our driveway and the gate opened. Cars or other objects not on the white list had to use the intercom.


Other visitors would also drop by occasionally:)

OK, so fast forward to iOS, apple homekit and Siri. - Here comes the functional concept, for you valuable feedback:

I’d like to now utilise openHAB2 to communicate with the X-310’s following voice command from Siri, via homekit.

Example: Wife is driving home in the dark - nearing home, she issues the command “hey siri, turn on the driveway lights” or “hey siri Donna is arriving home in the dark” which turns on driveway lights, opens driveway gate, turns on porch and front floodlights, opens garage roller door and turns on barn inside lights… ( the golden dream!!) All of those devices exist and are currently remotely switchable today using the ControlByWeb APP.

Im starting to research the requirements for OpenHAB, and the requirements of setup and config, and intend on teaching myself as much as possible to implement, but I’d like some feedback on whether the above scenario can be achieved.

some questions I think may be relevant:

Can the URL in the above iSpy example be sent by OpenHAB2?
Does OpebHAB need a response from th X-310 to inform Homekit of status? - i.e. of I were enquire " hey siri is the gate open, or front floodlight on?"

The X-310 from what Ive tested - if I type the following into the browser:

changes the relay state accordingly and responds with:

Is this response sufficient to extract the variables that openHAB / homekit would need, in ordere to inform ‘siri’ of the status?

I have also seen somewhere that individual outputs / inputs can be interrogated for status, by a similar command.

If you are starting to realise - Yes - I have very limited coding / linux /. command line experience ( read nearly none!)
Hence why I’m very keen to understand if this concept is achievable before I begin to commit hours / days /weeks learning the skills to implement such a capability ( I certainly plan to learn this skills, if this can work!)

I’m also very cautious of configuring and attempting to set things up, only to have a very experienced and educated peer to offer some valuable advice which may be completely opposite to the way in which I have done things (if that makes sense?)

On my path so far I have successfully:
Installed OpenHAB2 on a W7 machine and set for auto start on machine startup
added the Network Binding app;
added two X-310 as things;
Joined the OH community;
researched and begun to learn OH framework
written this post ( had two beers doing so :wink: )

Look forward to any questions about my proposed mad plan, feedback on how easy this is going to be, and any other possible suggestion to guide me on paths to take and things to consider.

Thanks again, and I’m looking forward to this journey.


First of all Welcome to openHAB!
OpenHAB is able to do everything that you suggested and more…
The learning curve is a bit steep but you have experience with systems and automation and you are willing to put the dedication, you will have no problems.
The community is great and will be able to support you on your way.

Now to your questions:

Yes, with the hhtp binding

Yes, again with the http binding and the XPATH transform

OpenHAB can do it all (Almost). All you have suggested is very achiveable without a lot of complicated coding.

Install the http binding.
Read the docs, again and again.

Or the system just sees that you are coming home (iCloud binding, or OwnTracks, or IFTTT, or BT sensors, etc), knows it is dark (Astro binding, light sensors, etc), and does all of this automatically without being prompted…

Absolutely possible given the information you have provided so far. Like Vincent said, you will want to look at the HTTP binding first.


It is often better to get some sort of feedback from the device because then you can manually change the state of the device and your home automation’s state will remain consistent with reality. But you can make it work without. You just won’t be able to fully rely on your home automation state matching the real state. That may or may not matter depending on the context. Note that the feedback need not come from the device itself. For example, I have a relay to control the opening/closing of my garage door and a reed sensor to tell me whether the door is open or closed.

I don’t know much about Homkit integration, but I suspect when you ask for the status of something, the state of the Item that represents that thing in your home automation is what gets returned. In my garage door example, the state of the Item that represents the reed sensor is what gets sent to Homekit in response.

4 relays, 4 inputs, and up to four sensors? These are awesome devices! I’m guessing that the relay1state is representing the state and a 1 indicates ON.

Certainly. It is valid XML so you would probably use the XPATH or XSLT transform. If you ommit the “?relay1State=2” do you get this XML back without changing anything on the device? That would be good because then you can poll the device and capture manual changes to the device’s state.

This is just something you will have to accept. :wink: Even the best of us will head down a path and reach a point where we learn something new or encounter an untenable problem that will force a backtrack and rebuild. But that is how we learn and that is how we make our systems better. I’ve probably rebuilt my rules at least three times now.

On-the-other-hand, there is no wrong way to do any of this stuff. If you go down a path and it works, who cares if there is a better way to do it. What you have works.

Those who have been most successful with OH are those who just dive right in and try things out. Go play and come back when you can’t figure something out.

So there is an X-310 2.x version binding? Awesome! You don’t even need to mess with the HTTP binding. The call to that URL is already handled for you. You just need to link Items to the Channels on those Things.

I recommend defining your Items in .items files. The UIs do not yet support tags and IIRC Homekit integration requires tags.

Not mad at all. It is actually pretty standard. I think you will have a pretty easy go of it compared to some.

I suggest installing the Demo package and looking at how all the pieces of OH work together. It is easier to take something that works and make minor changes and seeing how the change affects things.

Definitely go through the docs and you must read them closely. Very minor details matter, expecially things like case, spaces, etc).

Start small and work your way up.

Ask questions on the forum. When you do ask, please post all the relevant code (Items, Rules, Logs, etc) and How to use code fences.

Good luck!

Thanking you very much for validating my theory.

OK< so I thouht I’d be clever and ask Siri to turn all my lights on, open garage door etc… Now this just sets a whole new higher bar!!!

Challenge accepted… :stuck_out_tongue_closed_eyes:


1 Like

Come back with progress reports. We might be able to help and both your successes and failures are helpful to the community. And it is always more fun when you’ve a bunch of people from all over the world cheering you on. :grin: