[UPDATED] Node Red Bridge for X-10 Devices (Switches, Modules, Remotes, Sensors and Security Modules)

smartapp
dth_motionsensor
dth_remotes
smartapp_remotes
x10

(Enis Hoca) #161

do you even have mochad started?
does mochad show up in ps list for the machine?
what happens when you try to run mochad from the command line?
you may want to google a tutorial on getting mochad running on a pi and get to a point when you can successfully use send commands on port 1099.

This is a good discussion https://forums.homeseer.com/forum/lighting-primary-technology-plug-ins/lighting-primary-technology-discussion/x10-homeseer/107841-zee-s2-1132cu-controller-on-cm15a-plugin-will-not-communicate-hdwe-not-supported/page2

find other similar things and getting talking on 1099 first - also make sure your power supply to the pi has enough amperage - lot of people use under-powered phone charger and they don’t supply enough power to the USB ports


(Dan Belliveau) #162

Thank you for the support and the directions. I will take a look at all of these this week…

What amperage do you suggest for the power supply…? The one I am using is 2.5A…

Thanks again, Dan

Update: Got the on/off to work… Turns out mochad was not running and I had to run it manually. I will play around to see why it isn’t running at startup. I made the edit to the startup file… Thanks for the help, on to the next phase…


(phil) #163

SO]o everything has been going well but wanted to extend the X10 system because I am having issues with my garage door. I installed solar and it seems to be effecting my regular garage door opener so I was going to rely on X10. However, the computer that I have Non-red and such is a ways to way. So what would be the best way to extend because I don’t think each RF device is a repeater.


(Enis Hoca) #164

The whole charm of X10 was it travelled over electric wires - the role of RF was primarily listening to remotes and sensors and such. Unless you got some inductivw noise issues going on the line those signals would go all the way to the poles sometimes to neighbors houses.

If you put a normal x-10 rf receiver anywhere and send it signal using CM19/12 it will take the signal and put it on the electric wire. receiver doesn’t have to be near the device it’s conteolling. There would be 3 limitations you need to consider and mitigate:

  1. House code you are using - x-10 receivers can only use one house code
  2. Phase - make sure both sender the switch you are trying to control and rf reciever are on the same phase
  3. Electrical noise and isolation issues - depending on the age and wiring of your house this may or may not be an issue.

Here is what i would do - first figure out what what phase the outlet where you will put the garage door is on by turning off one of the phases breakers. Then find another outlet on the same phase somewhere between where you are transmitting the signal and garage door - plug in the reciever there and test using a good old fashioned x10 remote


(phil) #165

Well that gives me a good start and I will go through the proceess. However, here is my real issue and it is going to sound kind of bazar but I have read this in other place. Recently we installed a solar system. During the day, ONLY DURING THE DAY, none of my garage door opener remotes work. SO what I was going to try to do is put together a work around by using an X10 remote in my car to trigger my MYQ system through smartthing. The ST option has worked for years. It is just adding the x10 remote portion that wont work. Going to try what you put together and see if I can get it to work. I just think that I wont be able to get it on the same phase since I have multiple electrical boxes and it is pretty far away from my garage.


(Pete) #166

Observation and Question:
O: I see that your code is only allowing a single event through at a time, for example I occasionally need to reissue a particular X10 command to a device (or a device has been set to another state by another means [eg remote timer etc]).

Q: where is this in your code and can it be commented/disabled ?
Are there any other ramifications if this is done (that you are aware of )?


(Pete) #167

Great Work and a Huge THANK YOU !

OK found a working solution to insure you can always send a command

Im not sure if this is the best way to do this, but it seems effective

Updated "X-10 Node Red Device’
to basically unset then set so the command gets acted on
This makes ST think a switch is in the other state then sends the command
(Useful if you set devices manually via X10 or other systems)

def on() {
log.debug “Executing ‘on’”
sendEvent(name : “switch”, value : “off”);
sendEvent(name : “switch”, value : “on”);
}

def off() {
log.debug “Executing ‘off’”
sendEvent(name : “switch”, value : “on”);
sendEvent(name : “switch”, value : “off”);
}

Also adjusted the “Rate Limiter” in the node-red code to 1.5 seconds, as commands could happen too fast in sequence (may be connection speed dependent )


(Pete) #168

Ok cleaner way to handle the switch states eg Force them

in the DH (both on and off)

sendEvent(name : “switch”, value : “on” , isStateChange : “true”);

forces the state change to always true, so the command always gets sent


(Enis Hoca) #169

I guess that would work - everything in X-10 is a hack no matter what you do. The fundamental challenge is that there is no central controller and devices usually can’t report their state. So whatever works for you.

My solution has been to use ST as the system of record, and not use any X-10 devices directly, so controllers control virtual devices in ST and ST controls physical devices. Generally things stay in sync this way unless there is a power failure.


(Marc) #170

Just wanted to give a big THANKS to @enis for creating this and to @dgruen45 for the step-by-step write-up. I happened to stumble on this thread a few days ago…this is something I’ve been looking to do for several months now. Everything working great with my old CM15 and RPi 2.

Haven’t tried the suggestion by Pete, as I will likely pass everything through Google Home/ST for the couple X10 devices I need to control, but will keep it in mind if things start acting funny. Thanks again!


(Richard W) #171

I really like the simplicity of this solution and the integration it provides for using my X10 switches and modules with SmartThings. I have tested the above idea from pjf02536, and it solves several issues I have had with the X10 devices, including my X10-compatible thermostat (the temperatures I generally use are always in an On state in SmartThings). I couldn’t manually adjust the temperature at the thermostat to a different setting and then use SmartThings to set it back to the desired night temperature without having to toggle that switch. Scenes for the X10 address would not do it. Automations could accomplish it, but would take away the ability to easily adjust it at other times when needed.

Now, I am trying to figure out how to use my WGL X10 Whole House receiver to work with this since I cannot receive X10 codes on the CM15a using this solution. I started using the WGL receiver many years ago because the CM15a did not have acceptable RF reception. Does anyone have any ideas?


(Enis Hoca) #172

That’s the problem with using exotic tech, once you deviate from what came in the box you are on your own. That said if it has a command line or telnet interface then you should be able use Node Red to talk to it, however you will need to solve the technical bits and code it yourself. This solutions supports 2 very different hardware devices and protocols CM15/19 usb using mochad, and CM11/17 using heyu. If there is something equivalent to Mochad/Heyu for WGL then you should look the differences between mocah/heyu node red stuff and make an similar adaptations for WGL.


(Richard W) #173

The WGL X10 Whole House Transceiver is used similarly to the X10 SR731 or the newer SR751. In the case of the WGL device, it receives the X-10 wireless signal and then sends the signal across the powerline. I had disabled RF ability on the CM15A due to its very poor wireless reception and used the WGL for my X-10 remotes and other wireless devices. The CM15A would then receive the signal coming from the WGL on the powerline and allow the control of the devices and macros. For the most part, I had mapped the keys on the X-10 remotes to macros in the X-10 ActiveHome software for controlling everything in the house.

What I am now missing is the ability for the CM15A to be a two-way or bidirectional device. If there were a way to receive powerline X-10 signals on the CM15A to then perform actions in SmartThings, it would be great since I could then use all of my X-10 gear. Then, the final missing piece would be how to get the functionality I had with the native X-10 ActiveHome software to allow me to use any button on the X-10 remote to perform any action. That gave me the ability to have up to 32 different things that I could do with one X-10 HR12A remote.


(Dan G) #174

I have updated my Set-Up guide with changes to allow Google and X-10 to stay in sync. It appears to be working very well. Thank you pjf02536 for the help to get this completed!

Click here to view the UPDATED Set-Up Guide. Note: Changes from the original version of the Set-Up Guide are in YELLOW.

I have NOT updated Mochad and Node-Red to any newer versions than those specified in the guide.

Now I can use my RF remotes, CM11 and Google to control all my X-10 devices and all stay in sync.

BTW - I use the WGL V572RF32 RF receiver for X-10 and it works great! The WGL is connected to a JVDE XTB-523. This covers my whole house (~4800 sqft) plus controls my pool. You will need to consider which leg of your split phase power the X-10 is on or use a phase coupler - you can buy from JVDE as well.

The guide will show you how to turn off the CM15A’s RF receiver so as not to conflict with the WGL RF.


(Enis Hoca) #175

Thanks @dgruen45 I will add the links to the main post. Would be great if you describe your setup a bit more. I don’t see any mention of WGL in the guide - how are you interfacing WGL with mochad?


(Enis Hoca) #176

@richard.w Did you make an progress ?
I don’t understand this question completely

What I am now missing is the ability for the CM15A to be a two-way or bidirectional device. If there were a way to receive powerline X-10 signals on the CM15A to then perform actions in SmartThings,

Mochad can send and receive X-10 signals from CM15A including powerline signals.

My apps let you send/receive X-10 signals to/from mochad and Heyu let ST react to them.
Your usage with ActiveHome seems similar to what I recommend people, i.e. don’t tie remote buttons to physical devices instead tie them to virtual buttons in ST then ST can be man in the middle, and you can use any of the other wonderful ST automation apps.

So seems like I am missing something, you said CM15A was able to receive signals with ActiveHome, are you not able to get this working with mochad?


(Richard W) #178

I will do some additional testing. Before, when I tried sending an X10 signal to the CM15A with Mochad, nothing happened. I will try to do some additional testing later this week. If Mochad really can send and receive power line commands, that will be fantastic news for me!


(Enis Hoca) #179

Try using nc to send signals first
make sure mochad is running
Then connect to the host with nc
nc localhost 1099

Then send an RF command to test
RF A1 ON

If that works send the PL command
PL A1 ON
There are a couple things to watch out

  1. Make sure CM15A is on the same phase as the whateve you are trying to control
  2. CM15As PL circuit goes bad sometimes - I have had one go bad and another guy had the same issue

#180

Your last statement is exactly why I haven’t sprung for the CM15A, so far.

Take a look at
http://jvde.us/xtb/xtb_ordering.htm

I’ve conversed with Jeff Volp, the owner and builder of these XTB products about integrating with SmartThings. He’s easy to reach and I see him contributing on the X10 forums, yet without being pushy at all about his products.

Jeff told me he was very disappointed that the Authnix WM100 doesn’t support extended code, as he was expecting it would, making it the easiest path forward to integrating with newer devices.

Jeff has units that emulates the CM11A and TW523, and I plan to reach out to him about the possibility of designing a CM15A compatible interface.

Do you know if Mochad would possibly interface with the TW523 protocol? I would really like to go with this class of product if I’m gonna keep going forward.


(Enis Hoca) #181

Don’t know it’s pretty low level c code - I tried adapting it to work with CM11A at one point when I was trying to help someone get off heyu and gave up. It’s not a lot of code and compentent C bit twiddler could probably do it in a few days, but I haven’t programmed at that level since 1990
But getting that guy to emulate CM15A is probably a good idea - there are a lot and I mean a lot of implementations based on mochad - if he did that it would open up whole new markets for them.

On a side note where the heck are they advertising or engaging with customers or they just happy being on their small islands? I visit a sufficient number of home automation site and have gone through several system and communities, never heard of them or come across their products