Please login or register.

Login with username, password and session length

Author Topic: Quick hello  (Read 6278 times)

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Quick hello
« on: July 16, 2018, 02:59:46 AM »

Hi all, just a little intro who I am, and what I am doing,
Just discovered this board after using X-10 since about 2008.

Only for basic lights and appliance on/off / dim duties, no cameras, sensors etc.
Power line sender is a Marmitek X10 Transceiver Module All House Version TM13EFL
Control via iPhone with TIP0RF


Had been doing some reading around on a problem I was trying to solve and I read  this post from 2010 and the line.
Quote
Hello,

I recently dusted off my old CM11 (Actually a CM12

Old CM11.  That really made me feel late to the party as I only just bought mine, and it was considered old 8 years ago !!  Damn ;)



Anyway I have the UK version CM12 with USB INTERFACE, directly into a Raspberry Pi, HA Bridge and Alexa control

The 'problem ' I was looking to solve was how to shutdown and reboot my home router remotly.   I can shut down/ reboot using any of the standard RF controllers, or shut down only using the iPhone and TIP10RF.   Trouble now then is I can't restart it, via iPhone as the router and therefore wifi and home network is down.



 yes, i admit... not searched yet, and yep, i do see the Raspberry Pi forum.

Just wondering how to tackle this... scheduled reboot every 24 hrs would do it...either getting the Pi HA bridge to issue the (off-delay-on) command or program the CM12 to do it.   

If there was a way i could initiate this remotely while away from home via iPhone even better.

I will do some more searching/reading now on the forum, but wanted to get a quick Hello message out there first.

In Hospital at moment with broken leg after motorcycle accident, so plenty of research time !

Many thanks

Neil
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Quick hello
« Reply #1 on: July 16, 2018, 06:05:04 AM »

This feature is built into the Raspberry Pi Broadcom chip. Simple to activate. Read this link to set it up https://www.raspberrypi.org/forums/viewtopic.php?t=147501
« Last Edit: July 16, 2018, 06:12:51 AM by petera »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Quick hello
« Reply #2 on: July 16, 2018, 10:30:21 AM »

Using the Cm11, shutting down your router remotely is simple.
Doing a restart would require a software which had timer, scenes or macro capabilities.
Several if not all HA software has at least one of these functions.
With a timer you'd set the time of day to shut down  (send the X10 Off signal) then create another timer to start the router(send the X10 On signal).
Scenes or macros would allow you to do a reboot remotely and at any time of day.
Clicking a button would send the required x10 Off signal then pause (duration you specify) then send the X10 on signal.
since the.
I use currently use HomeGenie software on my Pi.
With it you could create a macro so when the x10 module on your router was detected as off it would turn back on. Using your phone and the TIP0RF you could send the off signal which HomeGenie and the cm11 would see.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Quick hello
« Reply #3 on: July 16, 2018, 11:17:10 AM »

You could of course use a cron job and let it look after the Raspberry Pi reboot in the background without too much fuss http://www.simsalabim-solutions.net/vademecum/raspberry_pi/setting_up_reboot_cron_job_on_pi

A lot of Linux users require a remote reboot of their systems for various reasons so keeping it as simple as possible helps avoid creating an unstable system.

There's so many options in Linux to do this but this link keeps setup to a minimum. Many like to reboot their systems regularly to avoid the dreaded crash and the disorderly shutdown. The one above that will keep your system running forever because as soon as it detects a halt in your system it will immediately reboot it.

You'll probably find many alternatives with a Google. Try a few and use what suits you best.
Logged

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Quick hello
« Reply #4 on: July 16, 2018, 10:09:03 PM »

Ok, great, thank you for the links.  Will be reading them soon.

I had not considered re booting of the Raspberry Pi before, but thanks for the thought and links to that too.

As I said it was initially only the re boot of my router that I was interested in.


Now I have some name/links ideas to go on, I shall crack on with that as and when the pain allows.  I am now released from hospital, and am at home again, though unable to sleep with pain, the Hospital do not issue the morphine based painkillers to take home, and the Codine... aasarrrggghhh just not enough.

Many thanks

Neil P
Logged

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Quick hello
« Reply #5 on: July 24, 2018, 06:18:43 AM »

I use currently use HomeGenie software on my Pi.
With it you could create a macro so when the x10 module on your router was detected as off it would turn back on. Using your phone and the TIP0RF you could send the off signal which HomeGenie and the cm11 would see.

Well I have downloaded HomeGenie, but as yet cant work out how the hell to use it...but a bit of reading will probably help for that...but the bit you said

Quote
when the x10 module on your router was detected as off

confused me.   How can it be detected as off?  I thought all these devices were 'dumb' and did not communicate their status..
« Last Edit: July 24, 2018, 08:00:11 AM by npaisnel »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Quick hello
« Reply #6 on: July 24, 2018, 08:14:08 AM »

Homegenie (HG) can be set to monitor specific x10 modules when it detects the off command it will assume the module is off that doesn't mean the module is actually off just that HG thinks it is.

You can't poll to be sure the module is off you can only program a macro so it sends a On signal.
This would make HG think the module is now On however as you stated the modules are dumb and there is no way to be sure (unless you have two way modules)

As for getting HG configured have a look at this doc:
https://www.dropbox.com/s/8ybc1im6yvsn8a5/HomeGenie%2C%20HA-Bridge%2C%20Broadlink%20RM%2C%20and%20X10%20living%20in%20Harmony.doc?dl=0
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Quick hello
« Reply #7 on: July 24, 2018, 09:04:36 AM »


You can't poll to be sure the module is off you can only program a macro so it sends a On signal.
This would make HG think the module is now On however as you stated the modules are dumb and there is no way to be sure (unless you have two way modules)


ah ok, thanks.   Was dreading the prospect of having to buy new modules that could be polled and did send out their state


As I have enforced sick leave of probably 6 months, due a Broken leg  (..crashed motorbike :(  )   I have plenty of time to read up and get this sorted.


Trying to get to grips with Active Home Pro and the CM11 at the moment, but do not have any actual modules here to test that the CM11 is actually sending the powerline commands ( I am on bed in downstairs room at my parents house.



Will try and send out a raiding party to my home to grab some plug in applianc modules and a Rasp Pio keep me occupied
Logged

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Quick hello
« Reply #8 on: July 24, 2018, 10:46:04 AM »

As for getting HG configured have a look at this doc:
https://www.dropbox.com/s/8ybc1im6yvsn8a5/HomeGenie%2C%20HA-Bridge%2C%20Broadlink%20RM%2C%20and%20X10%20living%20in%20Harmony.doc?dl=0

Thanks for that link,  useful and interesting but I can see from reading the first few lines HG is not what I am looking for.  I was wanting to send a schedule to the CM11 and let that get on with it.  Just a simple off/delay/on command once a day to reboot my router.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Quick hello
« Reply #9 on: July 24, 2018, 11:22:40 AM »

Since you wish the cm11 to handle the timer and schedule you'll need to find a program that can upload to it.
If the cm11 is what is called  the cm11 pro then It may use the same protocol as the CM15A which requires the windows AHP software to upload to it.
I'm not sure a linux program can upload to the CM11 pro or CM15.
If your cm11 is new it shoukd have came with Windows software on a CD.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Quick hello
« Reply #10 on: July 24, 2018, 11:32:00 AM »

Since the HA-Bridge is capable of sending multiple commands separated with a delay, why not use it?
Create a device called "Cycle Router" in the On call issue a  X10 off command followed by a delay followed by an x10 on command.
In your Alexa app under routines schedule Alexa to turn that on every day at the desired time.
This requires your PI and HA-Bridge to be always running so that really isn't what your looking for either, as HG could do the same.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Quick hello
« Reply #11 on: July 24, 2018, 12:50:09 PM »

Thinking about it, the Pi and HA bridge software are running all the time, so yes, that would work without an extra ‘layer’  (HG)

I suppose just cut out Alexa and HA bridge and issue the hey I commands direct from the Pi as CRON, which I think we may have mentioned earlier. 

But would still like to learn how to program these events direct in the CM11.   Maybe even via direct command line ?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Quick hello
« Reply #12 on: July 24, 2018, 01:46:54 PM »

I have my Pi with HA-bridge and HG all running 24/7 with no issues but I'm using a Pi 3B+
Cutting out Alexa would be best as it won't work if your internet is down.
What is your command in HA-Bridge to turn on a X10 device? Are you using mochad?
CRON will be the best route running a script to send the x10 event, you could follow that up with a reboot of the Pi.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

npaisnel

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 63
Re: Quick hello
« Reply #13 on: July 25, 2018, 09:56:15 AM »

Hi

yes I never planned to do it via Alexa, for the reason you state. 
I have HA -Bridge on a RPi3B+ too
not looked up mochad yet.. but no not using it

Basic HA bridge commands Heyu on b1   etc


Using cron, rather like using Alexa is that it is another layer .  If I stick a basic reboot macro/script in the CM11, then even if the Pi is down I can still have it auto cycle the router every night, or run the reboot via a single command direst via RF remote or the iPhone app

This afternoon I have been programming the CM11 (actually CM12U UK spec model) via the x10.sched and x10.config files in the /etc/heyu/ directory.

Programming the timers and macro and triggers all seems ok.  I am only running a test setup today ..I am not at home, so running a spare CM11 and some random modules ..but I do not have a workign transceiver or a TIP10RF device that sends RF signals from an ap on the iPhone.


I really need to create a macro with a delay between the commands so executing one macro via a trigger of a 'fake' device like in this example below C5

but from what i have been reading the DELAY in  macro comes BEFORE the commands, then you have string of commands.  Really need Command;delay;command



I want to create one 'script or macro' triggered by a 'fake' device ON command that powers off the router on B1, waits 30 seconds and powers back on.  A scheduled reboot via the timer is fine, it is just workign out how to get the 'on demand ' reboot that has mee stumped

x10.conf
Code: [Select]
TTY     /dev/ttyUSB0
START_ENGINE AUTO
HOUSECODE         A
LOG_DIR /etc/heyu/
DATE_FORMAT DMY
LAUNCH_SOURCE ANYSRC
LONGITUDE         W002:05
LATITUDE          N49:10
WRITE_CHECK_FILES YES



Code: [Select]
timer  smtwtfs    01/01-12/12 12:40 12:41   c5on  c5off
macro  c5on  0  on  a1
macro  c5off 0  off a1

trigger c1 off  c5off
trigger c1 on  c5on
Logged
 

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