--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommunity+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/openremotecommunity.
To view this discussion on the web visit https://groups.google.com/d/msgid/openremotecommunity/19271448-02fe-4f92-a7a5-c65a027bce14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openremotecommunity/f8514b48-3e4b-439a-be2e-5a0906006bc1%40googlegroups.com.
On 16 Mar 2019, at 06:49, orct...@gmail.com wrote:
I followed some instructions at this link below and add string.format (".%3f, which seems to successfully add the rules fule without errors but i am wondering if it will work for the graphing which i think requires a number instead of a string for plotting
--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openremotecommunity/c5ee53e3-1642-465e-a1e3-1e3a2ed40209%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommu...@googlegroups.com.
Visit this group at https://groups.google.com/group/openremotecommunity.
To view this discussion on the web visit https://groups.google.com/d/msgid/openremotecommunity/e986918a-19c8-4142-95cd-a071c57f7a85%40googlegroups.com.
<virtual sensor values.docx>
Thanks Michal.i agree it is something to with the parseDouble but i cant really figure it out yet. To eliminate any of the conversions being an issue, i decided to test out the the graphing with RRD4J with a simple in virtual sensor (of type custom) with rule that increments it every minute till it reaches 99 and then resets it to 1.Unfortunately, i cant get this to show up on the graph as well. I am at a loss as why no data is being logged in the .rrd file (it gets created the when the controller starts but i dont see it being updated there after based on the time stamp)the counter itself is working fine and gets incremented every min as expected as i can see it on the panel. I have copy/pasted the rule and rrd4j config file below. If you see anything obvious that i may be missing, please let me know.are there any specific log files that show when the data gets put in to the .rrd file?Thanks for helping out with thisrrd4j config file:________________________________________________<?xml version="1.0" encoding="UTF-8"?>
<rrd4j xmlns="http://www.openremote.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openremote.org http://www.openremote.org/schemas/rrd4j.xsd">
<rrdDB fileName="graph.rrd" step="60">
<datasource name="countersensor" type="GAUGE" heartbeat="120" />
<archive function="AVERAGE" xff="0.5" steps="1" rows="300" />
<archive function="AVERAGE" xff="0.5" steps="10" rows="144" />
<archive function="AVERAGE" xff="0.5" steps="15" rows="672" />
<archive function="AVERAGE" xff="0.5" steps="60" rows="744" />
<archive function="AVERAGE" xff="0.5" steps="120" rows="4380" />
</rrdDB>
<rrd_graph_def name="graph2">
<options>
<vertical_label>count</vertical_label>
<title>counter</title>
</options>
<datasources>
<def>
<name>countersensor1</name>
<rrd>graph.rrd</rrd>
<source>countersensor</source>
<cf>AVERAGE</cf>
</def>
</datasources>
<graph>
<line>
<datasource>countersensor1</datasource>
<color>#FF0000</color>
<legend>%Lum\r</legend>
<width>2</width>
</line>
<comment>This chart displays counter values.</comment>
</graph>
</rrd_graph_def>
</rrd4j>_________________________________________________________Rule file: (counter sensor is tied to counter command).....
package org.openremote.controller.protocol
global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;
import java.util.*;
import java.lang.Integer;
//import java.util.regex.*;
//import java.lang.*;
//import java.lang.reflect.Method;
rule "assign"
when
eval(true);
then
execute.command( "countercommand", 1);
end
rule "counterdecrement"
timer (int: 1m)
when
Event( source == "countersensor", $v:value > 0 )
then
int i = Integer.parseInt($v.toString());
i = i + 1;
execute.command ("countercommand", i );
end
rule "counter reset"
when
Event( source == "countersensor", $a:value > 99 )
then
int j = Integer.parseInt($a.toString());
j = 1;
execute.command ("countercommand", j );
end
--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommu...@googlegroups.com.
Visit this group at https://groups.google.com/group/openremotecommunity.
To view this discussion on the web visit https://groups.google.com/d/msgid/openremotecommunity/1ea565e3-e494-4b44-812a-02cf7e1695f9%40googlegroups.com.
Also because of averaging, I had to really zoom in to within a day to see the graph.
All my sensors were custom sensors. I changed them to level sensors after which they did not show decimal values and I used parse integer which seems to work. I will do a little more testing and post my working rrd4j config file and the rules file for future reference by others.
I am still interested in trying emoncms. The instructions for it don't seem complete or they may be for a previous version. I will start a new discussion to ask for some additional help on it.