CM11 And X10

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

Post Reply
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

CM11 And X10

Post by webtense »

Good morning, my name is Andrew. I am new to this forum, installed on a raspberryPi2 DomoicZ, the truth is that it is a past.
I have a house currently domotized using X10, with Marmiteck controllers, and all this is controlled with a CM11, I have followed all the steps of the WIKI, and from console I get to act on the controllers, but I am not able to join the .LUA In DomoticZ.
For me to work.
I use an RFcomm and that goes perfect
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by franzelare »

does the blocky script work? that is a bit more plug and play so you can see if domoticz interfaces correctly
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

hello


I generate the virtual switch, but do not join with the script command
domoticz.png
domoticz.png (204.06 KiB) Viewed 4896 times

Code: Select all


pi@raspberrypi:~/domoticz/scripts/lua $ cat script_device_Apparaat01.lua
commandArray = {}
if (devicechanged['Apparaat01'] == 'On') then
        os.execute('sudo -u pi /home/pi/heyu-2.10/heyu on c5')
elseif (devicechanged['Apparaat01'] == 'Off') then
        os.execute('sudo -u pi /home/pi/heyu-2.10/heyu off c5')
end
return commandArray

What do I do wrong? From console if I execute the command, which executes the script works for me.

thank you very much
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by franzelare »

if you have the lua scripts runing in the event section with based on changing devices you don't need to put them as actions with the virtual switch...

so just add the part between commandarray to a lua device script under configuration--> events
if the commands work from the command line, they should work through a lua script

but I think you have a typo...
os.execute('sudo -u pi /home/pi/heyu-2.10/heyu on c5')
should be
os.execute("sudo -u pi /home/pi/heyu-2.10/heyu on c5")

on my pi I have heyu runing from "/usr/local/bin/heyu"
but if the string works from the command promt there should be no difference in lua when you run it with os.execute
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

hello, thank you very much,

Code: Select all

/home/pi/heyu-2.10/heyu on c5
In my installation is the correct route as the light turns on

I have managed to understand how it works and I have managed to turn the x10 heyu lights on since DomitcZ, I am very happy.

From there it leads me to another problem, as I can do DIM to the blinds, I can make them an ON and an OFF, but not DIM.

Any Script?

the last question..

You can have the system monitor Heyu monitor for changes and show them change the status of the switches,
If I turn on DomoticZ, perfect but if I do from the physical device does not change the state.
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by franzelare »

I have a CM15pro to monitor the status of my 2 way devices and the CM11a to check the level of the 2way dimmer switches when the are turned on, see this topic:
viewtopic.php?f=56&t=11949

by now it is working fine, will update the topic with my latest scripts
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

Thank you very much, it looks good, but I do not understand, should I do a follow-up for each of the elements of the installation?
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by franzelare »

you can have 1 lua script with the off and on device changes for every device and initiate the heyu commands
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

Could you give an example? The LUA command, is always running

thank you very much
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by franzelare »

Setup --> More options --> Events
make a lue scripts, type device with code like this

Code: Select all

commandArray = {}
--first switch on c5
if (devicechanged['VirtualSwitch'] == 'On') then
os.execute("sudo -u pi /home/pi/heyu-2.10/heyu on c5")
end
if (devicechanged['VirtualSwitch'] == 'Off') then
os.execute("sudo -u pi /home/pi/heyu-2.10/heyu off c5")
end
--add more switchs on other codes


return commandArray

webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

Good thanks for your response, later I realized that I should have used it for what Json needed.

This is the code that usu in the x10config

Code: Select all


#################DOMOTICZZZZ

####Comedor

SCRIPT  Persina_bufet           off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=21&switchcmd=On&level=0"
SCRIPT  Persiana_herminio       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=22&switchcmd=On&level=0"
SCRIPT  Persiana_antonio        off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=23&switchcmd=On&level=0"
SCRIPT  Lampara_Mesa            off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=24&switchcmd=On&level=0"
SCRIPT  Luces_PasilloP1 off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=25&switchcmd=On&level=0"
SCRIPT  Doble_espacio           off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=26&switchcmd=On&level=0"
SCRIPT  Cortinero               off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On&level=0"

#Banyo

SCRIPT  lavamanos                 off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=29&switchcmd=On&level=0"
SCRIPT  ducha                     off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=31&switchcmd=On&level=0"

#Cocina

SCRIPT  Luz_Cocina              off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=32&switchcmd=On&level=0"
SCRIPT  Persiana_Pica           off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=33&switchcmd=On&level=0"
SCRIPT  Persiana_salida off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=34&switchcmd=On&level=0"


#Lavadero

SCRIPT  Lavadero                off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=35&switchcmd=On&level=0"
SCRIPT  Persiana_lavadero       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=36&switchcmd=On&level=0"

#Recibidor

SCRIPT  Entrada off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=37&switchcmd=On&level=0"
SCRIPT  vestibulo       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=38&switchcmd=On&level=0"


#Siestera

SCRIPT   Luz_Siestera        off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=39&switchcmd=On&level=0"
SCRIPT   Presiana_Siestera   off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=40&switchcmd=On&level=0"


#Escaleras

SCRIPT  Luz_escalera_tramo1Planta   off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=41&switchcmd=On&level=0"
SCRIPT  Luz_escalera_tramoParking       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=42&switchcmd=On&level=0"

################  Segunda Planta #####################
#Desapacho

SCRIPT  Luz_despacho            off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT  Persiana_despacho       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=20&switchcmd=On&level=0"



But it does not work for me, it does not change the state in domoticz, although if I put the address in the browser I execute the order

What am I doing wrong
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

I do not run the scripts I have open the heyu monitor in a cosola, and I do not see them running,

Should I do something else?


Thank you
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

Good morning and happy new year

I have tried to put the code in the 2 ways and it does not run.

Code: Select all

SCRIPT  C5              off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT  Persiana_despacho       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=20&switchcmd=On&level=0"
I must put something else, I activate the switch and in domoticZ does not know.
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by franzelare »

if you run the curl command from the command prompt, does it work?
webtense
Posts: 16
Joined: Friday 16 December 2016 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: barcelona,SPAIN
Contact:

Re: CM11 And X10

Post by webtense »

If that works, what is not ejencuta is the SCRIP
PeterHarrie
Posts: 9
Joined: Saturday 07 January 2017 16:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by PeterHarrie »

webtense wrote: Thursday 05 January 2017 11:11 Good morning and happy new year

I have tried to put the code in the 2 ways and it does not run.

Code: Select all

SCRIPT  C5              off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT  Persiana_despacho       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=20&switchcmd=On&level=0"
I must put something else, I activate the switch and in domoticZ does not know.
I have the same issue. The commands do work from the command line.
Any thoughts on this?
PeterHarrie
Posts: 9
Joined: Saturday 07 January 2017 16:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: CM11 And X10

Post by PeterHarrie »

PeterHarrie wrote: Friday 11 August 2017 22:07
webtense wrote: Thursday 05 January 2017 11:11 Good morning and happy new year

I have tried to put the code in the 2 ways and it does not run.

Code: Select all

SCRIPT  C5              off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT  Persiana_despacho       off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command&param=switchlight&idx=20&switchcmd=On&level=0"
I must put something else, I activate the switch and in domoticZ does not know.
I have the same issue. The commands do work from the command line.
Any thoughts on this?
SOLVED!
You should not only start heyu itself by 'heyu start', you also need to start the engine and enable scripting.
use:
heyu engine
heyu script_ctrl enable


You only need to start the engine by 'heyu engine' the rest will be started automatically and scripts are enabled by default.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest