Please login or register.

Login with username, password and session length
Pages: 1 2 3 [4] 5 6 7

Author Topic: installing helper programs to pi for X10 integration  (Read 26875 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #45 on: October 26, 2018, 11:26:57 AM »

yep, I stopped renting Verizon's ($10/mo IIRC) years ago also.  My last buy seemed highly recommended (Actiontec GT784) and has been the worst one I ever owned;  they have a memory leak that causes it to lock up multiple times daily and they have not fixed it for the year I have owned it.  Plenty of 'reboot' problems listed on line about it.

Anyway this IQrouter sounds like the latest and greatest;  keep my crappy 784 and just turn off it's wireless & set DMZ to send all directly to the new IQrouter. 
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: installing helper programs to pi for X10 integration
« Reply #46 on: October 26, 2018, 11:54:15 AM »

You could have the "best of/worst of" discussion on the subject of routers and still not reach a consensus. What is interesting is this approach which a number of colleagues have used to liberate their routers and unleash their full potential. It's worth checking out what routers are compatible with this approach https://www.flashrouters.com/learn/router-basics/what-is-dd-wrt
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: installing helper programs to pi for X10 integration
« Reply #47 on: October 26, 2018, 12:01:50 PM »

If you really want to go the DIY Pi route https://www.raspberrypi.org/forums/viewtopic.php?t=141578

You can see how versatile the Raspberry Pi becomes in this case. Gotta a problem, getta Pi  :)
Logged

brobin

  • Hero Member
  • *****
  • Helpful Post Rating: 160
  • Posts: 1458
Re: installing helper programs to pi for X10 integration
« Reply #48 on: October 26, 2018, 12:50:40 PM »

You could have the "best of/worst of" discussion on the subject of routers and still not reach a consensus. What is interesting is this approach which a number of colleagues have used to liberate their routers and unleash their full potential. It's worth checking out what routers are compatible with this approach https://www.flashrouters.com/learn/router-basics/what-is-dd-wrt

Agreed. DD-WRT or options like Tomato let you really optimize your router. Been running it for years.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: installing helper programs to pi for X10 integration
« Reply #49 on: October 26, 2018, 01:50:11 PM »

You could have the "best of/worst of" discussion on the subject of routers and still not reach a consensus. What is interesting is this approach which a number of colleagues have used to liberate their routers and unleash their full potential. It's worth checking out what routers are compatible with this approach https://www.flashrouters.com/learn/router-basics/what-is-dd-wrt

Agreed. DD-WRT or options like Tomato let you really optimize your router. Been running it for years.

That experience will be invaluable here. Free your router  :)%
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: installing helper programs to pi for X10 integration
« Reply #50 on: October 26, 2018, 05:20:24 PM »

DDWRT here for years.  I should update to a newer router since my Linksys WRT routers are not exactly cutting edge, but they work so well with DDWRT that I'd require the new one have that available.  Almost pulled the plug last month when Amazon had a gigabit router on sale, but turned out not compatible.

Anyone know of a gigabit router with wifi that doesn't cost a million dollars and supports DDWRT?  I have 2 routers currently installed to get full wifi coverage.

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #51 on: October 26, 2018, 06:05:33 PM »

So I have enough codes now in e-control to do everything I want.  I was able to build anew ARM and DISARM as I want, and, in e-control on my phone, I can arm and disarm my DS7000.

So all I need is to move the codes from android over to my pi.

A decent sounding decipher program is:

https://github.com/NightRang3r/Broadlink-e-control-db-dump/blob/master/getBroadlinkSharedData.py

But I cannot make it run on my pi... 

Can someone help me figure out how to run this python program?

If not, I can spend another few hours and decode the files myself.  I already downloaded them from my phone onto the pi, but there are 40 of them, and without this decoder to splice 3 files worth of data together, it will take me hours to experiment and find which 2 out of the 40 I want...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #52 on: October 26, 2018, 06:22:55 PM »

said another way, it appears they want me to 'run a script.'

I am assuming the script is the C type program shown.  In this case it is:
-----------------------------------------------------

# -*- coding: utf-8 -*-

'''
This script will "parse" the broadlink e-Control Android application "SharedData" json files and dump the IR / RF codes for selected accessories into a text file which can be later used with broadlink-python to send the codes to the RM PRO hub
NO ROOT ACCESS REQUIRED
Just connect your Android device to your computer and browse the SD card / External Storage folder "/broadlink/newremote/SharedData/"
You need to get the following files:
jsonSubIr
jsonButton
jsonIrCode
and put them in the same folder as this script.
run: python getBroadlinkSharedData.py
or duplicate code by number
python getBroadlinkSharedData.py 5
'''

import simplejson as json
import base64, sys


if len(sys.argv) > 1:
    MultipleCode = sys.argv[1]
else:
    MultipleCode = "1"


buttonIDS = []
buttonNames = []


jsonSubIr = open("jsonSubIr").read()
jsonSubIrData = json.loads(jsonSubIr)


for i in range(0, len(jsonSubIrData)):
    print "ID:", jsonSubIrData['id'], "| Name:", jsonSubIrData['name']


choice = input("Select accessory ID: ")

for i in range(0, len(jsonSubIrData)):
    if jsonSubIrData['id'] == choice:
        accessory_name = jsonSubIrData['name']
        print "
  • You selected: ", accessory_name



jsonButton = open("jsonButton").read()
jsonButtonData = json.loads(jsonButton)


for i in range(0, len(jsonButtonData)):
    if jsonButtonData['subIRId'] == choice:
        buttonIDS.append(jsonButtonData['id'])
        buttonNames.append(jsonButtonData['name'])


jsonIrCode = open("jsonIrCode").read()
jsonIrCodeData = json.loads(jsonIrCode)


print "
  • Dumping codes to " + accessory_name + ".txt"

codesFile = open(accessory_name + '.txt', 'w')

for i in range(0, len(jsonIrCodeData)):
    for j in range(0, len(buttonIDS)):
        if jsonIrCodeData['buttonId'] == buttonIDS[j]:
            code = ''.join('%02x' % (i & 0xff) for i in jsonIrCodeData['code']) * int(MultipleCode)
            code_base64 = code.decode("hex").encode("base64")
            result = "Button Name: " + buttonNames[j] + "\r\n" + "Button ID: " + str(jsonIrCodeData['buttonId']) + "\r\n" + "Code: " + code  + "\r\n" + "Base64: " + "\r\n" + code_base64 + "\r\n"
codesFile.writelines(result.encode('utf-8'))
----------------------------------------------------

So, how do I run it?  do i copy the above into a text file and name it "getBroadlinkSharedData.py "?

then in SSH window type:

getBroadlinkSharedData.py
or
python getBroadlinkSharedData.py 
or
run python getBroadlinkSharedData.py     ???

This is crazy!
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #53 on: October 26, 2018, 07:11:44 PM »

Well, guess necessity makes things happen...  I had to learn how to do this...  So I copied it to a file, and learned a python program runs by calling it from command line as    python  scriptname...

I imported all 40 codes from my phone to a directory on my pi.  Now I can make a bunch of IR buttons and then come back and copy/paste MY codes over into each of them.

Pretty round about way but at least it will get it don while waiting on broadlink plugin author getting RF and import functions to work.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #54 on: October 27, 2018, 08:45:18 AM »

domoticz now sends security commands   :)  I can arm and disarm...    AHP days may be numbered...

I need to make a new backup image, so will change my pi pw back to raspberry and make it then post link to the image on my dropbox.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: installing helper programs to pi for X10 integration
« Reply #55 on: October 27, 2018, 09:53:02 AM »

Python as you have now discovered is a very powerful and versatile language. In most cases when you find a program on the GitHub you can write a python wrapper to use it in your setup.

Now that you have a functioning setup running as you require you can further expand it via the Domoticz forum and of course the many Python resources on the web.

You might want to research the possibility of creating a Python Docker image of your setup as it is easier to distribute. Alternatively you could package it in a Python Virtualenv for convenience. Plenty of documentation out there on both alternatives.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: installing helper programs to pi for X10 integration
« Reply #56 on: October 27, 2018, 10:03:25 AM »

Mike, on a side note, ensure your credentials are not included on any image you upload. It's an easy thing to overlook but fatal if it happens.
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #58 on: October 27, 2018, 10:26:08 AM »

Mike, on a side note, ensure your credentials are not included on any image you upload. It's an easy thing to overlook but fatal if it happens.

I just made a backup image, now writing another 8gb card with it - I will then go in and change pi pw back & remove my wifi info, write THAT image for distribution to anyone who wants to try it.

BUT I while it is writing the new SD card to remove p's from, I weill investigate your other programs - tnx.   

Dave, thanks for the security check article - reading now...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: installing helper programs to pi for X10 integration
« Reply #59 on: October 28, 2018, 09:29:20 AM »

Back to the drawing board...  I installed simplejson in order to run a python program to dice my X10 e-control codes into hex commands more easily...   I assume that is what brock mochad...   after a reboot (due to shutting down to make final image) of a totally running system, mochad no longer worked...   

Eventually I deleted the mochad-0.1.17 full directory and reintalled ver 1.16 and after messing around got it to work again.  But not wanting 1.16, I deleted that and reinstalled 1.17 and got it working again.  a reboot and IIRC I think it till worked...  But a couple hours later mochad was unresponsive again.  Reboot did not bring it back - cannot find cm15.

I hate it when more than 1 thing happens between issues:  I had just finished programming a neat 60 watt smart LED lightbulb (3000-5500k color adjustment, dimming, on off, timers,  some other cute things, all over the wifi network)  - on the same power strip as my cm15 tester...   So for a while I thought the smart LED killed my cm15.  A quick plug in into AHP proved it was still good.

I think I reimaged my card from good last image and mochad was still NFG, but can't swear to it now..  I think I also reinstalled mochad 2x and each time got it to work - for an hour or so...

Glad I am keeping running copies of my images...   back to the drawing board...
Logged
Pages: 1 2 3 [4] 5 6 7
 

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