Howto: LUA setting EvoTouch status

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Howto: LUA setting EvoTouch status

Post by bertoost »

Hi all,

I am trying several things to set the status over my Evohome EvoTouch device. Would like to set the status from Auto to Away or from Away to Auto. What I tried in LUA script was this;

Code: Select all

commandArray['EvoTouch'] = 'Auto'
 //...
commandArray['EvoTouch'] = 'Away'
And also tried to use the "evo-setmode.sh" script like

Code: Select all

script:///home/pi/evohome-client/evohomeclient2/evo-setmode.sh {status}
//...
commandArray['EvoTouch'] = 'On'
But non of these seems to work. At least; Domoticz did not get updated and the Evohome phone app doesn't change either.

Anyone some experience with this?

Thanks in advance.

Regards, Bert
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

Anyone knows how to set that {status} via LUA script?
Tried multiple things, but don't know how.

Should be something like;

Code: Select all

commandArray['EvoTouch'] = 'On#Auto'
But dont know how to pass {status} via LUA.
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

I have the latest version, currently v3.5051
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

Hm will try that manually..
But how can u update EvoTouch switch in Domoticz right after I change de mode?

My LUA script is now checking the state of my iphone and the EvoTouch. I want to avoid a panic attack on my EvoTouch :lol:

Code: Select all

if (otherdevices['iPhone Home'] == 'On' and otherdevices['EvoTouch'] ~= 'Auto') then
    commandArray['EvoTouch'] = 'Auto'
    print('EvoTouch should be set to AUTO now...')
end
[edit]
And yes; it's working via the Domoticz interface and also via command line calling the setmode script
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

I now fixed it by running os.execute and tracking 2 minutes of time in a user variable (for a wait on the update command). Like this;

Code: Select all

if (otherdevices['OnMyWayHome'] == 'On' and otherdevices['EvoTouch'] ~= 'Auto' and (timeFull - uservariables['EvoTouchChanged']) >= 120) then
    os.execute('sudo ./home/pi/evohome-client/evohomeclient2/evo-setmode.sh Auto');
    commandArray['Variable:EvoTouchChanged'] = timeFull
--    commandArray['SendNotification'] = 'Evohome#aangezet!'
--    print('EvoTouch should be AUTO now...')
end
Note; the "on my way home" is a dummy switch which I use with the Pilot app to set to ON when I am at some (one-way-traffic) point on my way home :-). Reaching this "checkpoint" means I am at home in 10 minutes :lol:
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

And that is?
Now getting "lua script is running for 10 seconds" error in the log.
narfight
Posts: 5
Joined: Monday 11 April 2016 11:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Howto: LUA setting EvoTouch status

Post by narfight »

for the time out, change your os.execute like this :

Code: Select all

os.execute('sudo ./home/pi/evohome-client/evohomeclient2/evo-setmode.sh Auto &');
(add & to the end for "send and no wait")
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

Ah of course. Good one. Added it.
Any suggestions for the normal commandArray method?
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

Right..
Sounds very difficult to me :-)

I will try out and finetune the os.execute approach.. Only used to get my evotouch out away mode when I drive home and put back in when leaving.
JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Howto: LUA setting EvoTouch status

Post by JuanUil »

Hi all,

any progress on this lua scripting to change the state of evohome?

Jan
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
DanM
Posts: 79
Joined: Thursday 23 October 2014 22:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Howto: LUA setting EvoTouch status

Post by DanM »

Take a look at https://www.domoticz.com/wiki/Evohome - there is a part titled automation about 2/3rds of the way down the page.

In my case evohome is device IDX 161 so I use the following to set eco mode when Im way from home:

Code: Select all

os.execute('curl "127.0.0.1:8080/json.htm?type=command&param=switchmodal&idx=161&status=AutoWithEco&action=1&ooc=1"')
JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Howto: LUA setting EvoTouch status

Post by JuanUil »

Thanx,

I will go working with the json commands.

jan
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
bertoost
Posts: 13
Joined: Monday 04 April 2016 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.5051
Location: The Netherlands
Contact:

Re: Howto: LUA setting EvoTouch status

Post by bertoost »

Any updates on this? It was still not working from LUA script...

As I have a for loop at the end of my LUA script, since I have some backup groups/scenes (for when some lights did not turned on), I have extended this loop with this piece;

Code: Select all

if (key == 'EvoTouch') then
    EvoTouchIdx = otherdevices_idx['EvoTouch']
    
    os.execute('curl "127.0.0.1:8080/json.htm?type=command&param=switchmodal&idx=' .. EvoTouchIdx .. '&status=' .. value .. '&action=1&ooc=1"')
end
From here I can do this anyway

Code: Select all

commandArray['EvoTouch'] = 'Auto'
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest