Temperature Setpoint & PHP script

Moderator: leecollings

Post Reply
Tylou
Posts: 5
Joined: Monday 28 September 2015 11:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

Temperature Setpoint & PHP script

Post by Tylou »

Hello,

I would launch a script when I modify a temperature setpoint

I have a Netatmo thermostat and I have implemented a PHP script to show temperature and thermostat status.
That's working well

Now, I would to be able to set the temperature with Domoticz.
But the temperature setpoint widget, doesn't allow to launch a script when I change the temperature (as for ON/OFF button).

A solution is to use CRON, to compare the Domoticz setpoint and netatmo setpoint.
If values are differents, send the new temperature to netatmo.
-> the risk is to erase domoticz setpoint when I update data from netatmo before checking setpoints

Is someone know how launch a PHP script when temperature setpoint is modified?

Thanks
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Temperature Setpoint & PHP script

Post by Egregius »

True, an update of a setpoint doesn't trigger scripts.
I run a big PHP script by cron every 10 sec to compare everything and switch where needed.
Tylou
Posts: 5
Joined: Monday 28 September 2015 11:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

Re: Temperature Setpoint & PHP script

Post by Tylou »

Ok
Thanks for your answer.

Before sending my query I though this solution too heavy and not very nice.
But according to your "PHP Floorplan" it works :-)

I will implement it
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Temperature Setpoint & PHP script

Post by Egregius »

PHP isn't very heavy.
I run Apache with X-Cache enabled. X-Cache serves the files rapidly from memory instead of disk and can store variables. For non persistant variables way faster than querying Domoticz.
I run 1 big PHP script that does truly everything I wish from Domoticz. It's run every 10 sec by cron and upon every switch update. The script takes less than 0,1 sec to complete (if there's nothing to do, else about 0,05 sec for every command sent).
Still, my CPU usage is less than 1% (with 95 used devices).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest