Please login or register.

Login with username, password and session length
Advanced search  

News:

The X10Hub (PiX10Hub) is here! Created by the Community, for the Community.:)% #:)

Pages: [1] 2 3 ... 5

Author Topic: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM  (Read 1127 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 12
  • Posts: 766

I have slowly semi mastered running home automation free program domoticz, an area wide webserver, on a $ 5.00 raspberry pi.  I also loaded mochad, which links X10, domotiz, ha-bridge, and plain old web based tcpip commands.   So domoticz server sees all my x10 devices, including security devices.  (same as HG).  It is updated very often, and has interfaces to just about every HA device in existence.  I was able to harness its macro/logic/timer capabilities with one of its many built in graphical programming tools known as blockly.  It can also be programmed in all the typical languages, java, C, c+, python, etc. 

With petera's comments & help, I used my web browser's development tools to watch exactly what domoticz server sent to make an x10 lite turn on or off.  This simple JSON line then, typed into a browser, did exactly that.  So I quickly added a few key lites on/off and DSL modem reset icons and shared them on different computers.

My only missing capability that would allow me to finally retire my AHP is the ability to SEND security RF commands - so i can arm and disarm my ds7000 security systems. 

Tuicemen and and others patiently helped me get ha-bridge talking to an RF transmitter called broadlink RM when I tried to get HG to work on windows;  I never succeeded in making HG anywhere near reliable, but did get h-bridge and RM to work.

So I added HA-bridge to my pi today.   It has a native built in domoticz interface as well as one for broadlink RM.  So all I had to do was enable the interface and ALL my domoticz devices were immediately imported.  Recalling some of what I learned with the RM interface, I was quickly able to send the domoticz devices thru the bridge to the rm transmitter.  But I have no need for that since domoticz sends the same commands directly thru USB to my cm15a.  But it is cute.  The device I wanted to pass thru was security ARM/DISARM commands.  They did not work - yet.

So for kicks, I turned on my old ha-bridge I used with HG on my windows computer.  It still had the devices I had programmed previously.  I used the test buttons for ARM and DISARM - and both worked still!  So my RM remembers those codes and will transmit them on command.   

I then spent an hour trying to copy those commands into my Pi ha-bridge;  although they look the same, they did not work.  I will have to relearn how to actually program the RM unit;  I vaguely recall teaching it the security codes by sending them while the RM was in some kind of learn mode. 

Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1017

I have slowly semi mastered running home automation free program domoticz, an area wide webserver, on a $ 5.00 raspberry pi.  I also loaded mochad, which links X10, domotiz, ha-bridge, and plain old web based tcpip commands.   So domoticz server sees all my x10 devices, including security devices.  (same as HG).  It is updated very often, and has interfaces to just about every HA device in existence.  I was able to harness its macro/logic/timer capabilities with one of its many built in graphical programming tools known as blockly.  It can also be programmed in all the typical languages, java, C, c+, python, etc. 

With petera's comments & help, I used my web browser's development tools to watch exactly what domoticz server sent to make an x10 lite turn on or off.  This simple JSON line then, typed into a browser, did exactly that.  So I quickly added a few key lites on/off and DSL modem reset icons and shared them on different computers.

My only missing capability that would allow me to finally retire my AHP is the ability to SEND security RF commands - so i can arm and disarm my ds7000 security systems. 

Tuicemen and and others patiently helped me get ha-bridge talking to an RF transmitter called broadlink RM when I tried to get HG to work on windows;  I never succeeded in making HG anywhere near reliable, but did get h-bridge and RM to work.

So I added HA-bridge to my pi today.   It has a native built in domoticz interface as well as one for broadlink RM.  So all I had to do was enable the interface and ALL my domoticz devices were immediately imported.  Recalling some of what I learned with the RM interface, I was quickly able to send the domoticz devices thru the bridge to the rm transmitter.  But I have no need for that since domoticz sends the same commands directly thru USB to my cm15a.  But it is cute.  The device I wanted to pass thru was security ARM/DISARM commands.  They did not work - yet.

So for kicks, I turned on my old ha-bridge I used with HG on my windows computer.  It still had the devices I had programmed previously.  I used the test buttons for ARM and DISARM - and both worked still!  So my RM remembers those codes and will transmit them on command.   

I then spent an hour trying to copy those commands into my Pi ha-bridge;  although they look the same, they did not work.  I will have to relearn how to actually program the RM unit;  I vaguely recall teaching it the security codes by sending them while the RM was in some kind of learn mode.

A lot achieved in a short space of time once you were up and running. Plenty to keep you busy now. Keep up the reporting on Domoticz so other will get a full flavour for it.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 12
  • Posts: 766

So,using the HG doc I wrote about how to integrate HG,ha-bridge, & rm broadlink, I was able to teach my RM to send security arm & disarm commands on my ha-bridge on Pi.  So ha-bridge tells RM to send the 32bit security code and my alarm arms and disarms.  Used the docs written for HG.

Now I have a hole to fill in:  how to get domoticz devices linked to the RM devices;  ha-bridge has two groups, 1 with all the domoticz devices imported, and then another group called broadlink, and has my security code ARM/disarm in it.  but the two are not linked yet...  I am having a hard time wrapping my head around linking these two..   

Yes, when done, I will write a 10 page how-to
« Last Edit: October 04, 2018, 08:12:26 PM by mike »
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1017

To paraphrase one of your great leaders Mike The problems of the X10'world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men who can dream of things that never were and ask "why not?"
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 12
  • Posts: 766
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 258
  • Posts: 9049
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software

I had seen mention of the Broadlink RM being supported in Domoticz but not dug into it. As HA-Bridge first added support for Domoticz with the helper I figured that's how the Broadlink RM was being integrated. ::) :'
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1017

hmmm...   no need for ha-bridge:

http://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html#First_Time_Users

The likes of Domoticz and Home Assistant have such an active development community you can nearly guarantee there will be a solution for nearly all your technology integration requirements. Just need to do a bit of digging to discover it. It's not always obvious and it's changing nearly every day.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 258
  • Posts: 9049
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software

Since Domoticz does require HA-Bridge for a free Alexa integration, and the Broadlink RM has worked well for me with it, I'll stick with it setup as is in my Domotics test Image.
I had hoped there was a free Domoticz Alexa skill. Saddly the one available is not! :(
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 12
  • Posts: 766

ya, sucks that that user decided to CHARGE for his Controlicz! 
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 258
  • Posts: 9049
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software

ya, sucks that that user decided to CHARGE for his Controlicz!
It wouldn't be so bad if it was a one time charge or donation but monthly/yearly?
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 12
  • Posts: 766

Trying to install this python 3 program called broadlink but it is not installing.  Here is what happens - any clues what the problem is?

pi@raspberrypi:~ $ sudo pip3 show broadlink
pi@raspberrypi:~ $ sudo pip3 show pyaes
pi@raspberrypi:~ $ sudo pip3 install broadlink
Collecting broadlink
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
    "Cache-Control": "max-age=600",
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in _validate_conn
    conn.connect()
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 323, in connect
    ssl_context=context)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/ssl_.py", line 308, in ssl_wrap_socket
    context.load_verify_locations(ca_certs, ca_cert_dir)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 392, in load_verify_locations
    self._ctx.load_verify_locations(cafile, capath)
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 525, in load_verify_locations
    _raise_current_error()
  File "/usr/lib/python3/dist-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: []
pi@raspberrypi:~ $
 
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1017

Trying to install this python 3 program called broadlink but it is not installing.  Here is what happens - any clues what the problem is?

pi@raspberrypi:~ $ sudo pip3 show broadlink
pi@raspberrypi:~ $ sudo pip3 show pyaes
pi@raspberrypi:~ $ sudo pip3 install broadlink
Collecting broadlink
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
    "Cache-Control": "max-age=600",
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in _validate_conn
    conn.connect()
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 323, in connect
    ssl_context=context)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/ssl_.py", line 308, in ssl_wrap_socket
    context.load_verify_locations(ca_certs, ca_cert_dir)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 392, in load_verify_locations
    self._ctx.load_verify_locations(cafile, capath)
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 525, in load_verify_locations
    _raise_current_error()
  File "/usr/lib/python3/dist-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: []
pi@raspberrypi:~ $

Looks like SSL certificate issues.

Search the Domoticz forum and see how they configure SSL on their config file or if you can disable SSL completely. Your URL request is invalid for your type of connection.

Again, pain in the ass I know but each time you make a little progress take an image before you proceed with another step. You definitely don't want to be back at the vanilla version of Raspbian after all your good work.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1017

ya, sucks that that user decided to CHARGE for his Controlicz!
It wouldn't be so bad if it was a one time charge or donation but monthly/yearly?

It's completely out of the spirit of open source. You'll find that either that guy who's charging will go the way of the dinosaur or another developer will write an open source alternative.

Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 258
  • Posts: 9049
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software

It isn't  even in line with Amazons policy for skills as they are supposed to be free. i suspect if one complained to Amazon it would be pulled from the official skills list.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 19
  • Posts: 1017

It isn't  even in line with Amazons policy for skills as they are supposed to be free. i suspect if one complained to Amazon it would be pulled from the official skills list.

You'll find that clown contravenes the GPL licence too. I'd advise him to thread carefully.
Logged
Pages: [1] 2 3 ... 5
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.