Analog and Digital custom graph

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
danjardmathieu
Posts: 15
Joined: Friday 09 October 2015 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Analog and Digital custom graph

Post by danjardmathieu »

Hi
Would it be possible to implement the DIGITAL devices to the custom graph to be able to capture on the same charts a temperature, his setpoint and the command device ?
Many thanks
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by stlaha2007 »

Temperature and setpoint are available as a Evohome Zone devices. Added it through json-api and feesing it with my livingroom temp-sensor and thermostat setpoint through a script. It shows under the temperature and then you can select other temp-sensors including the temp-setpoint into one custom graph.

Dont understand what you mean by commanddevice. Is it what i already describe above or something else?
danjardmathieu
Posts: 15
Joined: Friday 09 October 2015 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by danjardmathieu »

Re
I mean by command device, the device which will heat or cool, depending the way of the regulation.
For me it's a simple relay to power a heater.
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by stlaha2007 »

So basicly a On/Off switch, right?
How about using the setpoint as described as fixed say 100 degrees is on/0 degrees is of?
danjardmathieu
Posts: 15
Joined: Friday 09 October 2015 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by danjardmathieu »

Hi
Yes it's a good idea but ...
My configuration is the following :
Temperature is comming from a oregon temperature sensor.
The heater is piloted by a 433Mhz ON/OFF switch.
The setpoint is a dummy thermostat.
How can i do?
Maybe by creating a dummy temperature sensor and do what you proposed previously via a lua script (off is 0°c and on is 30°c)
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by stlaha2007 »

I'll get back later this week with a script (bash-shell) which i wrote myself/use and does the combination of temp and setpoint (dummy thermostat). I'll add a if..then for the switching... As i have less expirience with Blockly and Lua which are also capable of switching based on your example.

Sent from my K00C using Tapatalk
danjardmathieu
Posts: 15
Joined: Friday 09 October 2015 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by danjardmathieu »

Great news.
Looking forward for your script.
Cheers
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Analog and Digital custom graph

Post by stlaha2007 »

danjardmathieu wrote:Great news.
Looking forward for your script.
Cheers
To get you started... a few days ago i posted the script anf instruction to combine temp and setpoint here
http://www.domoticz.com/forum/viewtopic ... 80#p103580
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Analog and Digital custom graph

Post by stlaha2007 »

As previously mentioned.... I posted a script already....

Here is a copy of it with the if statement to check for current temp in livingroom when below setpoint it turns the heater switch on. if equal or higher then setpoint it wil turn heater of.

I also do some mathmetics with the help of bc on my Raspbian so install that with sudo apt-get install bc

Code: Select all

scriptname: update_heat_zone_switch.sh
#!/bin/bash
#### Description of update_heat_zone_switch.sh
#### Purpose:           To read and write Current Living Temp and Thermostat Setpoint from/into Domoticz
####                            And turn On/Off the switch for the heater
#### Created:           2016-11-05
#### Modified:          2016-11-16
#### Owner:             STLAHA2007
#### Functionalities:   Read current temp and setpoint from Domoticz  {curl/json/grep/awk/sed}
####                    Write into combined Zone sensor to Domoticz  {curl/json/grep/awk/sed}
#### This script needs {Unix-style} execute rights (755 - rwx r-x r-x)
#### Declare temporary variables for read/calculate/write
declare    CurrentLiving_Temp
declare    CurrentLiving_SetPoint
declare -i CurrentLiving_Temp_IDX
declare -i CurrentLiving_SetPoint_IDX
declare    HeatZoneLiving_Value
declare -i HeatZoneLiving_IDX
declare -i HeateterSwitch_IDX

declare DomoURL
DomoURL=$(echo "http://domoticz.ip.address:port")

CurrentLiving_Temp_IDX=123
CurrentLiving_SetPoint_IDX=456
HeatZoneLiving_IDX=789
HeaterSwitch_IDX=1024

#### read and calculate current temp and setpoint
CurrentLiving_Temp=$(echo $(curl -s "$(echo $DomoURL)/json.htm?type=devices&rid=$(echo $CurrentLiving_Temp_IDX)" | grep  "Data\"" | awk '{print $3}' | sed 's/\"//g' | sed 's/\,//g'| sed 's/\.000//g' ))
CurrentLiving_SetPoint=$(echo $(curl -s "$(echo $DomoURL)/json.htm?type=devices&rid=$(echo $CurrentLiving_SetPoint_IDX)"  | grep "Data\"" | awk '{print $3}' | sed 's/\"//g' | sed 's/\,//g'| sed 's/\.000//g' ))

HeatZoneLiving_Value=$(echo $(curl -s "$(echo $DomoURL)/json.htm?type=devices&rid=$(echo $HeatZoneLiving_IDX)" | grep  "Data\"" ))

echo $CurrentLiving_Temp
echo $CurrentLiving_SetPoint
echo $HeatZoneLiving_Value

echo "HeatzoneLiving_Value needs to look like....:"
HeatZoneLiving_Value=$(echo $CurrentLiving_Temp";"$CurrentLiving_SetPoint";0;")

echo $HeatZoneLiving_Value
##echo "Electra: "$(echo $M_E_Curr)" kWh    Gas: "$(echo $M_G_Curr)" m3     Water: "$(echo $M_W_Curr)" m3"
curl -s "$(echo $DomoURL)/json.htm?type=command&param=udevice&idx=$(echo $HeatZoneLiving_IDX)&nvalue=0&svalue=$(echo $HeatZoneLiving_Value)"

### Toggle Switch On/Off ############
##
## JSON-API to Toggle (Switch over from current state On becomes Off/Off becomes On:
##     /json.htm?type=command&param=switchlight&idx=99&switchcmd=Toggle
##
## JSON-API to Switch On/Off:
##     /json.htm?type=command&param=switchlight&idx=99&switchcmd=On / switchcmd=Off
##
#####################################

##if (( $(echo "$Meter_Diff > 0"| bc ) && $(echo "$Meter_Diff < 5001" | bc ) ))
if (( $(echo "$CurrentLiving_Temp < $CurrentLiving_SetPoint" | bc ) ))
   then
     echo "Turning on heater !!"
     curl -s "$(echo $DomoURL)/json.htm?type=command&param=switchlight&idx=$(echo $HeaterSwitch_IDX)&switchcmd=On"
fi
if (( $(echo "$CurrentLiving_Temp >= $CurrentLiving_SetPoint" | bc) ))
   then
     echo "Turning off heater !!"
     curl -s "$(echo $DomoURL)/json.htm?type=command&param=switchlight&idx=$(echo $HeaterSwitch_IDX)&switchcmd=Off"
fi
pi@domoticz:~$
Sent from my K00C using Tapatalk
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest