Eq3 Max - control with php scripts

For heating/cooling related questions in Domoticz
jack74
Posts: 9
Joined: Wednesday 16 November 2016 13:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by jack74 » Sunday 20 November 2016 21:47

Nothing... i didn't work...

I have a question... I'm launching the script from my browser chrome on my PC and not directly from raspberry, is it ok?
Attachments
domocreatenewhardwx.php_results.txt
(67.48 KiB) Downloaded 41 times

TikTicz
Posts: 14
Joined: Friday 16 September 2016 20:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by TikTicz » Sunday 20 November 2016 22:01

Lauching from any browser, from any device should work fine.

Attached a new file (with domocreatenewhardwx.php) with more debug prints. Please run domocreatenewhardwx.php again and investigate the result.
Attachments
eq3.zip
(279.14 KiB) Downloaded 84 times

jack74
Posts: 9
Joined: Wednesday 16 November 2016 13:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by jack74 » Sunday 20 November 2016 22:24

Solved!!! :D :D :D

I set the website protection with password... I removed it an then the script worked perfectly!!!

Thank you very much!!!

jack74
Posts: 9
Joined: Wednesday 16 November 2016 13:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by jack74 » Monday 21 November 2016 0:28

Hi TikTicz,

I started configuring the scripts in domoticz and I noticed that it only works if the server is without password... Is there a way to set the password in the script to leave the system more secure?

Thanks,

Jack

mvzut
Posts: 295
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

Eq3 Max - control with php scripts

Post by mvzut » Monday 21 November 2016 1:09

Hi TikTicz,

Nice work! Personaly, I am using a lua script for integration of my MAX! system. This is based on core code from Westcott, extended with my own Domoticz interfacing parts. Wondering if there are any benefits in using your php implementation? Maybe I should just try it, so that I can compare properly.

Vice-versa: For people who are interested: feel free to try my latest script at viewtopic.php?f=34&t=841&p=104705#p104705, which is a lua script that runs outside Domoticz (just like the php I guess). It runs very stable and is easy to set up, but I am always open for testers & feedback/suggestions.

Martijn
Last edited by mvzut on Monday 21 November 2016 1:09, edited 2 times in total.
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

mvzut
Posts: 295
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

Eq3 Max - control with php scripts

Post by mvzut » Monday 21 November 2016 1:21

jack74 wrote:Hi TikTicz,

I started configuring the scripts in domoticz and I noticed that it only works if the server is without password... Is there a way to set the password in the script to leave the system more secure?

Thanks,

Jack
What do you mean with "if the server is without password", is this the authentication for Domoticz itself? I guess the php script makes use of JSON calls, which do not work by default if Domoticz is configured to require a password. This can be solved (apart from removing the authentication altogether) by using commands in the form of

Code: Select all

http://<username:[email protected]>domoticz-ip<:port>/json.htm?api-call
in the php script, but that would require that you store your credentials in the script (in uncencrypted form). Not ideal maybe...
There may however be an alternative: Where does you php script run? You can try adding the IP address of that machine to the list of Local networks in the Settings screen of Domoticz. If it runs on the same computer as Domoticz, then simply add 127.0.0.1. Domoticz will not require authentication for these local networks.
Last edited by mvzut on Monday 21 November 2016 1:21, edited 1 time in total.
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

TikTicz
Posts: 14
Joined: Friday 16 September 2016 20:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by TikTicz » Monday 21 November 2016 18:49

Hi Jack74,

Martijn is right. You could try to "username:[email protected]" in front of the ipaddress you configured in appsettings.php at variable: $domoticzhost.
For example "jack74:[email protected]" I am not sure if all my php scripting keeps working. Since this is not my approach, I can't help you any further. It is not save to story usernames and password in plain text file.

A better approach would be to include the php server in your local network settings of your Domoticz settings page.
Last edited by TikTicz on Monday 21 November 2016 19:08, edited 1 time in total.

TikTicz
Posts: 14
Joined: Friday 16 September 2016 20:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by TikTicz » Monday 21 November 2016 19:08

Hi Martijn,

Setting up the LUA approach was to complicated for me. Clues were spread among various posts and I just could not figure out how to get this running stable (this was around Q3 2015). I might have been impatient. As I use php for other purposes, I started a php approach. For me PHP is easier and it seems a more rich and supported language.But this was at least 1 year ago, and I just took me while to get it running stable and by the time I removed the most important bugs out of my code, the winter 2015/2016 has ended. Also due to the limited time a spent on it. At the beginning of this winter I shared this code, because anyone with php (not only Domoticz users) can benefit.

Now I assume the LUA approach is more mature, but as my php approach is also mature and stable I will stick to it. I will make no claim the php approach is better, but for me it's working.

Best regards,
TikTicz

mvzut
Posts: 295
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

Eq3 Max - control with php scripts

Post by mvzut » Monday 21 November 2016 23:34

TikTicz wrote:Now I assume the LUA approach is more mature, but as my php approach is also mature and stable I will stick to it. I will make no claim the php approach is better, but for me it's working.

Best regards,
TikTicz
Hi TikTicz,

I don't know exactly what the status was in Q3 2015, I stepped in later, but I guess you're right. I hesitate to say it, especially since it's partly my own code, but I do think the LUA is quite mature now. Early versions (that a few people still use) involve creating your own dummy devices with a special naming convention. My latest version supports automatic device creation (although a bit different than your scripts do), and also supports reading out wall mounted thermostats and door/window sensors. I noticed that your class script decodes quite some more info coming form the Cube than the LUA script does, very interesting! Maybe I'll have a look if I can copy a few of them if you don't mind.

I read that you once experienced that the Cube lost all its settings? I have had the same, and more than once. I read somewhere that the Cube doesn't like too frequent polling, so I increased the interval between polls from one to five minutes, and I haven't had any problems since (knock on wood ). I guess your system polls the Cube every minute, right? If you or other users of the scripts experience such problems more often, I can advise to build in the option for less frequent polling.
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

TikTicz
Posts: 14
Joined: Friday 16 September 2016 20:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by TikTicz » Tuesday 22 November 2016 20:55

Thanks for explaining your progress, a very good job! For now I am happy, when I get more requirements I will consider your lua implementation.
I don't mind if you take the code. I shared it for anyone who can benefit. Beside the baseline of my code did come from MEGA (http://www.mega-nas.de/max/), so it wasn't mine to begin with.

When I started coding I also think polling was an issue, but later on I discovered only the updating was the issue. This is why:
Doing updates frequent will use up the duty cycle which is about 36 seconds per hour. This seems to be a legal limitations for 868MHz radio comms. Once the maximum duty cycle is reached, no communication with the cube is posible. Communications will be paused with an hour.
So I returned to polling once a minute to read out the values, but I only update temperature when realy needed. Reading gets the info straight out of cube, without radio communication (at least that's what I think).

mvzut
Posts: 295
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

Eq3 Max - control with php scripts

Post by mvzut » Tuesday 22 November 2016 21:49

TikTicz wrote:So I returned to polling once a minute to read out the values, but I only update temperature when realy needed. Reading gets the info straight out of cube, without radio communication (at least that's what I think).
My script also writes the Domoticz setpoints only when they have changed. Still, my Cube lost all its settings three or four times in a few months. I read somewhere (I think it was on this forum, forgot exactly where) that this could be caused by too frequent polling. But maybe he actually meant: too frequent writing of setpoints to the Cube. Anyway, I changed the polling (reading) frequency to 5 minutes and haven't had these Cube resets since then.
Last edited by mvzut on Tuesday 22 November 2016 21:49, edited 1 time in total.
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

jack74
Posts: 9
Joined: Wednesday 16 November 2016 13:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by jack74 » Tuesday 22 November 2016 23:39

Hi,

I can confirm that if you set 127.0.0.1 in Domoticz settings "Local Networks (no username/password)" and also in the appsettings.php ($domoticzhost = "127.0.0.1";) it works fine with Website protection password actived!!!

Thanks a lot to everybody! :D

Jack

nono212
Posts: 7
Joined: Sunday 18 December 2016 14:47
Target OS: Linux
Domoticz version: 3.6179
Contact:

Re: Eq3 Max - control with php scripts

Post by nono212 » Monday 19 December 2016 1:16

Hello
Great job guys
I have a small problem with the php script :
He is able to see my devices but not to grap the details .
The settem is at 21° but he is saying 20.5
any ideas ?

I have this 2 printscreens
Attachments
elv2.png
elv2.png (40.05 KiB) Viewed 1719 times
elv.jpg
elv.jpg (126.2 KiB) Viewed 1719 times

TikTicz
Posts: 14
Joined: Friday 16 September 2016 20:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by TikTicz » Monday 23 January 2017 23:23

Hi,

Sorry for this late response, but I did not receive a notification about your question. In the second screenshot it shows strange names "Cuisine-Rad" en "2a0000". Did you manipulate this names yourself> They do not match the syntax the php scripts expects. When devices are created with a syntax like "10494c Bureau-Rad". The first 6 position are the rf-address of the valve/thermostat, followed by the name you in the eq3-max setup.

My advice is to remove the devices (also the matching text devices) that do not match the syntax. After this check to see if the remaining thermostats devices can be operated by Domoticz. If this is the case, try to recreate the missing thermostats with the script "domocreatenewhardw.php".

Hope this helps.

Dlay
Posts: 1
Joined: Wednesday 29 March 2017 20:46
Target OS: Linux
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by Dlay » Wednesday 29 March 2017 20:52

Hello TikTicz,

when i start the eq3read.php i get the following error:

Fatal error: Uncaught Error: [] operator not supported for strings in /www/php/eq3class.php:196
Stack trace:
#0 /www/php/eq3class.php(59): Eq3Class->GetBuff('L:')
#1 /www/php/eq3read.php(13): Eq3Class->OpenSock('192.168.1.236', '62910')
#2 {main}
thrown in /www/php/eq3class.php on line 196

Line 196 in eq3class.php contains:

if ($line != "") $this->buffarr[]=substr($line,0,-1);

Can you help ?

The appsettings.php is filled correctly.
I use PHP7.1.3 with OpenWRT.

BRs
Dlay

TikTicz
Posts: 14
Joined: Friday 16 September 2016 20:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by TikTicz » Sunday 02 April 2017 19:53

Sorry, I don't have a clue

kluczus
Posts: 22
Joined: Tuesday 12 September 2017 14:39
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Eq3 Max - control with php scripts

Post by kluczus » Thursday 26 October 2017 10:55

Hi,
How to use this scripts with attached wall thermostats ? When I connect them and want to create new devices I have a lot of strange devices (thermostat setpoints and txt).
Attachments
without_wall_thermostats.txt
(5.5 KiB) Downloaded 7 times
with_wall_thermostats.txt
(7.73 KiB) Downloaded 10 times
........................................................................................
RPi2 + sonoff + 433MHz + Xiaomi Gateway + EQ-3 MAX!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests