Page 4 of 7

Re: Domoticz on synology for evohome

Posted: Saturday 05 November 2016 20:10
by dutch64
Seems like the script expects some input or so (the specific location). Sorry, cannot help you with that but I hope someone can explain because in the future i might like to use more locations also

Re: Domoticz on synology for evohome

Posted: Tuesday 08 November 2016 14:29
by Soulplayer
gordonb3 wrote:You can replace _get_single_heating_system() with locations[0]._gateways[0]._control_systems[0]

To access the second system you'll have to toggle one of the zero values to one. Which one will depend on your setup.
And do you know which files I have to edit? All of them?

Update:

I edited the file settemp.sh and tried three times (each time a 0 to 1):

Code: Select all

import evoconfig
from evohomeclient2 import EvohomeClient
import sys
import dateutil.parser

if len(sys.argv)<5:
        until = None
elif sys.argv[4][:1] == '0':
        until = None
else:
     	until = dateutil.parser.parse(sys.argv[4]).strftime('%Y-%m-%dT%H:%M:%SZ')

#connect to evohome web portal @ http://www.mytotalconnect.com
client = EvohomeClient(evoconfig.usr,evoconfig.pw)
client._locations[0]._gateways[0]._control_systems[1].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
open ("/var/tmp/evo-noup.tmp","w")
Now I get:
client# ./evo-settemp.sh
Traceback (most recent call last):
File "./evo-settemp.sh", line 28, in <module>
client._locations[0]._gateways[0]._control_systems[1].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
AttributeError: 'EvohomeClient' object has no attribute '_locations'

Re: Domoticz on synology for evohome

Posted: Tuesday 08 November 2016 20:24
by Soulplayer
Then I get following error:
Traceback (most recent call last):
File "./evo-settemp.sh", line 28, in <module>
client.locations[0]._gateways[1]._control_systems[0].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
IndexError: list index out of range

Re: Domoticz on synology for evohome

Posted: Tuesday 08 November 2016 21:05
by Soulplayer
Ok, perhaps I should first understand what the different options mean?

Locations => number of locations on my mytotalconnectcomfort account?
Gateway => ?
Control system => evohome basestation?

on my account I have 2 locations because I have 2 evohome stations that connect with 2 opentherm modules.
evohome WiFi Controller x 2
No gateway installed

Always trying with evo-settemp.sh via ssh.

gives error:
client.locations[2]._gateways[0]._control_systems[0].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
gives error:
client.locations[2]._gateways[0]._control_systems[2].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
gives error:
client.locations[1]._gateways[0]._control_systems[2].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
Error from example 2:
Traceback (most recent call last):
File "./evo-settemp.sh", line 28, in <module>
client.locations[2]._gateways[0]._control_systems[2].zones_by_id[sys.argv[1]]._set_heat_setpoint({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"SetpointMode":int(sys.argv[2]),"TimeUntil":until})
IndexError: list index out of range

Re: Domoticz on synology for evohome

Posted: Tuesday 08 November 2016 21:44
by Soulplayer
That's pretty weird... Even with all 0's it gives me the same error. Should I change another file besides the evo-settemp.sh?

Re: Domoticz on synology for evohome

Posted: Wednesday 09 November 2016 13:17
by Soulplayer
So I created a test.sh with following config:

Code: Select all

#!/usr/bin/python
#
# Copyright 2015 - fullTalgoRythm
# 
# Licensed under GNU General Public License 3.0 or later. 
# Some rights reserved. See COPYING, AUTHORS.
# 
# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
#
# see http://www.domoticz.com/wiki/Evohome
# see http://evohome-client.readthedocs.org/en/latest/index.html
#


import evoconfig
from evohomeclient2 import EvohomeClient
client = EvohomeClient(evoconfig.usr,evoconfig.pw)
zone=client.locations[1]._gateways[0]._control_systems[0]._zones[1]
schedule=zone.schedule()
print schedule
and this works perfectly... I also used locations 0 which worked. But when I use a name with '' or without'' it gives an error. Not really a big deal but it shows your code is correct but how would I have to implement it in the settemp.sh...

Re: Domoticz on synology for evohome

Posted: Saturday 12 November 2016 20:56
by fantilator
Hi Alle,

I've just read your walkthrough about the evohome Domoticz connection.
I a linux novice and got stuck on the run: /var/packages/debian-chroot/scripts/start-stop-status chroot commend.
I get sh: run:: command not found

Is there any change of setting up a teamviewer session and help me out for a couple of minutes please?

Kind regards

Re: Domoticz on synology for evohome

Posted: Sunday 13 November 2016 11:37
by Soulplayer
don't use the run before the command. just use "/var/packages/debian-chroot/scripts/start-stop-status chroot"

Re: Domoticz on synology for evohome

Posted: Sunday 13 November 2016 18:48
by fantilator
Hi Soulplayer,
Thank you for your help, I got a bit further now,

Now I'm stuk at the point where I have to create the own evohome-config.py file.

https://www.domoticz.com/wiki/Evohome#S ... _or_RFG100

Should I do this in notepad or via the shell, as I cannot find the evohome-client folder on my NAS.

I tried also via the VI command, although I'm struggling editing the pasted text and cannot save it.

Thanks

Re: Domoticz on synology for evohome

Posted: Sunday 13 November 2016 20:27
by Soulplayer
I use winscp to make the files, i do not like the vi editor...

To use winscp as root, follow these steps:
Log in with SSH, be root, "sudo -i"
Enter, "vi etc/sudoers"
comment out the line #%administrators ALL=(ALL) ALL
insert a new line as: %administrators ALL=NOPASSWD: ALL
[esc] :w!
enter password.
https://forum.synology.com/enu/viewtopi ... 95#p425367

Re: Domoticz on synology for evohome

Posted: Monday 14 November 2016 18:32
by fantilator
I was able to set up everything, although 2parts are not acting as should be.
1 the task schedule runs as long as I'm logged in to DSM and then jumps to 1 time per day instead of per minute.

2 setting temperature towards te system does not work. Guess I'm missing a script as I have seen in the Domoticz log.

Re: Domoticz on synology for evohome

Posted: Monday 14 November 2016 19:55
by Soulplayer
1: Make sure you select the right "first execution time" (bad translation probably): if you set the task at 17 make sure you set it at 17. It will then default back to one time a day so you need to change it back. Then put the end time at 23:59.

2: What is the log error?

Re: Domoticz on synology for evohome

Posted: Tuesday 15 November 2016 9:45
by fantilator
I have set my task to start at 00:00 end end time at 23:59 so I think it will run OK now.

For the second item, this is the error code:

2016-11-16 10:12:18.447 Error: evohome: Error script not found '/home/evohome-client/evo-settemp.sh'

Update1: I think it cannot find the evo-settemp.sh because the update script runs inside the chroot environment, and the domoticz runs outside the chroot environment.

Update2: I have changed the evoconfig file to following.

GNU nano 2.2.6 File: evoconfig.py Modified

Code: Select all

#fill in username
usr=*********
#fill in pw
pw=***********
#fill in Domoticz URL
url='192.168.**********'
#fill in Domoticz port
port='8084'
#fill in script root e.g. script:///home/<user>/evohome-client script::///usr/local/bin etc
srt='script:///volume2/@appstore/debian-chroot/var/chroottarget/home/evohome-client/evohomeclient2'
Now I get 2016-11-16 20:04:01.776 Error: Error executing script command (/volume2/@appstore/debian-chroot/var/chroottarget/home/evohome-client/evohomeclient2/evo-settemp.sh). returned: 256

Update3: after trying to run the evo-update.sh I get following error.
looks quite the same as what soulplayer got, with the only difference is that I only have 1 system.
Traceback (most recent call last):
File "./evo-settemp.sh", line 28, in <module>
client._get_single_heating_system().zones_by_id[sys.argv[1]]._set_heat_setpo int({"HeatSetpointValue":0.0 if len(sys.argv)<4 else float(sys.argv[3]),"Setpoin tMode":int(sys.argv[2]),"TimeUntil":until})
IndexError: list index out of range
I also made the test file, which works just fine.

Update4:

Just tried to figure out where it goes wrong.
when debugging the value sys.Avrg I get next results:
Number or arguments 1 arguments
Argument list: ['./evo-settemp_test.sh']
this value sys.avrg must go through an If function which must return the "Timeuntil" value.

#If the length of this is less than 5 then the timeuntil value is None
if len(sys.argv)<5:
until = None
#Else if the value is ??? return none
elif sys.argv[4][:1] == '0':
until = None
#else return me the date and time
else:
until = dateutil.parser.parse(sys.argv[4]).strftime('%Y-%m-%dT%H:%M:%SZ')

When debugging this part it says that the lenth is smaller than 5 and thus return None, which is not a date or time format.
also this part "dateutil.parser.parse(sys.argv[4]).strftime('%Y-%m-%dT%H:%M:%SZ')" returns the listindex out of range error

Is it possible that something goes wrong over here?

Re: Domoticz on synology for evohome

Posted: Wednesday 16 November 2016 14:49
by fantilator
New strage acting part,

When I run the code from SSH, the values update, although the task sheduler runs, but does not update the values.

Code: Select all

chroot /volume2/@appstore/debian-chroot/var/chroottarget /home/evohome-client/evohomeclient2/evo-update.sh
Update: After restart of NAS it works again, we'll see how long it takes.
Update2: It keeps running now, problem solved.

Re: Domoticz on synology for evohome

Posted: Saturday 26 November 2016 21:14
by josimd
I'm almost done... but I receive an error message :-( see below...thanks for your support..!

~/evohome-client# ./evo-update.sh
File "./evo-update.sh", line 26
sys.exit(1)
^
IndentationError: unexpected indent

Re: Domoticz on synology for evohome

Posted: Saturday 26 November 2016 21:52
by fantilator
remove any spaces before your line 26.

Re: Domoticz on synology for evohome

Posted: Saturday 26 November 2016 22:35
by josimd
Yess...stupid mistake thanks

Re: Domoticz on synology for evohome

Posted: Sunday 27 November 2016 20:57
by josimd
After ./evo-update.sh I don't receive any errors, looks like everything is fine, but the temps doesn't show up in Domoticz.

For the script location (evoconfig.py) I use the following: srt='script:///home/evohome-client' is this correct? I see also some examples where there referring to script:///volume1/@appstore/debian-chroot/var/chroottarget/home/evohome-client

My (evohome) scripts are in home/evohome-client (@root)

Thanks for your support!

Re: Domoticz on synology for evohome

Posted: Monday 28 November 2016 9:52
by fantilator
when using the chroot, your files are being stored inside the chroot part, so you must link to chroot locations.

srt='script:///volume1/@appstore/debian-chroot/var/chroottarget/home/evohome-client'

Re: Domoticz on synology for evohome

Posted: Monday 28 November 2016 17:42
by josimd
Thanks will change the location... but when I check the location /volume1/@appstore/debian-chroot/var/chroottarget/home/evohome-client it doesn't show the evo files.... I see only the files when login as root to my NAS /evohome-client/

I have selected within Domoticz Hardware --> Evohome via script and included the controller etc. But unfortunately the data is not updated (no temperature is shown...any suggestions?

Thanks again for your support