X10 Community Forum

💬General Category => Mac/Linux & Open Source and the X10 Home => Raspberry Pi, Arduino & other SBC => Topic started by: petera on July 17, 2018, 08:14:51 AM

Title: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 17, 2018, 08:14:51 AM
Further to an earlier post I used the following links to successfully install Home Assistant on a Raspberry Pi and setup X10 using the CM11/CM12 controller. The instructions assume a basic knowledge of Linux and the ability to SSH into a Raspberry Pi from another computer. There's quite a lot of tutorials on installing Raspbian Stretch on an SD card available on the net if you need to look around.

This installation was carried out on a Raspberry Pi3

1. You will need a fresh copy of Raspbian Stretch Lite (not the desktop version) written to an SD card. Details to achieve this here https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0

2. Now that your Raspberry Pi setup and have SSH into it from another computer you will see the a prompt. Now its time to install Heyu on the Raspberry PI. Follow these instructions exactly as they are presented in this link. NOTE when you get to the section where it asks you who you want this to be available to select option 3 and NOT 1 as mentioned in the instructions https://blog.wouterspaans.nl/2017/02/23/control-your-x10-lights-from-a-raspberry-pi/

3. Now it's time to install Home Assistant. This is the manual install which is what you need here
https://www.home-assistant.io/docs/installation/raspberry-pi/

4. Now that you have Home Assistant up and running you need to configure it to run X10. The following link will demonstrate how to configure it by editing what is called the configuration.yaml
https://www.home-assistant.io/components/light.x10/

All I ask here is that we keep this on topic and where possible I will be only too glad to answer any questions you may have on the above. The installation should be fairly straightforward and take approximately two hours 
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 17, 2018, 08:43:52 AM
Thanks petera, I will give this a try as soon as I get my RPi.

Question. I noticed that Heyu supports the W800RF32A. Have you any idea if it will work with Home Assistant? I'm actually using the W800USB which is just a newer version that connects via usb instead of serial. I was hoping to use my W800USB for my palm pads and security sensors.

Second question. Heyu also supports the CM17A. If HA can use it then one could setup HA to arm the x10 security console.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 17, 2018, 11:31:42 AM
Thanks petera, I will give this a try as soon as I get my RPi.

Question. I noticed that Heyu supports the W800RF32A. Have you any idea if it will work with Home Assistant? I'm actually using the W800USB which is just a newer version that connects via usb instead of serial. I was hoping to use my W800USB for my palm pads and security sensors.

Second question. Heyu also supports the CM17A. If HA can use it then one could setup HA to arm the x10 security console.

I couldn't confirm that for you. All I can say is if it works in Heyu I imagine it will work with Home Assistant. I'm only using the CM11/CM12 unit because I've one lying about. I will get around to trying the Home Assistant Mochad module option on the CM15 at some stage. Someone else might like to experiment with that in the meantime.

As above. If it works with Heyu give it a try.

Good luck when you get started and if you do get stuck feel free to ask for help.

Don't forget if all you'll be plugging into the Pi is an x10 controller you could always use the Pi Zero W. That unit is worth playing with too. >!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 17, 2018, 01:56:26 PM
I couldn't confirm that for you. All I can say is if it works in Heyu I imagine it will work with Home Assistant. I'm only using the CM11/CM12 unit because I've one lying about. I will get around to trying the Home Assistant Mochad module option on the CM15 at some stage. Someone else might like to experiment with that in the meantime.

As above. If it works with Heyu give it a try.

Good luck when you get started and if you do get stuck feel free to ask for help.

Don't forget if all you'll be plugging into the Pi is an x10 controller you could always use the Pi Zero W. That unit is worth playing with too. >!

I just ordered my RPi 3 B+. No prime day specials but giving it a go. Time to get off the fence.

Anyhow, since I'm currently using my CM11a with my current setup, I'll use my spare CM15a I have with Mochad. I'll use your instructions but instead of installing HeyU I will use Mochad.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 17, 2018, 02:21:41 PM
I couldn't confirm that for you. All I can say is if it works in Heyu I imagine it will work with Home Assistant. I'm only using the CM11/CM12 unit because I've one lying about. I will get around to trying the Home Assistant Mochad module option on the CM15 at some stage. Someone else might like to experiment with that in the meantime.

As above. If it works with Heyu give it a try.

Good luck when you get started and if you do get stuck feel free to ask for help.

Don't forget if all you'll be plugging into the Pi is an x10 controller you could always use the Pi Zero W. That unit is worth playing with too. >!

I just ordered my RPi 3 B+. No prime day specials but giving it a go. Time to get off the fence.

Anyhow, since I'm currently using my CM11a with my current setup, I'll use my spare CM15a I have with Mochad. I'll use your instructions but instead of installing HeyU I will use Mochad.

As I said earlier I haven't tried the CM15/Mochad combination but let us know how you progress. Be careful what version of Mochad you use too. As you know you'll have to build it yourself so the later the version the better.

You'll need to set it up as a Systemd service too.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: bkenobi on July 18, 2018, 10:26:08 AM
I tested Mochad when I initially got my first RPi and it worked very well with the limited testing.  The question here is really how well it can be integrated into the HA setup.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: HA Dave on July 18, 2018, 01:16:31 PM
…. I just ordered my RPi 3 B+. No prime day specials but giving it a go. Time to get off the fence.


I thought the same when I  ordered my Pi 3. It didn't work out... maybe I was ahead of the curve by a few months. But if this works out for you guys.... I'll order a  RPi 3 B+ and follow.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 18, 2018, 08:33:58 PM
I tested Mochad when I initially got my first RPi and it worked very well with the limited testing.  The question here is really how well it can be integrated into the HA setup.

Heyu is working fine so I don't see Mochad being an issue as Home Assistant has its own platform for Mochad. Once you're comfortable in the Linux environment it shouldn't be a problem. You should give it a try as Home Assistant has extensive documentation to help you.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 18, 2018, 08:43:34 PM
…. I just ordered my RPi 3 B+. No prime day specials but giving it a go. Time to get off the fence.


I thought the same when I  ordered my Pi 3. It didn't work out... maybe I was ahead of the curve by a few months. But if this works out for you guys.... I'll order a  RPi 3 B+ and follow.

Best to hold back if you're not comfortable in the Linux environment and wait for a few others to try it. You'll probably need things as automated as possible. There's a bit of work to do before you get there. You use the Homeseer Hometroller so it's not unlike that environment.

My system now boots straight to Home Assistant and can be accessed from any web browser. What you could do is read up on Home Assistant and familiarise yourself with it in the meantime.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: HA Dave on July 18, 2018, 10:07:03 PM
Best to hold back.... and wait for a few others to try it...…. What you could do is read up on Home Assistant and familiarise yourself with it in the meantime.

Makes good sense.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: dhouston on July 19, 2018, 06:03:41 AM
Best to hold back.... and wait for a few others to try it...…. What you could do is read up on Home Assistant and familiarise yourself with it in the meantime.

Makes good sense.
In the meantime you might read this.https://www.home-assistant.io/blog/2018/07/16/release-73-2/ (https://www.home-assistant.io/blog/2018/07/16/release-73-2/)
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 19, 2018, 07:20:59 AM
…. I just ordered my RPi 3 B+. No prime day specials but giving it a go. Time to get off the fence.


I thought the same when I  ordered my Pi 3. It didn't work out... maybe I was ahead of the curve by a few months. But if this works out for you guys.... I'll order a  RPi 3 B+ and follow.

I'm by far no expert with linux but on the same note I'm comfortable with it. I do know my way around the basics so that will help. I admit I had a huge learning curve when I first touched a linux system. Heck, my first time installing a linux system I had no idea how to answer the hostname prompt. rofl
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: bkenobi on July 19, 2018, 09:55:56 AM
Can HA record data and display it in a table?  I'm envisioning a way to record a temperature sensor for example and see a chart and tabulated data.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 19, 2018, 03:22:01 PM
Can HA record data and display it in a table?  I'm envisioning a way to record a temperature sensor for example and see a chart and tabulated data.

I'm sure you can using compatible sensors. Just Google Home Assistant sensors to find ones compatible with it. Everything is recorded in the logbook so I'm sure you could extract the relevant information to formulate your chart.

I've been working on and off for the last week setting up and configuring Home Assistant and the more I dig in the more I'm adding to it. It's a lot easier to set up than some of the commercial alternatives too. Scripts and automation are its strengths.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 19, 2018, 03:26:35 PM
…. I just ordered my RPi 3 B+. No prime day specials but giving it a go. Time to get off the fence.


I thought the same when I  ordered my Pi 3. It didn't work out... maybe I was ahead of the curve by a few months. But if this works out for you guys.... I'll order a  RPi 3 B+ and follow.



I'm by far no expert with linux but on the same note I'm comfortable with it. I do know my way around the basics so that will help. I admit I had a huge learning curve when I first touched a linux system. Heck, my first time installing a linux system I had no idea how to answer the hostname prompt. rofl

Me too when I first tackled it. The Raspberry Pi has opened up Linux to many recently. It's practically all cut and paste now. Very little can go wrong now if you follow the instructions exactly as advised.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 23, 2018, 08:04:38 AM
Got my RPi 3b+ last Thursday. Brought it to work with me and got stretch lite and home assistant loaded. Also built and installed mochad v0.1.17. Couldn't test anything since I wasn't at home with the RPi.

Plugged the rpi in to my home network this weekend. Plugged in my spare cm15a. Mochad service started right up once it saw the device. Did a quick test and sent an rf signal to turn on a light and it worked. Sent a pl command to turn off the light and it worked. :)%

Now to get it setup in home assistant.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 23, 2018, 01:13:17 PM
That should be a good test. Haven't tried Mochad with HA, only Heyu. Let us know how you get on.

As I said earlier you'll probably need to setup Mochad as a Systemd service daemon to have it available when HA calls it.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 23, 2018, 02:39:04 PM
That should be a good test. Haven't tried Mochad with HA, only Heyu. Let us know how you get on.

As I said earlier you'll probably need to setup Mochad as a Systemd service daemon to have it available when HA calls it.

Version 0.1.17 has systemd builtin I assume because all I did was build it and make install it. I plugged in the cm15a and there it was, accepting commands and working. Rebooted the pi and it was still running.

I also have a few lights setup in HA and I can control them.
Mochad also allows me to see the security door sensors and remotes. But it looks like I'll have to figure out how to get mochad_dispatch working with an MQTT broker to pass those commands to HA. If I'm understanding things, I should be able to send my remote's commands to arm the system.

I'm still in a very huge learning curve here and feeling very overwhelmed right now. Just trying to slow down and pick my battles.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 23, 2018, 04:51:49 PM
That should be a good test. Haven't tried Mochad with HA, only Heyu. Let us know how you get on.

As I said earlier you'll probably need to setup Mochad as a Systemd service daemon to have it available when HA calls it.

Version 0.1.17 has systemd builtin I assume because all I did was build it and make install it. I plugged in the cm15a and there it was, accepting commands and working. Rebooted the pi and it was still running.

I also have a few lights setup in HA and I can control them.
Mochad also allows me to see the security door sensors and remotes. But it looks like I'll have to figure out how to get mochad_dispatch working with an MQTT broker to pass those commands to HA. If I'm understanding things, I should be able to send my remote's commands to arm the system.

I'm still in a very huge learning curve here and feeling very overwhelmed right now. Just trying to slow down and pick my battles.

Try not to over think things. Once you have Mochad up and running just edit the HA configuration.yaml file by adding this entry from this link https://www.home-assistant.io/components/mochad/

When you restart the HA service your lights should be ready to use as long as you have exposed them to HA.

Ps don't forget to add the Light and Switch components to your configuration.yaml file to expose them to HA as I mentioned above.

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 24, 2018, 07:01:13 AM
Yeah, I already have a few lights setup in HA and they work. I can also send RF commands from HA that goes out my cm15a and gets picked up on my current running system.

What I'm wanting to do now is figure out how to get the wireless signals from say a palmpad to turn on a light in HA. I believe the only way is to use mochad_dispatch with mqtt. Other than that, my x10 lights work fine in HA.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 24, 2018, 06:09:30 PM
Yeah, I already have a few lights setup in HA and they work. I can also send RF commands from HA that goes out my cm15a and gets picked up on my current running system.

What I'm wanting to do now is figure out how to get the wireless signals from say a palmpad to turn on a light in HA. I believe the only way is to use mochad_dispatch with mqtt. Other than that, my x10 lights work fine in HA.

That's great. So you're up and running with Home Assistant and X10 on the Raspberry Pi. I hope my install instructions worked for you so others can copy them. The rest as they say I will leave up to you  >!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 25, 2018, 06:35:19 AM
Yeah, I already have a few lights setup in HA and they work. I can also send RF commands from HA that goes out my cm15a and gets picked up on my current running system.

What I'm wanting to do now is figure out how to get the wireless signals from say a palmpad to turn on a light in HA. I believe the only way is to use mochad_dispatch with mqtt. Other than that, my x10 lights work fine in HA.

That's great. So you're up and running with Home Assistant and X10 on the Raspberry Pi. I hope my install instructions worked for you so others can copy them. The rest as they say I will leave up to you  >!

Yes, I followed your instructions as a guide. The only thing I changed was using mochad instead of heyu. Only problem I've noticed is no x10 remote support in HA using either method. I've gotten closer using mochad_dispatch with mochad. I had to use mosquitto instead of the embedded mqtt in HA. BUt I'll leave that for a different topic.

THanks for your help.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 25, 2018, 04:16:47 PM
Yeah, I already have a few lights setup in HA and they work. I can also send RF commands from HA that goes out my cm15a and gets picked up on my current running system.

What I'm wanting to do now is figure out how to get the wireless signals from say a palmpad to turn on a light in HA. I believe the only way is to use mochad_dispatch with mqtt. Other than that, my x10 lights work fine in HA.


I assume you adjusted the settings in your configuration.yaml to reflect what method of transmission you are using PL or RF as per the link here https://www.home-assistant.io/components/switch.mochad/


That's great. So you're up and running with Home Assistant and X10 on the Raspberry Pi. I hope my install instructions worked for you so others can copy them. The rest as they say I will leave up to you  >!

Yes, I followed your instructions as a guide. The only thing I changed was using mochad instead of heyu. Only problem I've noticed is no x10 remote support in HA using either method. I've gotten closer using mochad_dispatch with mochad. I had to use mosquitto instead of the embedded mqtt in HA. BUt I'll leave that for a different topic.

THanks for your help.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: lviper on July 26, 2018, 06:41:23 AM
Yeah, I already have a few lights setup in HA and they work. I can also send RF commands from HA that goes out my cm15a and gets picked up on my current running system.

What I'm wanting to do now is figure out how to get the wireless signals from say a palmpad to turn on a light in HA. I believe the only way is to use mochad_dispatch with mqtt. Other than that, my x10 lights work fine in HA.


I assume you adjusted the settings in your configuration.yaml to reflect what method of transmission you are using PL or RF as per the link here https://www.home-assistant.io/components/switch.mochad/


That's great. So you're up and running with Home Assistant and X10 on the Raspberry Pi. I hope my install instructions worked for you so others can copy them. The rest as they say I will leave up to you  >!

Yes, I followed your instructions as a guide. The only thing I changed was using mochad instead of heyu. Only problem I've noticed is no x10 remote support in HA using either method. I've gotten closer using mochad_dispatch with mochad. I had to use mosquitto instead of the embedded mqtt in HA. BUt I'll leave that for a different topic.

THanks for your help.

Yes, I have set the mochad component in my config.yaml to use either PL or RF. But that's for tranmitting, not receiving. I want to move all control over to HA.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 30, 2018, 02:52:48 PM
In your very first post on this thread your points 2,3,4 all have links to the same page , not to what was mentioned in the text of those points.

Do you happen to have those correct links to hand?

I have got to point 4, with Heyu working and HA installed and the webgui running. Now to 'join the two'  Discover devices does not do it...ahh ...mayb I need HA-bridge too...?
#

2. Now that your Raspberry Pi setup and have SSH into it from another computer you will see the a prompt. Now its time to install Heyu on the Raspberry PI. Follow these instructions exactly as they are presented in this link. NOTE when you get to the section where it asks you who you want this to be available to select option 3 and NOT 1 as mentioned in the instructions https://blog.wouterspaans.nl/2017/02/23/control-your-x10-lights-from-a-raspberry-pi/

3. Now it's time to install Home Assistant. This is the manual install which is what you need here https://blog.wouterspaans.nl/2017/02/23/control-your-x10-lights-from-a-raspberry-pi/

4. Now that you have Home Assistant up and running you need to configure it to run X10. The following link will demonstrate how to configure it by editing what is called the configuration.yaml file https://blog.wouterspaans.nl/2017/02/23/control-your-x10-lights-from-a-raspberry-pi/

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 30, 2018, 05:08:45 PM
Point 3 link should read https://www.home-assistant.io/docs/installation/raspberry-pi/

Point 4 link should read https://www.home-assistant.io/components/light.x10/

I've edited the original post to reflect this.

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 30, 2018, 05:35:20 PM
That is great, thanks
Ok
So I followed corrrect installation procedure

And then auto start using systemd and the Python Virtual Environment service entry.
https://www.home-assistant.io/docs/autostart/systemd/

But it does not Auto start

So tomorrow I’ll reformat the card and start again from the beginning.

Thanks for sorting the correct links

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 30, 2018, 06:24:29 PM
That is great, thanks
Ok
So I followed corrrect installation procedure

And then auto start using systemd and the Python Virtual Environment service entry.
https://www.home-assistant.io/docs/autostart/systemd/

But it does not Auto start

So tomorrow I’ll reformat the card and start again from the beginning.

Thanks for sorting the correct links

Setting up a Systemd service can be a bit tricky but not difficult. Make sure you have closed down the SSH session with HA running in it and open a fresh SSH session with the command prompt displayed

In the root directory type the following

sudo nano /etc/systemd/system/homeassistant.service

It opens the editor so paste this text exactly as I've supplied it


[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Once you have pasted this text press ctrl-x  then press y and press the return key.

Now at the command prompt type sudo systemctl enable homeassistant.service and press the return key

Now type sudo systemctl start homeassistant.assistant and press the return key.

If everything went well you should be able to access HA on the browser without your SSH session being opened.

Every time you restart the Raspberry Pi HA will start automatically.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 31, 2018, 06:57:20 AM
That is bizarre.  the instructions you pasted are the same as the ones I followed from the link I put in my previous post, but…..
when I do

sudo nano /etc/systemd/system/homeassistant.service

I come up with a blank file.. when I was expecting to see it with data in

saving and confirming  it has saved,  the running the systemctrl commands I get:

Code: [Select]
pi@raspberrypi:~ $ sudo systemctl enable homeassistant.service
Created symlink /etc/systemd/system/multi-user.target.wants/homeassistant.service → /etc/systemd/system/homeassistant.service.
pi@raspberrypi:~ $ sudo systemctl start homeassistant.assistant
Failed to start homeassistant.assistant.service: Unit homeassistant.assistant.service not found.
pi@raspberrypi:~ $



So am going to re format and start again for the 'n' th time



Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 31, 2018, 08:56:14 AM
That is bizarre.  the instructions you pasted are the same as the ones I followed from the link I put in my previous post, but…..
when I do

sudo nano /etc/systemd/system/homeassistant.service

I come up with a blank file.. when I was expecting to see it with data in

saving and confirming  it has saved,  the running the systemctrl commands I get:

Code: [Select]
pi@raspberrypi:~ $ sudo systemctl enable homeassistant.service
Created symlink /etc/systemd/system/multi-user.target.wants/homeassistant.service → /etc/systemd/system/homeassistant.service.
pi@raspberrypi:~ $ sudo systemctl start homeassistant.assistant
Failed to start homeassistant.assistant.service: Unit homeassistant.assistant.service not found.
pi@raspberrypi:~ $



So am going to re format and start again for the 'n' th time

Make sure you create this file in the root folder. The best way to ensure this happens is reboot your Pi, SSH into it and as soon as you see the prompt create the file.

When you exit from Home Assistant during the SSH session you are still in the virtual environment. You need to type exit and the return key to get back to the root folder.

I'm trying to avoid using technical terms here as I'm not sure what your level of Linux experience is. Once you have Home Assistant up and running from boot the only other thing you will have to think about is the configuration.yaml file to customise Home Asssistant.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 31, 2018, 09:27:19 AM

Make sure you create this file in the root folder. The best way to ensure this happens is reboot your Pi, SSH into it and as soon as you see the prompt create the file.


When you reboot and ssh back it drops you into the root of the home folder,  /home/pi/
and the cmd prompt is:

pi@raspberrypi:~ $


 or do I need to cd twice back up the structure to the root of the complete FS  /
indicated by a cmd prompt of:

pi@raspberrypi :/ $



When you exit from Home Assistant during the SSH session you are still in the virtual environment. You need to type exit and the return key to get back to the root folder.
Yep, ununderstood

I'm trying to avoid using technical terms here as I'm not sure what your level of Linux experience is. Once you have Home Assistant up and running from boot the only other thing you will have to think about is the configuration.yaml file to customise Home Asssistant.

well been using it on / off for years with NAS4Free/ FreeNAS distros and can do basic stuff like 'dmesg, mkdir/ rm/ cp ls cd etc but a lot of this apt-get stuff is new, always used the Synaptic package manager before.


I'll rebuild, add HA again and try and get it auto starting and see where we go from there.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 31, 2018, 09:33:42 AM

Make sure you create this file in the root folder. The best way to ensure this happens is reboot your Pi, SSH into it and as soon as you see the prompt create the file.


When you reboot and ssh back it drops you into the root of the home folder,  /home/pi/
and the cmd prompt is:

pi@raspberrypi:~ $


 or do I need to cd twice back up the structure to the root of the complete FS  /
indicated by a cmd prompt of:

pi@raspberrypi :/ $



When you exit from Home Assistant during the SSH session you are still in the virtual environment. You need to type exit and the return key to get back to the root folder.
Yep, ununderstood

I'm trying to avoid using technical terms here as I'm not sure what your level of Linux experience is. Once you have Home Assistant up and running from boot the only other thing you will have to think about is the configuration.yaml file to customise Home Asssistant.

well been using it on / off for years with NAS4Free/ FreeNAS distros and can do basic stuff like 'dmesg, mkdir/ rm/ cp ls cd etc but a lot of this apt-get stuff is new, always used the Synaptic package manager before.


I'll rebuild, add HA again and try and get it auto starting and see where we go from there.

Yes the /home/pi folder. The folder you are presented with on reboot. That's why you use the sudo command all the time in the Raspberry Pi. Unless you specifically need to sudo su into the Pi stay away from it.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 31, 2018, 06:47:29 PM

Make sure you create this file in the root folder. The best way to ensure this happens is reboot your Pi, SSH into it and as soon as you see the prompt create the file.

When you exit from Home Assistant during the SSH session you are still in the virtual environment. You need to type exit and the return key to get back to the root folder.


Saw HA running in a web page, all good

typed exit in the SSH and shut down the Pi and rebooted.
 as soon as restarted ssh back in and followed the instructions to create service file etc..

Code: [Select]
pi@raspberrypi:~ $ sudo nano /etc/systemd/system/homeassistant.service

pi@raspberrypi:~ $ sudo systemctl enable homeassistant.service
Created symlink /etc/systemd/system/multi-user.target.wants/homeassistant.service → /etc/systemd/system/homeassistant.service.
pi@raspberrypi:~ $  sudo systemctl start homeassistant.assistant
Failed to start homeassistant.assistant.service: Unit homeassistant.assistant.service not found.


Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 31, 2018, 07:39:04 PM
You create, enable and finally start the service.

My instructions from the earlier post.



Step 1 sudo nano /etc/systemd/system/homeassistant.service

It opens the editor so paste this text exactly as I've supplied it


[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Step 2 Once you have pasted this text press ctrl-x  then press y and press the return key.

Step 3 Now at the command prompt type sudo systemctl enable homeassistant.service and press the return key

Step 4 Now type sudo systemctl start homeassistant.service and press the return key.

If everything went well you should be able to access HA on the browser without your SSH session being opened.

Every time you restart the Raspberry Pi HA will start automatically.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 31, 2018, 07:55:38 PM
Remember you are working in the Python virtual environment. The instructions I supplied were for that install. That's why you have to type exit to get back to the /home/Pi folder.

I'm five hours ahead of you and it's been a long day.What I've given you now should get Home Assistant up and running on boot up.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 31, 2018, 07:57:47 PM

Step 4 Now type sudo systemctl start homeassistant.service and press the return key.

If everything went well you should be able to access HA on the browser without your SSH session being opened.

.

I am more than happy with how to use nano, copy and paste the text in and to save it, that is not the issue.
The issue is when getting to your Step 4.  I get the failure message as I posted in the CODE box on my previous post

Code: [Select]
pi@raspberrypi:~ $  sudo systemctl start homeassistant.assistant
Failed to start homeassistant.assistant.service: Unit homeassistant.assistant.service not found.

it is now 1 oclock in the morning here and I have been working on this on and off since about  this morning.  Been doing an SDR server that also starts the RTL_TCP service from system...that firers up fine …

anyway, will look again in the morning



Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on July 31, 2018, 08:01:22 PM
Remember you are working in the Python virtual environment. The instructions I supplied were for that install. That's why you have to type exit to get back to the /home/Pi folder.

Yep that is what I have used. 



I'm five hours ahead of you and it's been a long day.What I've given you now should get Home Assistant up and running on boot up..

your 5 hours ahead yikes,..so you've been up all night ..1 in the morngn here and I ahve had enough..not stamina liek you to go all through the night after starting at 8 this morning



shutting it all down for now

Thanks for the help



Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on July 31, 2018, 09:41:16 PM
Just to recap on the installation instructions and the creation of a homeassistant service. I'ts all in the one place now for others to follow.

Assuming Home Assistant is where it should be on the Raspberry Pi the instructions below for creating the service should work.

1. You will need a fresh copy of Raspbian Stretch Lite (not the desktop version) written to an SD card. Details to achieve this here https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0

2. Now that your Raspberry Pi setup and have SSH into it from another computer you will see the a prompt. Now its time to install Heyu on the Raspberry PI. Follow these instructions exactly as they are presented in this link. NOTE when you get to the section where it asks you who you want this to be available to select option 3 and NOT 1 as mentioned in the instructions https://blog.wouterspaans.nl/2017/02/23/control-your-x10-lights-from-a-raspberry-pi/

3. Now it's time to install Home Assistant. This is the manual install which is what you need here
https://www.home-assistant.io/docs/installation/raspberry-pi/

4. Now that you have Home Assistant up and running you need to configure it to run X10. The following link will demonstrate how to configure it by editing what is called the configuration.yaml
https://www.home-assistant.io/components/light.x10/


Creating the Home Assistant service as follows

Step 1 sudo nano /etc/systemd/system/homeassistant.service

It opens the editor so paste this text exactly as I've supplied it


[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Step 2 Once you have pasted this text press ctrl-x  then press y and press the return key.

Step 3 Now at the command prompt type sudo systemctl enable homeassistant.service and press the return key

Step 4 Now type sudo systemctl start homeassistant.service and press the return key.

If everything went well you should be able to access HA on the browser without your SSH session being opened.

Every time you restart the Raspberry Pi HA will start automatically.

If your homeassistant.service is not running type sudo systemctl status homeassistant.service and it will tell you what the status of the service is.

I strongly advise you start with a fresh install as you appear to have a rogue service running that has been enabled at some stage.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 02:07:43 AM
OK, well 5 hours sleep and I am back at it. 
Despite the

Code: [Select]
pi@raspberrypi:~ $  sudo systemctl start homeassistant.assistant
Failed to start homeassistant.assistant.service: Unit homeassistant.assistant.service not found.

after a re-boot the HA WebGUI DOES start.

Would the error above be caused by the fact that the command
sudo systemctl start homeassistant.assistant
is not being issued from within the Virtual Environment

Why is a VE being used?  cant it run in the 'standard environment'  and save all this comlication of the Python VE?

My last install was from a totally fresh Stretch Lite install to a freshly formatted SD card, with clones taken at every stage..after intial boot and SSH enable, after samba enable, after update/upgrade, after heyu install, etc


Either way it is working now thanks to your guide.  have added x10 test devices to configuration.yaml  and yes it does turn them on via the Home page.  But not off,  the little slider  after 1 second slides back to 'off'  but the device stays on.  But that for another thread.

Thanks for your help and patience in this..


Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 05:13:49 AM
The slider is a simple one. Open another SSH terminal and type heyu engine. That should sort that problem.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 05:23:57 AM
The command to start the service is

sudo systemctl start homeassistant.service

You are typing in the wrong command. Just cut and paste that command.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 05:37:23 AM
The slider is a simple one. Open another SSH terminal and type heyu engine. That should sort that problem.

I guess run it as a service too..

https://cylkedowney.wordpress.com/2017/05/19/starting-heyu-using-systemd/
The command to start the service is

sudo systemctl start homeassistant.service

You are typing in the wrong command. Just cut and paste that command.
B:( oh god ! that is embarrassing...and using the SSH reply last entry.   ooops .very embarrassed   :-[
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 05:43:48 AM
The slider is a simple one. Open another SSH terminal and type heyu engine. That should sort that problem.

I guess run it as a service too..

https://cylkedowney.wordpress.com/2017/05/19/starting-heyu-using-systemd/
The command to start the service is

sudo systemctl start homeassistant.service

You are typing in the wrong command. Just cut and paste that command.
B:( oh god ! that is embarrassing...and using the SSH reply last entry.   ooops .very embarrassed   :-[

Yes you need Heyu running as a service too so you need to create one. Once you have created the Heyu service you need to add an extra line into the Home Assistant service to instruct it to wait loading until the Heyu service has loaded first.

Have you got the slider buttons turning yellow when you switc them on now.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 06:04:06 AM
Quote
Have you got the slider buttons turning yellow when you switc them on now.
Yes slider buttons sticking and staying on and can turn on and off  , sliders are blue and little light bulbs go yellow, but other wise yes.

I did the heyu service engine start

I put the following in /etc/systemd/system/heyu.service
Code: [Select]
[Unit]
Description=Heyu Engine
Wants=network.target
After=network.target
 
[Service]
Type=oneshot
RemainAfterExit=yes
User=pi
Group=pi
WorkingDirectory=/home/pi
ExecStart=/usr/local/bin/heyu start
ExecReload=/usr/local/bin/heyu restart
ExecStop=/usr/local/bin/heyu stop
 
[Install]
WantedBy=multi-user.target

Then
Code: [Select]
sudo systemctl enable heyu.service
sudo systemctl start heyu.service


From this link:
https://cylkedowney.wordpress.com/2017/05/19/starting-heyu-using-systemd/



I'll have a look at what you suggest and see if I can see how to do that
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 06:21:38 AM
Here's a heyu.service file based on the install instructions I supplied.

[Unit]
Description=Heyu Engine
Wants=network.target
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/pi/heyu-2.10
ExecStart=/usr/local/bin/heyu engine

[Install]
WantedBy=multi-user.target

This is the modified homeassistant.service file with the extra line added to allow heyu start before home assistant

[Unit]
Description=Home Assistant
After=network-online.target

[Service]
ExecStartPre=/bin/sleep 20
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Don't forget to stop your service file before you edit them.

These two files will get heyu running first and then launch Home Assistant all at boot time

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 07:20:59 AM
All good
 I had used the latest heyu v2.11-rc3 and it was in ~/src/heyu-2.11-rc3 so modified to suit, so all good.

All now working.

Time to dc3dd an image and pishrink it so I can tinker with HA configuration.yaml and see what it does.


Can it (HA ) upload stuff to the CM11 ? or is it merely a controller?

Wont be able to actually test it for real at my home yet.   I am at my fathers home, on a spare bed in the dining room, doing this flat on my back with lots of metal work in a broken leg after motorcycle accident in Czech Republic just under a month ago.  But I got my 'spares box, brought here and have rigged a temp network in my room here on the big old dining table, with a spare RPi and spare X10 stuff.  When I can make the stairs and can get home, I'll have the Pi setup and ready to go
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 08:14:27 AM
All good
 I had used the latest heyu v2.11-rc3 and it was in ~/src/heyu-2.11-rc3 so modified to suit, so all good.

All now working.

Time to dc3dd an image and pishrink it so I can tinker with HA configuration.yaml and see what it does.


Can it (HA ) upload stuff to the CM11 ? or is it merely a controller?

Wont be able to actually test it for real at my home yet.   I am at my fathers home, on a spare bed in the dining room, doing this flat on my back with lots of metal work in a broken leg after motorcycle accident in Czech Republic just under a month ago.  But I got my 'spares box, brought here and have rigged a temp network in my room here on the big old dining table, with a spare RPi and spare X10 stuff.  When I can make the stairs and can get home, I'll have the Pi setup and ready to go

No all your timers and macros will be controlled from HA and not downloaded to your x10 controller. In fact make sure you clear out any timers and macros currently stored there so it doesn't conflict with HA. You can do that operation with Heyu.

If you want a tidy unit to work with I suggest buying the Raspberry Pi Zero W. You'll have wifi, Bluetooth and the x10 controller all in one neat bundle size wise. Once you get stuck into HA you'll see the power of HA that can be easily achieved.

Hopefully this post will help others to get started with HA. We were a while getting there but you've learnt a bit. The Systemd service is so like the MS Dos batch file and can control so much so easily.

Enjoy. Need to get back to the day job.  >!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 10:02:49 AM

No all your timers and macros will be controlled from HA and not downloaded to your x10 controller. In fact make sure you clear out any timers and macros currently stored there so it doesn't conflict with HA. You can do that operation with Heyu.

Damn, that is a shame... maybe I'll give HG a try too. Tuiceman seems to think I can do that uploading from it.


HG will do everything you want, and from the looks of things much easier to setup then HA.
HG has a Bridge addon but I use HA-Bridge with it


This whole saga started because I wanted to upload a macro with a delay to reboot the router with a simple delay command from within a heyu macro. Was trying to avoid another 'layer' IE the Pi, and just do all the control timers etc from within the CM11 memory.Only started down the HA/ HG route to upload macros to the CM11.  The Pi3 though is small enough, dont see the need to go for a Pi Zero.

ANy way I'll play about with HA for a bit..got 6 months off work with this broken leg so plenty of time to test stuff out.

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: Tuicemen on August 01, 2018, 10:17:16 AM

Damn, that is a shame... maybe I'll give HG a try too. Tuiceman seems to think I can do that uploading from it.


HG will do everything you want, and from the looks of things much easier to setup then HA.
HG has a Bridge addon but I use HA-Bridge with it
No you miss under stood me Or I misunderstood you. I don't believe you can upload anything to the CM11 with HG
You can create the macros your looking to do very easily though.
 My reply about doing what you want was in response to this post:
I'm sure I can get you running HG on your Pi in less then 20 mins. Obiously creating a whole HA setup would take much longer depending on devices, timers, macros. But setup for simple turning on/off x10 devices is very simple point and click.

is it just as easy to get HG to allow Alexa to control the x10 lights with HG? or HA

At the moment i have Heyu and HA-Bridge Philips Hu emulator and Alexa, so I can jsut say Alexa turn on X or Y and it works.

Reading this morngin about doing it with HA, seems taht youhave to have Apache Server, create 'Alexa Intents' some subscription cloudn account and all sorts of stuff....way to much.

ONly reason I wondered about HA or HG or mochad was to see if I could use a CM15.

At present, as of last night I have  my system running with a CM11 and all works OK, apart from how to set a macro with a delay inthe middle
My response was more to your wondering about the CM15 as I don't own a cm11
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 10:34:59 AM
From my past experiences the only program that could successfully upload macros and timers to the CM11/CM12 was Active Home Pro. Clearly you weren’t after a full blown home automation system if you only wanted to reboot your router.

A simple cron job on the Raspberry Pi could handle that.

Anyway the instructions on how to install HA using the CM11/CM12 controller are all here and proven to work. The CM15 will work too with a few mods. The CM17 will work too.

You now have another platform to work with X10 and that’s me done for the moment >!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 11:16:40 AM
No you miss under stood me Or I misunderstood you. I don't believe you can upload anything to the CM11 with HG


Phew..just in time, was just about to start trying to get HG installed
Probably my fault, I explained a lot in my first Hello post, and then each subsequent post sort of ended up getting mixed up as to what was what..


You can create the macros your looking to do very easily though.
I was more after having the macro within the CM11 though, rather than running on another device ( the Pi)

Only have small one bedroom apartment and full home control for 7 or 8 lights plus TV etc, router NAS and no heating to control etc would be a bit much.  Main aim was to reboot router and the PtMP network bridge AP devices (that are in the attic) in two ways, schedule and manual firing of reboot cycle Currently I can turn off router remotely (TIP10RF) but cant then turn it back on because the router is down.  The Trigger Macro and script options of the CM11 are ideal without needing the Pi.


From my past experiences the only program that could successfully upload macros and timers to the CM11/CM12 was Active Home Pro.

Heyu and its x10conf and x10,sched files and the heyu upload command do a damn good job, except for the fact you cannot add a delay within the middle of a macro :(.

Clearly you weren't after a full blown home automation system if you only wanted to reboot your router. 


A simple cron job on the Raspberry Pi could handle that.
and since I already do have one Pi setup to do the Alexa-HA Bridge-Heyu-X10 control., yes that may be the way to go , but really was hoping to avoid having the router reboot option on the Pi..wanting to get it as far'downstream ' as possible.  and the router does not have a reboot option in its GUI
 

You now have another platform to work with X10 and that’s me done for the moment >!
And that is a good thing, something to keep me occupied while the broken leg sorts itself and before the motorbike gets hauled back from Prague  >!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: Tuicemen on August 01, 2018, 11:43:25 AM
If you really wish to have a macro on your CM11 that has a delay in it there may be a work around depending on the delay you require. I'm not familiar with Hey U or the CM11 but if it is just a small delay you need you may try adding commands to none existent X10 modules between the Off - On commands to the router. You'd have to experiment with the amount of extra steps required to get your required delay and to see if it is possible that way.

Other wise I believe your going to have to use Windows and either  ActiveHome or ActiveHome Pro to upload the macro to the CM11.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 12:18:37 PM
Yes, that is how it is at the moment, but it is a horrible ‘ugly solution, a string of non-existent device .  Think I have posted that some where on here before.

But since I have all this time on my hands and am confined to barracks  with leg up until the bones mend,I thought I’d try and find a correct way to do it.

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 12:29:53 PM
If you have the TIP10RF it can be all done from there. Ethernet connection directly into your router. Just a little tip for future reference. Along with your problem also mention what equipment you have at your disposal. Helps users here to provide simpler solutions.

Reminds me of the guy who tried on ten rain jackets in the shop then bought an umbrella  :)%
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: Tuicemen on August 01, 2018, 12:44:01 PM
Why not just upload two timers to the Cm11? One for On and one for Off ;)
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 02:42:47 PM
Brace yourself.... ;)

Just a little tip for future reference. Along with your problem also mention what equipment you have at your disposal. Helps users here to provide simpler solutions.

Since you asked, I'll give a run down,  but it gets too unwieldy and complicated mentioning all the irrelevant stuff when I know exactly what I need a solution to, and not looking for other ways to do it.  I have other ways already but they are 'messy ways.

I wanted to see if there was with  Heyu or other app to create a macro with a delay in the middle and not at the beginning.



If you have the TIP10RF it can be all done from there. Ethernet connection directly into your router.

Reminds me of the guy who tried on ten rain jackets in the shop then bought an umbrella  :)%

I understand what you are saying, and why, but no, it would only complicate matters if I had mentioned the 10 Sonos speakers in 4 different locations, Ubiquiti/Deliberant APC5 point to multi point bridge system, connecting to the 4 different 'sites ' on the farm to the flat (camp/bbq area , stables/ workshop) greatest distance 3/4 of a mile, closest about 300 meters, the 4 Netgear switches switches and WiFi AP's, CTV system, etc  None of which have any bearing on the problem in hand.


The TIP10RF, I connect to via my phone app, over the mobile data, via no-ip.com DDNS to my home router, which is directly connected to the TIP10RF.  So yes, I can turn off the router via the TIP10RF..but then with the router down cannot send the next command to turn it back on.  The Trigger function in conjunction with a macro directly in the CM11, can then be used to handle the router reboot.

The router is on b6, and a delay caused by a string of false devices (f8) is just a horrid kludge of a way to do it.  The macro ends up as

macro cycle_router 0 off b6; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; on b6

I had asked the question on here, this thread (http://forums.x10.com/index.php?topic=30415.msg174642#msg174642), but had no replies and the quest to find an answer spread to this thread, and as with all these things, we all get led down 'diversions' ..like trying to install HA in the misguided hope that HA will allow programming of a 'action/delay' action string.   Heyu only seems to allow to upload a macro consisting of 'Name/delay/action; action;action etc'




There are two reboot options going on here,
 1) a scheduled one (as Tuicemen mentioned) Timer on the CM11 off, then minimum 1 minute later Timer on
2)the occasional need to reboot the bridge components, and ideally the router too, when doing work at the farm , on the CCTV etc etc , if the Sonos is playing a bit 'choppy'

Can do it via one single command from the iPhone TIP10RF app, send one single command (h1), received via the TIP10RF sent as RF to the RF receiver, converted to a power line signal, received by the CM11, which has h1 set as a TRIGGER to run the horrid macro above with all the fake devices
TRIGGER h1 on cycle_router


heyu can upload

macro | name | delay | action(s)

but it cannot from what I can see upload

macro | name | action(s) | delay | action(s)


I seem to remember he Windows program AHP being able to insert a delay within a macro, so the CM11 is capable of storing  them, it just seems that heyu cannot upload them.   I was trying to find a *nix command line / style way or basic app to upload the macro as I wanted it. 



Was a seemingly simple question that I did not think warranted a full explanation of my complete system and all it components.

Now maybe you see why I did not post everything ..just asked the basic question....

There are lots of other ways < I was looking for a solution to one specific part
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on August 01, 2018, 03:36:33 PM
Brace yourself.... ;)

Just a little tip for future reference. Along with your problem also mention what equipment you have at your disposal. Helps users here to provide simpler solutions.

Since you asked, I'll give a run down,  but it gets too unwieldy and complicated mentioning all the irrelevant stuff when I know exactly what I need a solution to, and not looking for other ways to do it.  I have other ways already but they are 'messy ways.

I wanted to see if there was with  Heyu or other app to create a macro with a delay in the middle and not at the beginning.



If you have the TIP10RF it can be all done from there. Ethernet connection directly into your router.

Reminds me of the guy who tried on ten rain jackets in the shop then bought an umbrella  :)%

I understand what you are saying, and why, but no, it would only complicate matters if I had mentioned the 10 Sonos speakers in 4 different locations, Ubiquiti/Deliberant APC5 point to multi point bridge system, connecting to the 4 different 'sites ' on the farm to the flat (camp/bbq area , stables/ workshop) greatest distance 3/4 of a mile, closest about 300 meters, the 4 Netgear switches switches and WiFi AP's, CTV system, etc  None of which have any bearing on the problem in hand.


The TIP10RF, I connect to via my phone app, over the mobile data, via no-ip.com DDNS to my home router, which is directly connected to the TIP10RF.  So yes, I can turn off the router via the TIP10RF..but then with the router down cannot send the next command to turn it back on.  The Trigger function in conjunction with a macro directly in the CM11, can then be used to handle the router reboot.

The router is on b6, and a delay caused by a string of false devices (f8) is just a horrid kludge of a way to do it.  The macro ends up as

macro cycle_router 0 off b6; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; off f8; on f8; on b6

I had asked the question on here, this thread (http://forums.x10.com/index.php?topic=30415.msg174642#msg174642), but had no replies and the quest to find an answer spread to this thread, and as with all these things, we all get led down 'diversions' ..like trying to install HA in the misguided hope that HA will allow programming of a 'action/delay' action string.   Heyu only seems to allow to upload a macro consisting of 'Name/delay/action; action;action etc'




There are two reboot options going on here,
 1) a scheduled one (as Tuicemen mentioned) Timer on the CM11 off, then minimum 1 minute later Timer on
2)the occasional need to reboot the bridge components, and ideally the router too, when doing work at the farm , on the CCTV etc etc , if the Sonos is playing a bit 'choppy'

Can do it via one single command from the iPhone TIP10RF app, send one single command (h1), received via the TIP10RF sent as RF to the RF receiver, converted to a power line signal, received by the CM11, which has h1 set as a TRIGGER to run the horrid macro above with all the fake devices
TRIGGER h1 on cycle_router


heyu can upload

macro | name | delay | action(s)

but it cannot from what I can see upload

macro | name | action(s) | delay | action(s)


I seem to remember he Windows program AHP being able to insert a delay within a macro, so the CM11 is capable of storing  them, it just seems that heyu cannot upload them.   I was trying to find a *nix command line / style way or basic app to upload the macro as I wanted it. 



Was a seemingly simple question that I did not think warranted a full explanation of my complete system and all it components.

Now maybe you see why I did not post everything ..just asked the basic question....

There are lots of other ways < I was looking for a solution to one specific part

I'll leave that one with you. That's definitely for another day  >*<

I just want to tidy up this post and keep it on topic for Home Assistant installation. You got there in the end even if it wasn't quite what you were looking for. We know the install instructions so they can act as a guide for others.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on August 01, 2018, 04:00:39 PM
please delete all the irrelevant bit of my posts...like most of it !! ;D   ...or I can go back and do it? keep your thread on track
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: bkenobi on March 22, 2019, 10:34:02 AM
This is an old thread, but probably the most relevant one.  I just wanted to post on my experience thus far with HA.  Instead of using a bare Raspbian image and installing HA or installing Hass.IO, I opted to try using the Hassbian image.  This image is basically Raspbian with HA preinstalled plus some useful utilities that are HA specific.  I believe it will give the best of both worlds (easy setup of Hass.IO and flexibility/configuration of manually installed HA).

Since it does not have the capability like Hass.IO to just click a button and install components, you still have to do that through the shell.  That's unavoidable if you want X10 since there is no component within Hass.IO for HeyU or Mochad that I could locate.  I did have an issue getting up and running with X10 since HA didn't automatically install the Mochad interface component the tutorial suggested would happen.  But, once I installed it (sudo pip3 install pymochad), the modules popped up and functioned as expected in HA.  It's easy to see what's going on with X10 since you can simply watch from the shell (nc localhost 1099).  If it pops up there, it was received.  If not, it wasn't.  Simple!

My next step will be getting Mochad_dispatch configured or testing the following command:
Code: [Select]
/bin/nc -d localhost 1099 | /usr/bin/awk -W interactive ' /HouseUnit:/ && /Func:/ { system("mosquitto_pub -q 1 -t /X10/"$6" -m "$8) } ' &

Mochad sees all X10 traffic but HA doesn't see RF by default.  From reading, I believe this is because X10 sends RF in one command vs 2 for PLC.  I don't see why this couldn't be addressed by forking Mochad in such a way that HA could see both, but I haven't looked that far yet and, since there appear to be other solutions, I likely won't.

In any case, outside of the one niggle with PyMochad not installing, HA seems like a great system.  Lots of useful comments on their forum and all of it current and active.  Reminds me of the old HG forum before it was transferred to Google+ and basically killed off.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on March 22, 2019, 10:48:46 AM
No problem with reviving old threads...I never understand why people get excited by people doing that.  Ig it is still relevant info to the topic..whty create a new thread.

Thanks for th at..

not heard of mochad before ..or the HA image you mention

I only have basic X-10 devices...will Mochad be of any use to me?  not even googled it yet.


OK...Found this

https://www.home-assistant.io/components/mochad/

but still...no idea what mochas actually does...why would I need it ?

I control my stuff either with a standard x-10 remote or by using Alexa...

what extra, functionality will Mochad bring ?
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: Tuicemen on March 22, 2019, 10:51:58 AM
mochad allows Home Assistant to use the cm15
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on March 22, 2019, 11:01:37 AM
Ah ok

Think I might have one, but the CM-11 works fine as is..so maybe an extra layer I don't need.

Thanks
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: dhouston on March 22, 2019, 11:02:15 AM
...I believe this is because X10 sends RF in one command vs 2 for PLC.
Actually, most X10 RF devices (e.g. Palmpads, Keychain Remotes) send 5-6 copies minimum of the RF code. AFAIK, the SH624 is the only remote that sends single copies. Each copy is about 65-70mS duration followed by 40mS silence. See...
https://www.laser.com/dhouston/rf.html (https://www.laser.com/dhouston/rf.html)
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: bkenobi on March 22, 2019, 11:06:08 AM
Correct.  Mochad and HeyU are similar in that they allow you to interface X10 controllers to your Linux system.  Mochad works with CM15A in addition to the controllers HeyU is also compatible with (CM11A etc).  If HeyU worked with CM15A, it would be a better choice since it has more capabilities/features.  Both communicate with your X10 controller and interpret the PLC/RF commands.  Mochad broadcasts the received commands to port 1099.  HA can use a component to listen to that port and interpret the commands to work with modules in the system (Domoticz and a few others do the same).  The issue with Mochad is that it doesn't send RF signals to HA even though they are received.  So, a workaround of some kind is needed.  Fortunately, there are some already provided by users so it's just a matter of deciding which approach to take and giving it a try.


dhouston: yes that is certainly true.  I don't know if that's the issue, but it could also be related!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on March 22, 2019, 11:08:28 AM
bad link
 :(
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: dhouston on March 22, 2019, 11:24:20 AM
I have no idea what causes the bad links but it has popped up a few times for various links on my (long retired and no longer maintained) web page. Most people found it was OK with a different browser. Today, it works fine for me under Windows 10 with Firefox, Chrome and Edge. I don't have a Mac running so can't test with it.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: npaisnel on March 22, 2019, 12:26:27 PM
Technology eh!

Works with Chrome

:)

Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on March 22, 2019, 01:37:29 PM
This is an old thread, but probably the most relevant one.  I just wanted to post on my experience thus far with HA.  Instead of using a bare Raspbian image and installing HA or installing Hass.IO, I opted to try using the Hassbian image.  This image is basically Raspbian with HA preinstalled plus some useful utilities that are HA specific.  I believe it will give the best of both worlds (easy setup of Hass.IO and flexibility/configuration of manually installed HA).

Since it does not have the capability like Hass.IO to just click a button and install components, you still have to do that through the shell.  That's unavoidable if you want X10 since there is no component within Hass.IO for HeyU or Mochad that I could locate.  I did have an issue getting up and running with X10 since HA didn't automatically install the Mochad interface component the tutorial suggested would happen.  But, once I installed it (sudo pip3 install pymochad), the modules popped up and functioned as expected in HA.  It's easy to see what's going on with X10 since you can simply watch from the shell (nc localhost 1099).  If it pops up there, it was received.  If not, it wasn't.  Simple!

My next step will be getting Mochad_dispatch configured or testing the following command:
Code: [Select]
/bin/nc -d localhost 1099 | /usr/bin/awk -W interactive ' /HouseUnit:/ && /Func:/ { system("mosquitto_pub -q 1 -t /X10/"$6" -m "$8) } ' &

Mochad sees all X10 traffic but HA doesn't see RF by default.  From reading, I believe this is because X10 sends RF in one command vs 2 for PLC.  I don't see why this couldn't be addressed by forking Mochad in such a way that HA could see both, but I haven't looked that far yet and, since there appear to be other solutions, I likely won't.

In any case, outside of the one niggle with PyMochad not installing, HA seems like a great system.  Lots of useful comments on their forum and all of it current and active.  Reminds me of the old HG forum before it was transferred to Google+ and basically killed off.

Glad to report no niggles here. Completed migration of home automation to Home Assistant quite recently and glad to say that everything migrated over perfectly. From X10, Motion detection cameras, heating systems, high end security system to integrated media systems all speaking to each other and all controlled through one single front end.

I’ve finally parked up anything that has gone before. No need for it now. You’ve all the automation scripts you’ll ever need with a few key taps

The biggest benefit of all is the healthy developer and user community. No waiting around for plugins to be developed either. They’ve all been done. Endless plugins to choose from. You don’t like one you pick another. And all free to use of course. It’s a massive open source project and one I’m glad to be part of.

For anyone looking to future home automation needs I couldn’t recommend Home Assistant highly enough. There’s even a few members from this forum over on the Home Assistant community sharing their setups and experiences.

The commercial guys are definitely looking over their shoulders and the niche project developers are parking up their efforts and joint venture in. If you’re serious about home automation why not wander over and join in. Glad to see you their bkenobi. They could definitely do with your skills.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: bkenobi on March 22, 2019, 03:13:33 PM
I wrote a number of scripts for HG to do some fairly basic things.  From the looks of it, that won't be necessary for much of my setup as the HA community is much, MUCH larger and more active.  I just found a APCUPSD component that will get all the data out of the daemon and expose it to HA.  All that has to be done is a simple check to decide if the system should be shut down and what to do for notifications.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: petera on March 22, 2019, 04:16:39 PM
I wrote a number of scripts for HG to do some fairly basic things.  From the looks of it, that won't be necessary for much of my setup as the HA community is much, MUCH larger and more active.  I just found a APCUPSD component that will get all the data out of the daemon and expose it to HA.  All that has to be done is a simple check to decide if the system should be shut down and what to do for notifications.

Everything I’ve thrown at it it’s handled. It’s addictive asking the question what will I do next. My configuration.yaml is bulging at the seems with goodies. I’ve even surrendered to the Alexa bug and was it so easy to setup. All done off the cloud of course.

I did a big setup with HADashboard that works with all the tablet devices. I’m now working away with the Lovelace UI. Where am I going to get the time for this rofl

Anyway as I said it’s all hands at the pumps over at the Home Assistant community. We worked out that there’s a posting on average every 10 seconds during peak traffic and never a post goes unanswered. It’s definitely the place to be for the home automation nut  :)%

See you over there  Bkenobi  >!
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: brobin on March 22, 2019, 04:28:27 PM
Technology eh!

Works with Chrome

:)
I've found that opening in an incognito window solves whatever the problem is.
Title: Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
Post by: bkenobi on March 22, 2019, 05:15:29 PM
I generally don't like having data on the cloud since i can't make sure it stays put, but today I found that there was a Bloomsky component that was so easy to install that I went ahead and added my OG Bloomsky to HA.  The only thing that I don't like is that it uses the fixed picture rather than the time lapse for the "camera" component.  Maybe that can be changed somehow.  I also found (when looking for my api key) that the time lapse data goes back ~3 months.  I was hoping my station would have recorded the snow fall and melt off at ground level (~2' fell and it took weeks to fully disappear).  Unfortunately, since mine is ground mounted and the solar panel covered, I got 1 month of nothing while it defrosted.   ;D