Daikin integration

All kinds of 'OS' scripts
User avatar
tcviper
Posts: 167
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper » Wednesday 08 July 2015 21:03

Did what you said twice (Notepad++ copy paste in there saved as daikin.sh and uploaded with filezilla ftp) still same error:
./daikin.sh
./daikin.sh: line 77: 21.0: No such file or directory
./daikin.sh: line 88: [: =: unary operator expected
./daikin.sh: line 94: [: =: unary operator expected

User avatar
ThinkPad
Posts: 1754
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Daikin integration

Post by ThinkPad » Thursday 09 July 2015 8:29

Try WinSCP to connect to the Raspberry over SSH.

Then in WinSCP make a new file, copy script from webpage directly in it. Never had problems that way.
ThinkTheme - theme for Domoticz
My (Dutch) blog: http://thinkpad.tweakblogs.net - My Domoticz scripts: Bitbucket
I'm not (very) active anymore on this forum as i don't use Domoticz anymore.

User avatar
tcviper
Posts: 167
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper » Thursday 09 July 2015 10:25

Could please just post the 'new code' in a zip file on this board? That way we can simply download the zip and extract it on linux or something directly. Since I have tried WinSCP, FTP (and SFTP) but i keep getting those errors over and over. This isnt the first time im doing this on Linux, but for some reason I keep bumping into errors with this script. Thank you :)

User avatar
tcviper
Posts: 167
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper » Sunday 12 July 2015 13:04

ThinkPad wrote:Try WinSCP to connect to the Raspberry over SSH.

Then in WinSCP make a new file, copy script from webpage directly in it. Never had problems that way.

Tried this with WinSCP, same result it keeps saying:

Code: Select all

[email protected] ~/domoticz/scripts $ sudo ./daikin.sh
./daikin.sh: line 77: 21.0: No such file or directory
./daikin.sh: line 88: [: =: unary operator expected
./daikin.sh: line 94: [: =: unary operator expected
Whenever i try to run it :(

Philos31
Posts: 48
Joined: Friday 15 August 2014 22:37
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Daikin integration

Post by Philos31 » Sunday 12 July 2015 14:21

You are supposed to use the buttons, script is not designed to be run from the command prompt, it misses parameters.
Try the buttons.
RasPi2/KaKu/MiLight/HomeEasy/Impuls/Byron/Daikin 3,5kw Ururu Sarara all working together with domoticz

User avatar
tcviper
Posts: 167
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper » Sunday 12 July 2015 14:36

when i click the button in domoticz, nothing happens. Im 100% sure i inserted the right id's.

Philos31
Posts: 48
Joined: Friday 15 August 2014 22:37
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Daikin integration

Post by Philos31 » Thursday 16 July 2015 7:56

Do you have the lua scripts installed?
RasPi2/KaKu/MiLight/HomeEasy/Impuls/Byron/Daikin 3,5kw Ururu Sarara all working together with domoticz

robhuls
Posts: 32
Joined: Monday 23 March 2015 20:20
Target OS: Raspberry Pi
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls » Sunday 23 August 2015 17:57

I have added my python alternative to the wiki. Main advantage is that you do not have to compile jq and install curl (python comes with json and urllib2). As a python-fan I also think it is more elegant :-).

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Saturday 29 August 2015 20:05

robhuls wrote:I have added my python alternative to the wiki. Main advantage is that you do not have to compile jq and install curl (python comes with json and urllib2). As a python-fan I also think it is more elegant :-).
hi robhuls,

I would prefer your solutions of Phyton alternative instead of auto-switch between cooling and heating. Please notice that:
- I'm using Domoticz on raspberry pi my knowledge of Phyton is zero
- I set up in Domoticz the thermostat and 3 switches named "DaikinThermostat, DaikinHeat, DaikinCool, DaikinQuiet"
and have some questions about the instruction for Phyton alternative:
1. what means "Set up domoticz like with the bash script"?
2. If "You also need the lua scripts to tell domoticz to launch the python script whenever you change one of the settings. The command to launch is not something like "os.execute('python /home/pi/domoticz/scripts/daikin.py&')".", which is the command for lua scripts?
3. you wrote a script that starts with "import json ...", what have to do with it?

thanks and ciao,
gabriele

robhuls
Posts: 32
Joined: Monday 23 March 2015 20:20
Target OS: Raspberry Pi
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls » Sunday 30 August 2015 7:48

I will answer in a week, I am on vacation now :)

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Sunday 30 August 2015 10:28

thanks and nice vacations.
ciao

robhuls
Posts: 32
Joined: Monday 23 March 2015 20:20
Target OS: Raspberry Pi
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls » Friday 11 September 2015 15:35

I have updated the wiki to make it more clear. I also slightly changed the procedure, I noticed that I could use just 1 lua script to call the python script in stead of 4.

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Sunday 13 September 2015 21:18

thanks robhuls,

I started studying python, but still far from understanding your code. I have three questions:
1. once created only one lua script, what means "Replace 'DaikinCool' with 'DaikinTemp', 'DaikinHeat' and 'DaikinQuiet' respectively for the files with that name."?
2. in the sh script it shall be noted the IDX of domoticz switches to be changed in the script. In the phyton script seems not required; am I right?
3. let the script run every x minute shall be implemented in the cron job or not?
thanks and ciao,
gabriele

robhuls
Posts: 32
Joined: Monday 23 March 2015 20:20
Target OS: Raspberry Pi
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls » Monday 14 September 2015 19:37

1. Sorry, that should have been removed.
2. I have adapted the wiki, you have to plug those number in the script under dom_names.
3. You do not need a cronjob, the lua script is called by Domoticz if you use one of the buttons and the lua script then calls the python script. I currently have no plans for syncing the state of the unit to domoticz, for me it is quite obvious if the unit is running or not.

Thanks for the comments, my wiki parts improved a bit again!

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Monday 14 September 2015 22:08

hi robhuls,
I made the lua script and py script, changed IPs and IDX in py script but when I change the switch in domoticz nothing happens (whilst with iphone app the daikin change status). Any idea?
thanks,
gabriele

robhuls
Posts: 32
Joined: Monday 23 March 2015 20:20
Target OS: Raspberry Pi
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls » Tuesday 15 September 2015 12:57

What you can try is login on the raspberry running Domoticz and manually running the python script using:

python /home/pi/domoticz/scripts/daikin.py

You can then see if the script does what it should do and also if it gives errors.

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Tuesday 15 September 2015 19:51

hi robhuls,
of course, I should have thought by myself. I tried to launch the full python.py but nothing appeared. So I tried row by row.
When coming to "dom_settings[dom_name] = data_dict['result'][0]['Data']" it seems is waiting something to leave the "for" command.
I don't know if this is the trouble, anyway: how to go on?

ciao,
gabriele
Attachments
Screen Shot 2015-09-16 at 20.11.59.png
Screen Shot 2015-09-16 at 20.11.59.png (175.5 KiB) Viewed 2449 times

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Wednesday 16 September 2015 21:29

tried also this short version, but error...
Attachments
Screen Shot 2015-09-16 at 21.30.57.png
Screen Shot 2015-09-16 at 21.30.57.png (169.14 KiB) Viewed 2449 times

course66
Posts: 64
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 » Wednesday 16 September 2015 22:31

the good thing is that this command line turns on the daikin in heat mode
Attachments
Screen Shot 2015-09-16 at 22.30.54.png
Screen Shot 2015-09-16 at 22.30.54.png (134.6 KiB) Viewed 2446 times

robhuls
Posts: 32
Joined: Monday 23 March 2015 20:20
Target OS: Raspberry Pi
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls » Friday 25 September 2015 16:53

The for line loops over the indented lines that are below the command. It seems that you tried to copy the line to the interactive python console and then indeed it pauses forever. You can run the entire script by typing something like 'python daikin.py' (without the quotes) on the command line.

Your last post indicates that the script tries to connect to domoticz, but it is not successful. Are you very sure that the ip-adress in dom_ip is the current ip address of the raspberry pi running domoticz? If this is incorrect, then the script will also not work, because it will try to retrieve the settings from domoticz but it can't, because it cannot find it.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests