Page 1 of 1
CM11 And X10
Posted: Friday 16 December 2016 15:23
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
Re: CM11 And X10
Posted: Friday 16 December 2016 19:22
by franzelare
does the blocky script work? that is a bit more plug and play so you can see if domoticz interfaces correctly
Re: CM11 And X10
Posted: Friday 16 December 2016 22:55
by webtense
hello
I generate the virtual switch, but do not join with the script command

- domoticz.png (204.06 KiB) Viewed 5057 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
Re: CM11 And X10
Posted: Friday 16 December 2016 23:12
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
Re: CM11 And X10
Posted: Saturday 17 December 2016 0:14
by webtense
hello, thank you very much,
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.
Re: CM11 And X10
Posted: Saturday 17 December 2016 8:08
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
Re: CM11 And X10
Posted: Saturday 17 December 2016 19:09
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?
Re: CM11 And X10
Posted: Monday 19 December 2016 19:49
by franzelare
you can have 1 lua script with the off and on device changes for every device and initiate the heyu commands
Re: CM11 And X10
Posted: Monday 19 December 2016 21:32
by webtense
Could you give an example? The LUA command, is always running
thank you very much
Re: CM11 And X10
Posted: Tuesday 20 December 2016 9:52
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
Re: CM11 And X10
Posted: Tuesday 27 December 2016 22:27
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¶m=switchlight&idx=21&switchcmd=On&level=0"
SCRIPT Persiana_herminio off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=22&switchcmd=On&level=0"
SCRIPT Persiana_antonio off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=23&switchcmd=On&level=0"
SCRIPT Lampara_Mesa off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=24&switchcmd=On&level=0"
SCRIPT Luces_PasilloP1 off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=25&switchcmd=On&level=0"
SCRIPT Doble_espacio off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=26&switchcmd=On&level=0"
SCRIPT Cortinero off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=27&switchcmd=On&level=0"
#Banyo
SCRIPT lavamanos off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=29&switchcmd=On&level=0"
SCRIPT ducha off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=31&switchcmd=On&level=0"
#Cocina
SCRIPT Luz_Cocina off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=32&switchcmd=On&level=0"
SCRIPT Persiana_Pica off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=33&switchcmd=On&level=0"
SCRIPT Persiana_salida off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=34&switchcmd=On&level=0"
#Lavadero
SCRIPT Lavadero off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=35&switchcmd=On&level=0"
SCRIPT Persiana_lavadero off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=36&switchcmd=On&level=0"
#Recibidor
SCRIPT Entrada off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=37&switchcmd=On&level=0"
SCRIPT vestibulo off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=38&switchcmd=On&level=0"
#Siestera
SCRIPT Luz_Siestera off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=39&switchcmd=On&level=0"
SCRIPT Presiana_Siestera off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=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¶m=switchlight&idx=41&switchcmd=On&level=0"
SCRIPT Luz_escalera_tramoParking off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=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¶m=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT Persiana_despacho off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=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
Re: CM11 And X10
Posted: Friday 30 December 2016 9:19
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
Re: CM11 And X10
Posted: Thursday 05 January 2017 11:11
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¶m=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT Persiana_despacho off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=switchlight&idx=20&switchcmd=On&level=0"
I must put something else, I activate the switch and in domoticZ does not know.
Re: CM11 And X10
Posted: Thursday 05 January 2017 20:48
by franzelare
if you run the curl command from the command prompt, does it work?
Re: CM11 And X10
Posted: Sunday 08 January 2017 21:46
by webtense
If that works, what is not ejencuta is the SCRIP
Re: CM11 And X10
Posted: Friday 11 August 2017 22:07
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¶m=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT Persiana_despacho off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=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?
Re: CM11 And X10
Posted: Saturday 12 August 2017 0:13
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¶m=switchlight&idx=18&switchcmd=On&level=0"
SCRIPT Persiana_despacho off rcvi :: curl "http://192.168.1.9:8080/json.htm?type=command¶m=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.