Script to monitor if heaters really are switched on?

Moderator: leecollings

Post Reply
espenf
Posts: 9
Joined: Tuesday 01 September 2015 21:21
Target OS: -
Domoticz version:
Contact:

Script to monitor if heaters really are switched on?

Post by espenf »

I have a thermostat-script that controls my heaters based on data from temperature sensors in the room and a dummy-thermostat in domoticz. Most of the heaters are controlled with 433mhz-plugs.
It works relatively fine, but every now and then the 433-plugs ignores a command from the controller. I guess thats a well known problem with 433-devices.. :)
I combine this with another LUA-script to improve 433mhz reliability that minimizes the problem, but it still occurs once or twice a week. And it is not usually discovered before its bedtime for the baby and the room is cold, or even worse, when the babys mother are freezing.. :shock:

So, have anyone found a good solution to monitor or fix this?

I'm thinking that I should monitor temperatures and send an alarm to my phone if the temperature is sinking when domoticz think that the heater is on and vice versa.
But Im not quite sure where I should start. I have alarms set for given temperatures, but it would be nice if it could be more dynamic and based on the thermostat set point aswell.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Script to monitor if heaters really are switched on?

Post by Egregius »

For the rare case the Zwave network misses a command I use this on my bathroom heather, script is part of the bathroom thermometer in pass2php:

Code: Select all

<?php
$prev=apcu_fetch('badkamer_temp');
$set=apcu_fetch('badkamer_set');
$tbadkamervuur=past('badkamervuur1');
if($status>$prev&&$status>$set&&$tbadkamervuur>600){
	sw('badkamervuur1','Off');
	sw('badkamervuur2','Off');
}elseif($status<$prev&&$status<$set&&$tbadkamervuur>600)
	sw('badkamervuur1','On',true);
Basically, when the new $status (in this case $status is the new temperature) is higher than the previous and it's higher than the setpoint switch the heater off again.
Else if the new $status is lower than the previous and it's lower than the setpoint, switch the heater on again.
espenf
Posts: 9
Joined: Tuesday 01 September 2015 21:21
Target OS: -
Domoticz version:
Contact:

Re: Script to monitor if heaters really are switched on?

Post by espenf »

ok, so you save the last state somehow, or is it possible to read previous values for the sensor?
This script runs every time the temp-sensor gives a new status, or is it time-based?
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Script to monitor if heaters really are switched on?

Post by Egregius »

It's pass2php. The script is device triggered, so on every temperature update of that thermometer. Because the new status is saved after the execution of the device script it's possible to get the previous value from the php cache. That gives the possibility to create scripts like these.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest