X10 Community Forum

💬General Category => Mac/Linux & Open Source and the X10 Home => Raspberry Pi, Arduino & other SBC => Topic started by: mike on October 04, 2018, 06:23:28 PM

Title: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 04, 2018, 06:23:28 PM
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. 

Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 04, 2018, 07:26:34 PM
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.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 04, 2018, 07:57:58 PM
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
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 04, 2018, 09:00:38 PM
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?"
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 05, 2018, 08:35:15 AM
hmmm...   no need for ha-bridge:

http://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html#First_Time_Users
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 05, 2018, 08:53:04 AM
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. ::) :'
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 05, 2018, 09:17:25 AM
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.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 05, 2018, 10:02:44 AM
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! :(
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 05, 2018, 10:16:50 AM
ya, sucks that that user decided to CHARGE for his Controlicz! 
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 05, 2018, 11:01:53 AM
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?
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 05, 2018, 01:15:13 PM
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:~ $
 
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 05, 2018, 02:32:19 PM
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.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 05, 2018, 03:17:38 PM
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.

Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 05, 2018, 04:13:23 PM
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.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 05, 2018, 06:20:01 PM
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.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 06, 2018, 06:56:49 PM
Can someone tell me what is the link between n HA input and a broadlink output in ha-bridge?

I have all my domoticz devices defined and they list in ha-bridge folder domoticz-devices, right next to broadlink-devices.

I also have a working device in broadlink devices that arms/disarms my security panel.

The problem is I do not know how to LINK these two together. 

Any clues?
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 06, 2018, 08:23:09 PM
Don't possess an RM Broadlink so I'll not be much help to you.

Looks like Tuicemen was in search of the same result if this link was anything to go by. Looks like you might need an SDK to achieve this https://github.com/bwssytems/ha-bridge/issues/236
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 07, 2018, 08:05:10 AM
@petera that thread was prior to BWSsytems adding support for the Broadlink.
@mike I not sure I know what you mean by linking.
 If you mean when domoticz sees a command then send a command to HA-Bridge for the broadlink to send that would be a macro which I've not dug into setting up with domotics yet.

if you wish to know what command to send HA-Bridge for the Broadlink to send a command then that info is in the HA-Bridge readme and depends on if you have the security enabled.Ha-Bridge uses restful commands  which would be something like:
PUT   http://host:port/api/<username>/lights/<id>/state
host:port- would be domotics IP &port
Username- can be anything unless you enabled security then it must be the user name
<ID> is the device ID # ha-bridge assigned the device you wish to  (doesn't mater that it is broadlink)
State - is on or off
 
Or do you mean have Domotics see HA-Bridge configured Broadlink  devices like you security console?
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 07, 2018, 12:52:23 PM
@mike I'll fire up my Domoticz SD card I the PI or the ODROID to see if I can help with this. However I'm a bit in the dark about what your attempting when you say Link the two together.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 07, 2018, 04:36:29 PM
Thanks.  Since I am not sure HOW the broadlink is triggered to send one of its memorized RF commands, I  do not know how to ask the question...

In HG IIRC, we loaded a 'helper' program that allowed HG to talk to the ha-bridge...  this helper program added 5 'devices?' to the HG pull down list, so in HG we could have it learn an X10 command then make an icon to place in a room and assign it to one of these 5 ha interface names.  Then habridge used that and would fire off its memorized RF command when it was seen.  I think this is how it worked...

In domoticz, ha-bridge has an integrated helper called domoticz.  It automatically imported EVERY device (switch) I previously programmed in domoticz - into habridge.  Next to each is the BUILD button but that does not seem to link to a previously made broadlink ID. 

Also in habridge is another helper called broadlink.  It let us send via broadlink, RF commands previously taught thru android program and/or that german helper site... 

So I easily copied and pasted my security ARM & DISARM codes from my old habridge (actually I had saved them as a text file from the German site for use with HG and still have them), into my habridge on the pi.  Since there is a test ON, test OFF button in the broadlink page of habridge, I verified both ARM and DISARM work just fine.

But I cannot figure out how to make domoticz turn them on with one of its icons!  domoticz said it learned my kr10a when I pressed arm and disarm but the icon made does nothing but give a fault when pressed.  I don't care, I just want SOME icon in domoticz LINKED to my broadlink ARM/DISARM.   but I cannot figure out what that link is yet!

I have both habridge ono windows and habridge on pi working just fine - they do not interfere with each other.  I suppose I will try to turnHG back on and see if I can learn what I did to teach it to send broadlink a command to run the ARM or DISARM RF signal...

I vaguely recall something about ROW and ID that was the key:  they must be the same for both input (domoticz) and output (broadlink) but do not recall enough to make any sense of it yet.



Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 07, 2018, 04:41:06 PM
I would give up on Habridge and just move to the integrated into domoticz direct control of broadlink with a python program, but I cannot get it to load into my pi.  I am not alone;  many many others cannot set the simple command "sudo pip3 install broadlink" to load and run either.  seems back in April openSSL coding changed and very few folks SSL are any good anymore.   I have given up for now trying to make that work.  If someone would list the directories each python portion of this broadlink program and its plugins should be in, I would try some more.  But so far no one has listed that info.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 07, 2018, 05:03:17 PM
There are actually several broadlink programs on GitHub you might try one of those if you wish to move away from HA-Bridge.

To enable Domoticz to send the broadlink command simular to HG you may need to edit the Philips hue hardware plugin or you may be able to just install it (if you've not enabled security in HA-Bridge)
With the Philips hue hardware enabled you should be able to see devices configured in HA-Bridge or manually install. I'll see if I can figure this out but my ODROID refuses to load Java B:(
I do have a Domoticz SD for my PI so I'll try with it next.Since I have security enabled on my HA-Bridge I may need to edit the hue hardware plugin for Domoticz (if I can figure that out. ::) :'
Another way would be to see if there is a restfull plugin for domoticz
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 07, 2018, 05:46:24 PM
I would give up on Habridge and just move to the integrated into domoticz direct control of broadlink with a python program, but I cannot get it to load into my pi.  I am not alone;  many many others cannot set the simple command "sudo pip3 install broadlink" to load and run either.  seems back in April openSSL coding changed and very few folks SSL are any good anymore.   I have given up for now trying to make that work.  If someone would list the directories each python portion of this broadlink program and its plugins should be in, I would try some more.  But so far no one has listed that info.

Have you tried this as a solution. https://www.domoticz.com/forum/viewtopic.php?t=21645&start=260
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 07, 2018, 06:04:04 PM

Have you tried this as a solution. https://www.domoticz.com/forum/viewtopic.php?t=21645&start=260

I think my issue with openSSL is more to do wtih python and or python3 itself not really installed on my pi...   It SAYS it is I think, but trying to upgrade it from 3.5 to 3.6 says it does not even exist.  trying other pip or pip3 commands come back with no such directory or program...

I will copy a couple pages of my command line stuff and post tomorrow;  maybe you can spot what i am missing.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 07, 2018, 06:23:41 PM

Have you tried this as a solution. https://www.domoticz.com/forum/viewtopic.php?t=21645&start=260

I think my issue with openSSL is more to do wtih python and or python3 itself not really installed on my pi...   It SAYS it is I think, but trying to upgrade it from 3.5 to 3.6 says it does not even exist.  trying other pip or pip3 commands come back with no such directory or program...

I will copy a couple pages of my command line stuff and post tomorrow;  maybe you can spot what i am missing.

Something like this will install the latest version of python. From there I'm sure you can work the rest out. http://www.knight-of-pi.org/installing-python3-6-on-a-raspberry-pi/
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 07, 2018, 06:53:37 PM
there is  a renumber button in habridge for devices...  IIRC this number is used to link input to output stuff in habridge...   your pointing me to habridge readme  found in the bridge device tab:

Renumber Devices

This changes the numbering of the added devices to start at 1 and goes up from there. It was originally intended for a conversion from the previous system version that used large numbers and was not necessary. This also allows the system to try and number sequentially. If you use this button, you will need to re-discover your devices as their ID's will have changed.

I suspect this is why my inputs do not turn on outputs...  now to find how to delete all the discovered domoticz and let habridge rediscover them...
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 08, 2018, 08:26:48 AM
The renumbering feature was for legacy numbering.
to remove your domotics device scroll to the right hand side of where the test on/off/dim/edit buttons are and select delete for each device you wish to remove.

HA-Bridge doesn't see domoticz activity it uses the domoticz device info for Alexa to send the correct commands to domoticz.
in order to have domoticz send a command to a device in HA-Bridge you need to send a http "PUT" command to HA-Bridge

https://github.com/bwssytems/ha-bridge/blob/master/README.md#set-light-state
Using chrome postman you can experiment with sending restful commands to the Bridge.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 08:38:08 AM


Something like this will install the latest version of python. From there I'm sure you can work the rest out. http://www.knight-of-pi.org/installing-python3-6-on-a-raspberry-pi/

wow!  Thanks!  It installed python3 and I wrote a quick python program verifying it worked!  Then it let me istall the broadlink and paey thing!   I'm to try making it work!

Python comes preinstalled on rasbian I believe.  The issue I think was it was old;  was ver 9.0.1 IIRC, which I thought was latestest, yet your link uninstalled that and installed ver 18. something!  I think this was probably the solution!
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 08:41:05 AM
The renumbering feature was for legacy numbering.
to remove your domotics device scroll to the right hand side of where the test on/off/dim/edit buttons are and select delete for each device you wish to remove.

HA-Bridge doesn't see domoticz activity it uses the domoticz device info for Alexa to send the correct commands to domoticz.
in order to have domoticz send a command to a device in HA-Bridge you need to send a http "PUT" command to HA-Bridge

https://github.com/bwssytems/ha-bridge/blob/master/README.md#set-light-state
Using chrome postman you can experiment with sending restful commands to the Bridge.

Thanks.  Any command domoticz makes and sends to habridge as standard html/url is fine.  That just did not help me figure how to have THAT info trigger a broadlink learned security code - that works in habridge with the test buttons...

Perhaps the chrome test you found will help me understand!   I will check it out.  thanks.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 08, 2018, 08:47:17 AM
A standard html url will not work this had me confused originally as well.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 08:53:53 AM
A standard html url will not work this had me confused originally as well.

My turn to be confused as I actually have some of my std url codes Domiticz generates to make stand alone desktop icons to turn a device on or off?

For instance, domoticz sends "http://192.168.0.16:8080/json.htm?type=command&param=sa2=switchlight&idx=4&switchcmd=Off"     to turn x10 A2 switch off.  Then my standard cm15a (not one hooked to pi) sees A2 = off and runs a macro that shuts off A1 (modem DSL power) for 5 sec, then turns it back on, then resets A2 to on.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 08, 2018, 09:06:41 AM
Actually there are a number of ways you can send commands for X10. You can send to Domotics which your doing, or send directly to Mochad, or you can send to HA-Bridge. The fastest would be to send directly to mochad. Http commands to domoticz and mochad are simple url requests, Ha-Bridge uses restful commands(get/put/post/delete).
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 09:19:10 AM
Maybe that is my basic flaw in understanding...  yes, I can send command TO domo or mochad, and as others have shown to habridge via alexa (not sure if you can send json or url info to habridge to make it do something).  But I do not want to send TO domo -- I want domoticz to send to broadlink - the other way around...
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 08, 2018, 09:29:45 AM
I realize you want Domoticz to send to HA-Bridge and It should be possible.
Domoticz has a Philips hue Hardware device which uses simular code as the HA-Bridge (it is a hue emulator).
 Setting up the Philips Hue hardware device in Domoticz should allow you to send on/off/dim to a HA-Bridge configured device.

I've not had much luck with this as yet, B:( it worked in HG :o
It was a simple code change in HG to its Philips hue hub code to allow for the HA-Bridge Security
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 09:40:58 AM
thanks.  I believe I saw support for the hue thing in domoticz settings;  I have not clicked it;  will try that.

I have not complicated it with security at all yet.  Everything is local here, not subject to internet access.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 08, 2018, 09:45:31 AM
My HA-Bridge is not accessible from the web either but I do have the security enabled on the HA-Bridge.
You may wish to post a question on the HA-Bridge Gihub issues page as there are several Domoticz users, one of them may have a solution that us newbies haven't stumbled on yet. ;)
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 10:30:29 AM
hmmm...   I was spending more time on domoticz forum and domoticz heavy pages.  Perhaps the habridge forums may be the key.

For now I have been able to install supposed native broadlink python control into Domoticz.  I will experiment with it next to see if I make any progress...
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 12:08:08 PM
So I installed python 3.6 (I think), and it works but it must be in the wrong location?  Everything I am seeing seems to say it should be under:

/usr/local/lib/python3.5/:/usr/local/lib/python3.5/

but instead it is:

/home/pi/Python-3.6.3   

I have downloaded broadlink.zip with all its .py routines, so far unzipped it under 3 different directories, but none seem to be the right place yet.  Domoticz log complains:

 2018-10-08 11:58:14.423 Status: Mochad: connected to: 127.0.0.1:1099
2018-10-08 11:58:14.661 Status: PluginSystem: Entering work loop.
2018-10-08 11:58:15.016 Status: Python EventSystem: Initalizing event module.
2018-10-08 11:58:15.027 Status: EventSystem: Queue thread started...
2018-10-08 11:58:15.028 Status: EventSystem: Started
2018-10-08 11:58:16.252 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkRM2/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-10-08 11:58:16.252 Error: (rm) Module Import failed, exception: 'ImportError'
2018-10-08 11:58:16.252 Error: (rm) Module Import failed: ' Name: broadlink'
2018-10-08 11:58:16.252 Error: (rm) Error Line details not available.
2018-10-08 11:58:45.803 Status: (rm) Stop directive received.
2018-10-08 11:58:45.803 Status: (rm) Stopping threads.
2018-10-08 11:58:45.803 Status: (rm) Stopped.
2018-10-08 11:59:41.906 Status: (rm) Started.

another 4 hours down the drain.  give up for  lunch...

any hints what the above MEANS?

Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 08, 2018, 12:53:14 PM
Mike a big hint......a little more reading up needed.

Type python --version at the terminal to see what version is actually installed. What version of python does the plugin you're trying to install support.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 02:54:08 PM
ya, I've been reading.  There are TWO pythons active not just one.  In my case python --version = python 2.7.13    & my python3 --version = python 3.6.3

I will see if I can delete all thosde other pythons in this pi...    I know I know, back up first!
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 08, 2018, 03:10:23 PM
ya, I've been reading.  There are TWO pythons active not just one.  In my case python --version = python 2.7.13    & my python3 --version = python 3.6.3

I will see if I can delete all thosde other pythons in this pi...    I know I know, back up first!

No. Restore the image you have before you started experimenting with Python.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 08, 2018, 03:14:24 PM
Before you plough in to install a package run this command to see exactly what packages you already have installed sudo apt list --installed
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 03:26:59 PM
Same place I was heading....

I had just run this:

pi@raspberrypi:~ $ cd ..
pi@raspberrypi:/home $ cd pi
pi@raspberrypi:~ $ dir
Desktop    habridge-bak  oldconffiles  Python-3.6.3.tar.xz
Documents  MagPi         Pictures      python_games
domoticz   mochad        Public        Templates
Downloads  Music         Python-3.6.3  Videos
pi@raspberrypi:~ $ python --version
Python 2.7.13
pi@raspberrypi:~ $ python -V
Python 2.7.13
pi@raspberrypi:~ $ python3 --version
Python 3.6.3
pi@raspberrypi:~ $ python3 -V
Python 3.6.3
pi@raspberrypi:~ $ sudo apt install python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.5.3-1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Shows I got python all mixed up.  Domoticz clearly states it does NOT use python or python 2.7 - just python 3 above 3.4

time for previous image!
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 03:31:52 PM
Actually going back to working image with stretch GUI, mochad, & domoticz and NOT including HA-bridge...  I will refrain from installing python-3.6 unless needed;  if so, I will research more and find a different thread showing how to install it since the last one I installed from link we shared here probably put it in the wrong place.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 08, 2018, 04:15:01 PM
Are you using the Terminal locally or from an SSH sesssion
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 04:30:33 PM
both. if in house I use SSH, if in workshop I use terminal on the pi.  I have been in workshop all day.  about to quit for the day.

I accomplished going back to last working cc of raspbian without habridge and without my changed python3 stuff.

So true to form, I am back to SSL failures!!!!!!!!!!!!!!!!!!!!!!!!!!!   nothing will install into the python3.5 area or directories.

I will fiddle a bit more in house via SSH then go back and try to install python3.6.3 again, paying attention to where I start my install from - maybe I was in home/pi when Iran that install before?
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 08, 2018, 05:04:13 PM
Mike, Python is in the apt repositories. Sudo apt command is usually the safest way to install a package. Most of those other links you are looking at involve compiling a particular version of Python and then installing it. That means it is quite difficult to remove should it end up in the wrong place.

Unless its absolutely necessary otherwise do all your package installs from the repositories. If you do have to compile be careful where the compiled package ends up. Compiled solutions assume you have knowledge of the file/folder structures and permissions and ownerships.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 07:12:35 PM
Yes, I am beginning to see any python >3.5 gets installed in WEIRD locations - NOT in same one with python 2.7 & python3.5     guess that is just how it goes.  the new directory is then pointed to in path command it seems...

so I found github has ver 3.7.1;  might as well go all the way!  so I am installing it at this time.  i was able to drop it into a folder under /usr/src...

what is an 'apt repository?'  I found some eplanations of a command called GIT that will get aps from github?  No clue how to master THAT yet...

Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 08, 2018, 07:54:22 PM
Yes, I am beginning to see any python >3.5 gets installed in WEIRD locations - NOT in same one with python 2.7 & python3.5     guess that is just how it goes.  the new directory is then pointed to in path command it seems...

so I found github has ver 3.7.1;  might as well go all the way!  so I am installing it at this time.  i was able to drop it into a folder under /usr/src...

what is an 'apt repository?'  I found some eplanations of a command called GIT that will get aps from github?  No clue how to master THAT yet...

An apt repository is where a particular distribution of Linux stores its packages. They are fully tested and certified for that distribution. They are installed with the command sudo apt-get in Raspbian and removed cleanly by sudo apt-get remove or sudo apt-get purge.

GitHub or git is a place where individuals publish their source code projects to. They can be downloaded or cloned and are compiled locally on the users machine. Unless there's clear explicit instructions on how to to do this it is not a method I'd recommend unless you know what you are doing.

As an example, Mochad is not in any repository and there's a number of different versions all stored in different developers Githubs. There is thankfully explicit instructions on how to compile and install.

As I explained in an earlier post, one sure way of breaking a Raspbian installation is the incorrect installation of a package from a GitHub.

The weird locations you refer to are only weird by way of where you are located when you start the process. I'm assuming you are always in your /home/Pi folder when you should be directing the process to /usr/local/bin or such like. Remember different folders have different read/write permissions and ownerships.

I could go on all night but suffice to say you need to fully understand the file and folder structures to build your own particular version of a package from the GitHub.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 08, 2018, 08:06:43 PM
yep.  poor python 3.7.1rc1 is crashing away right now in SSH after trying hard to install and make for the last couple hours.  Seems it has run my pi out of memory:

virtual memory exhausted: Cannot allocate memory
virtual memory exhausted: Cannot allocate memory
virtual memory exhausted: Cannot allocate memory
Makefile:1623: recipe for target 'Parser/node.o' failed
make[3]: *** [Parser/node.o] Error 1
Makefile:1623: recipe for target 'Parser/listnode.o' failed
make[3]: *** [Parser/listnode.o] Error 1
Makefile:1623: recipe for target 'Parser/firstsets.o' failed
make[3]: *** [Parser/firstsets.o] Error 1
Makefile:1623: recipe for target 'Parser/grammar.o' failed
make[3]: *** [Parser/grammar.o] Error 1
Makefile:1623: recipe for target 'Parser/pgen.o' failed
make[3]: *** [Parser/pgen.o] Error 1

Soooo...  tomorrow I will reimage and start over with python3 ver 3.6, which does have a bunch of exact how to's to install.  I will start it in the same directory as the other 2 distributed pythons and use sudo to gain permission to do so.  or maybe just let it install in home/pi again since it does not seem to reallyl matter where it is.  I think what was missing before was my adding a Path statement to point to it and also not giving the .py files permission to run with that permissions command (forget what it is off hand now) that domiticz did not include but is likely required.

leaning toward this install:
https://tutorials.technology/tutorials/67-Installing-python-36-on-raspberrypi.html
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 09, 2018, 12:51:14 PM
anyone ever have ann image write take 5 hours?  2.6MB/sec...     started it at 9:30am and it is 85% finished with verify...  might be first time I am imaging 16gb across my home network - had to move my images to my network 2tb drive - filled up my local SSD C: drive!  probably will not image across network again but cc image back to local SSD C: drive first next time...
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 09, 2018, 01:30:49 PM
if your using wi-fi and not wired I can see it taking a long time. it will be considerably longer over the network then locally from same PC and you may encounter errors.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: bkenobi on October 09, 2018, 05:08:29 PM
I would suggest changing your backup approach.  When I create a backup, I use RPi-clone.  The problem with the standard backup is that if you use a 16GB SD, it will create a 16GB image.  The image only needs to save the data and not the blank space.  However, the image will save all the blank space too.  If you are using a 16GB card now and want to create a new card to test on, you can't use a smaller one since it will not have enough space to write all the blank space.  When using RPi-clone it will only copy the files to the new drive so it will be very quick and can copy a system on 32GB card down to a 2GB card potentially.  You can also run a scheduled backup which will only copy newly modified files.

I understand you are creating an image that can be stored somewhere else.  What I am doing is using a second SD card installed in a USB adapter to duplicate the file system over to.  If the original fails, I can pull the backup and simply put it in the RPi card slot.  If you use an image, you need a running system to write the image.

That said, if you are planning on sharing your setup, the image file will be a better approach.

https://github.com/billw2/rpi-clone (https://github.com/billw2/rpi-clone)
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 09, 2018, 05:20:34 PM
THANK you bkenobi!!   Yes,, I filled ll the free space on my 250gb SSD C: windows drive doing 5-6 images.  So decided to move them to the network RAID drive but then had the speed issue - yes tuicemen, my network connection was wifi (the etherneet connection are used for my cameras on another network mask).

I will definitely learn this rpi clone thing and switch to it.  I have open USB ports on my 8 port powered USB unit on pi so can easily use that!   

Thanks!

I am right now in midst of python 3.7.0 install on my pi so I can add broadlink RM native support.  o far so good.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 09, 2018, 05:50:45 PM
anyone ever have ann image write take 5 hours?  2.6MB/sec...     started it at 9:30am and it is 85% finished with verify...  might be first time I am imaging 16gb across my home network - had to move my images to my network 2tb drive - filled up my local SSD C: drive!  probably will not image across network again but cc image back to local SSD C: drive first next time...

Taking an image write of a 16gb card takes typically 20 minutes or so. That's a write from the USB card reader via a desktop to an external USB2.0 drive. Simplest way to do it. The external USB drive is 500gb so stores approx 30x16gb image writes.

There must be some serious bottleneck on your home network.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 11, 2018, 12:16:44 PM
So after 3 days of installing python3-3.7.0 and it showing as python3 -V,    until a reboot...   I cannot get it back.  I am back to showing 3.5.3 as my version - which will not work with broadlink install...

I have kept trying until last night my SD card seems to have died when I frustratingly tried to swap monitor hdmi cables while powered up.  Sd card won't start pi anymore, so back to last backup - that had working python3 -3.6.3   

So I tried to continue where I left off here...   It has working mochad, working domoticz, working python3.  I thought my issue may have been I never gave the plugins permission to run, so did chmod +x to each of the plugins.   reset domoticz, it loaded broadlink into hardware  like before, but still won't run.  Here is my domoticz log - it appears someone somewhere is still pointing to python3- 3.5   --- any clue how to fix this?

 2018-10-11 12:08:24.829 Status: Domoticz V4.10049 (c)2012-2018 GizMoCuz
2018-10-11 12:08:24.833 Status: Build Hash: 098a95eb, Date: 2018-10-08 07:22:42
2018-10-11 12:08:24.834 Status: Startup Path: /home/pi/domoticz/
2018-10-11 12:08:25.121 Sunrise: 07:44:00 SunSet: 19:05:00
2018-10-11 12:08:25.121 Day length: 11:21:00 Sun at south: 13:05:00
2018-10-11 12:08:25.121 Civil twilight start: 07:17:00 Civil twilight end: 19:32:00
2018-10-11 12:08:25.121 Nautical twilight start: 06:46:00 Nautical twilight end: 20:03:00
2018-10-11 12:08:25.121 Astronomical twilight start: 06:15:00 Astronomical twilight end: 20:34:00
2018-10-11 12:08:25.944 Active notification Subsystems: (0/13)
2018-10-11 12:08:25.122 Status: EventSystem: reset all events...
2018-10-11 12:08:25.906 Status: PluginSystem: Started, Python version '3.5.3'.
2018-10-11 12:08:25.970 Status: WebServer(HTTP) started on address: :: with port 8080
2018-10-11 12:08:26.037 Starting shared server on: :::6144
2018-10-11 12:08:26.021 Status: WebServer(SSL) started on address: :: with port 443
2018-10-11 12:08:26.028 Status: Proxymanager started.
2018-10-11 12:08:26.039 Status: TCPServer: shared server started...
2018-10-11 12:08:26.040 Status: RxQueue: queue worker started...
2018-10-11 12:08:28.043 Status: EventSystem: reset all events...
2018-10-11 12:08:28.045 Status: EventSystem: reset all device statuses...
2018-10-11 12:08:28.052 Status: Mochad: trying to connect to 127.0.0.1:1099
2018-10-11 12:08:28.054 Status: Mochad: connected to: 127.0.0.1:1099
2018-10-11 12:08:28.154 Status: PluginSystem: Entering work loop.
2018-10-11 12:08:28.671 Status: Python EventSystem: Initalizing event module.
2018-10-11 12:08:28.673 Status: EventSystem: Queue thread started...
2018-10-11 12:08:28.674 Status: EventSystem: Started
2018-10-11 12:09:10.096 Status: (Broadlink RM2) Started.
2018-10-11 12:09:11.297 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkRM2/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-10-11 12:09:11.298 Error: (Broadlink RM2) Module Import failed, exception: 'ImportError'
2018-10-11 12:09:11.298 Error: (Broadlink RM2) Module Import failed: ' Name: broadlink'
2018-10-11 12:09:11.298 Error: (Broadlink RM2) Error Line details not available.
2018-10-11 12:09:33.681 (Mochad) Security (ARM/Disarm DS7000)
2018-10-11 12:09:34.400 (Mochad) Security (ARM/Disarm DS7000)
2018-10-11 12:09:39.696 (Mochad) Lighting 1 (Ele Workshop Music)
2018-10-11 12:09:39.720 (Mochad) Lighting 1 (Ele Workshop Music)
2018-10-11 12:09:43.220 (Mochad) Lighting 1 (Ele Workshop Music)
2018-10-11 12:09:43.244 (Mochad) Lighting 1 (Ele Workshop Music)
2018-10-11 12:09:44.083 (Mochad) Lighting 1 (Ele Workshop Music)
2018-10-11 12:10:18.796 Error: Broadlink RM2 hardware (3) thread seems to have ended unexpectedly
2018-10-11 12:10:32.802 Error: Broadlink RM2 hardware (3) thread seems to have ended unexpectedly
2018-10-11 12:10:46.808 Error: Broadlink RM2 hardware (3) thread seems to have ended unexpectedly
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 11, 2018, 04:10:38 PM
I wonder if hot swapping hdmi plugs caused my SD card to crash and burn?  I went to reimage it and it only showed the 30mb boot partician;  it got so hot it almost melted the SD card adapter. 

Guess I shorted another piece!

Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 11, 2018, 04:36:22 PM
Mike I mentioned it before, not advisable to unplug the HDMI at the Pi Zero while it's powered up.

In the meantime have a read of this link from start to finish. Don't just start ploughing away at the first solution https://www.domoticz.com/forum/viewtopic.php?t=16859&start=80

In the meantime, if you're not already registered on the Domoticz forum I'd advise you to do so. They seem to be a knowledgeable bunch over there and I'm sure they'll save you hours of hair pulling.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: Tuicemen on October 11, 2018, 04:41:58 PM
@mike I think you best stick with what is known to work with the Zero W. :o
Your exploits are enough to deter anyone from playing with a PI and X10.
I my self have not had good luck with Domoticz and a SBC but I at least haven't toasted anything (Yet)
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: petera on October 11, 2018, 05:14:48 PM
@mike I think you best stick with what is known to work with the Zero W. :o
Your exploits are enough to deter anyone from playing with a PI and X10.
I my self have not had good luck with Domoticz and a SBC but I at least haven't toasted anything (Yet)

As you can see from this report Python is fast taking hold of the programming world. It's here to stay so it's worth getting your head around it. https://www.hpcwire.com/2018/08/07/python-remains-the-most-popular-programming-language/

Many developers on the GitHub start really good projects that work well when they are created. Unfortunately they get distracted and fail to maintain them. Python versioning is happening at such a pace even a point version upgrade can kill a very worthy project if it's not maintained. Documentation is another bugbear with these "crazy developers"  :)

It's vital to keep an eye on these changes when you introduce 3rd party projects into your mainstream setup.

In Mikes situation he needs to understand that you can't have two different versions of Python residing on the same system unless they are protected in a virtual environment.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 12, 2018, 11:52:02 AM
https://github.com/billw2/rpi-clone (https://github.com/billw2/rpi-clone)

Thank you so much for this idea.  I installed it and played with it.  I plugged in a 64GB SD card in USB adapter to my hub and see it.  So this would indeed make smaller backups it seems.  My problem is I am still not so good at linux, and unless I miss all the instrucs I read, to restore one of these backups requires a running pi!  So if I just have one running SD pi card, and it messes up, I am finished and cannot run rpi-clone to recover.  Or I need a image of another running card with rpi installed on it to run to pull off the backup;  but then it would overwrite my backup imaged SD card...    I think I should stick to windows for imaging. 

That said, I search for similar programs that can backup only the used portion of a card, and rewrite a SD card that may be smaller...   found this:  https://www.alexpage.de/    USB Image Tool that will make an image that is the data size not the SD size.  I have not experimented with it yet.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: bkenobi on October 12, 2018, 02:21:08 PM
My problem is I am still not so good at linux, and unless I miss all the instrucs I read, to restore one of these backups requires a running pi!  So if I just have one running SD pi card, and it messes up, I am finished and cannot run rpi-clone to recover.  Or I need a image of another running card with rpi installed on it to run to pull off the backup;  but then it would overwrite my backup imaged SD card...    I think I should stick to windows for imaging.

The goal of RPi-Clone is to have a second SD card that you duplicate your working card onto.  You can do it once and have a backup sitting on a shelf or do it periodically and have a live backup (for RPi with only 1 SC slot, you will need an adapter of some kind).  In either case, should you have a problem with the boot card where it won't work, you simply power down the RPi, pull the non-working card, replace it with your backup card, reboot.  There isn't anything else easier out there IMO.

If you use your current approach, you need a working computer of some kind (PC, RPi, etc) that can write an image file to SD.  With RPi-Clone, you only need the one RPi and it must be working at the time of the backup.  That's it.

EDIT:
The only thing you need to be careful of is selecting the correct drive in the right order.  If you backup SDB to SDA and the original were in SDA, you'd write a blank file system to the boot and would be hosed.  It's not difficult to use RPi-Clone, but I can't say that it's impossible to break things as I didn't write the code nor have I verified it has checks to keep you from doing serious damage to the boot OS.
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: mike on October 13, 2018, 08:18:48 AM
well that sure sounds good.  I misunderstood;  my takeaway was each 'image' was a special commpressed FILE copied to the USB stick SD card.  So I would put in a 64GB SD card and copy multiple times to it.  Then, to use it, find a working SD card to install (from elsewhere) with the clone program on it, and pull off a copy of the image and I guess overwrite the good backup SD card I just booted with... 
Title: Re: x10 with domoticz, mochad, & ha-bridge on Pi, with external broadlink RM
Post by: bkenobi on October 13, 2018, 04:03:15 PM
You could do it that way.  I don't think you'd be able to get multiple versions on the same SD with this approach.  It's intended as an easy way to create a backup/duplicate boot SD for the RPi.  If you really want images this won't work for you.  However, if you have a stack of SD cards sitting around, you simply write a backup to one and label it (sticky note?).  You can create multiple and they all are as easy to use as swap them in and reboot.

If you want to archive on a HDD, use the normal imaging tool.  If you want a backup card that's ready to go instantly on a failure, use RPi-Clone.