Please login or register.

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

Author Topic: Install X10 on Home Assistant on Raspberry Pi-Instructions  (Read 33388 times)

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #15 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.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #16 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.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #17 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.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #18 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.

« Last Edit: July 23, 2018, 04:55:55 PM by petera »
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #19 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.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #20 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  >!
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #21 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.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #22 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.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #23 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.
Logged

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #24 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/

Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #25 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.

« Last Edit: July 30, 2018, 05:14:03 PM by petera »
Logged

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #26 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

Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #27 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.
« Last Edit: July 30, 2018, 08:05:17 PM by petera »
Logged

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #28 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



Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Install X10 on Home Assistant on Raspberry Pi-Instructions
« Reply #29 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.
Logged
Pages: 1 [2] 3 4 5
 

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