Daikin integration

All kinds of 'OS' scripts

Moderator: leecollings

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

Re: Daikin integration

Post by tcviper »

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
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Daikin integration

Post by ThinkPad »

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.
I am not active on this forum anymore.
User avatar
tcviper
Posts: 89
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper »

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: 89
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper »

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

pi@raspberrypi ~/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: 33
Joined: Friday 15 August 2014 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Daikin integration

Post by Philos31 »

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/HUE/Xiaomi/Z-Wave/Nuki/Daikin 3,5kw Ururu Sarara/IR Heating Panels all working together with domoticz
User avatar
tcviper
Posts: 89
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Daikin integration

Post by tcviper »

when i click the button in domoticz, nothing happens. Im 100% sure i inserted the right id's.
Philos31
Posts: 33
Joined: Friday 15 August 2014 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Daikin integration

Post by Philos31 »

Do you have the lua scripts installed?
RasPi2/KaKu/HUE/Xiaomi/Z-Wave/Nuki/Daikin 3,5kw Ururu Sarara/IR Heating Panels all working together with domoticz
robhuls
Posts: 29
Joined: Monday 23 March 2015 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls »

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: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

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: 29
Joined: Monday 23 March 2015 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls »

I will answer in a week, I am on vacation now :)
course66
Posts: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

thanks and nice vacations.
ciao
robhuls
Posts: 29
Joined: Monday 23 March 2015 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls »

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: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

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: 29
Joined: Monday 23 March 2015 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls »

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: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

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: 29
Joined: Monday 23 March 2015 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls »

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: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

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 6779 times
course66
Posts: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

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 6779 times
course66
Posts: 28
Joined: Monday 10 August 2015 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3202
Location: Italy
Contact:

Re: Daikin integration

Post by course66 »

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 6776 times
robhuls
Posts: 29
Joined: Monday 23 March 2015 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Zwolle
Contact:

Re: Daikin integration

Post by robhuls »

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