Toon app: boiler status
Moderators: marcelr, TheHogNL, Toonz
- RDNZL
- Forum Moderator
- Posts: 1008
- Joined: Sun Sep 24, 2006 1:45 pm
- Location: Dordrecht, The Netherlands
- Contact:
Re: Toon app: boiler status
Influxdb and Grafana together form a nice platform to graph stuff.
I'm thinking about how to get this rrd data imported and create graphs for them to be used outside toon.
nickyb2.tweakblogs.net/blog/13109/bijmi ... rm-gateway
I'm thinking about how to get this rrd data imported and create graphs for them to be used outside toon.
nickyb2.tweakblogs.net/blog/13109/bijmi ... rm-gateway
Regards, Ron.
-
- Member
- Posts: 153
- Joined: Thu Oct 03, 2013 7:53 pm
Re: Toon app: boiler status
Posting to Grafana is already integrated into Domoticz. But it's also possible with InfluxDb, they removed JSON from Influx long time ago so you need a little scripting. You need to write a small php script to make it work:
Let's say write some code that split it into these three values (Edit: It's up to the reader to do some json magic)
$Date
$Time
$value
Then you can make a post to the database something in the line of this:
curl -i -XPOST 'http://Your-IP-Influxdb-Server:Portnumber/write?db=Your-Database-name' --data-binary 'Date-Time,$Date, $time, value=$value '
(docs.influxdata.com/influxdb/v1.3/guide ... ting_data/)
Code: Select all
#!/usr/bin/php
<?php
error_reporting(E_ALL);
$data = file_get_contents('http://192.168.1.31:10080/hcb_rrd?action=getRrdData&loggerName=thermstat_boilerChPressure&rra=year&readableTime=1&samples=100&nullForNaN=1&skipEmpty=1');
//echo $data;
$split0 = str_replace(' ', '$', $data);
$split1 = str_replace('":$', '" : { "Value": ', $split0);
$split2 = str_replace(',"', ' # #, " ', $split1);
$split3 = str_replace('$', '": {" ', $split2);
$split4 = str_replace('}', '} } }', $split3);
$split5 = str_replace(' # #, "' , ' } }, " ' ,$split4);
$split6 = str_replace('{": {" "' , '{ " ' ,$split5);
$final_array = json_decode($split6, TRUE);
print_r($final_array);
?>
$Date
$Time
$value
Then you can make a post to the database something in the line of this:
curl -i -XPOST 'http://Your-IP-Influxdb-Server:Portnumber/write?db=Your-Database-name' --data-binary 'Date-Time,$Date, $time, value=$value '
(docs.influxdata.com/influxdb/v1.3/guide ... ting_data/)
Last edited by Ierlandfan on Sun Nov 26, 2017 10:54 pm, edited 3 times in total.
- RDNZL
- Forum Moderator
- Posts: 1008
- Joined: Sun Sep 24, 2006 1:45 pm
- Location: Dordrecht, The Netherlands
- Contact:
Re: Toon app: boiler status
Very nice pointers you gave there!
I whipped up this small python script to import all boiler water pressure data from last year.
Steps to do before running this:
Install influxdb and grafana
Create database to store data ('toon' in my case)
$ influx
Connected to http://localhost:8086 version 1.3.6
InfluxDB shell version: 1.3.6
> CREATE DATABASE toon
Change script to reflect your toon and influxdb server urls
Also the data you want to copy (tested with thermstat_boilerChPressure)
Add datasource in grafana to use influxdb and db toon
Create dashboard and graph to display data you want to view like this. You can see when the CV got it's yearly maintenance
I whipped up this small python script to import all boiler water pressure data from last year.
Code: Select all
#!/usr/bin/python
import requests
toon_url = 'http://192.168.178.133/hcb_rrd?action=getRrdData&loggerName=thermstat_boilerChPressure&rra=year&nullForNaN=1'
db_url = 'http://192.168.178.113:8086/write?db=toon'
headers = {'X-Requested-With': 'Python requests', 'Content-type': 'text/xml'}
values = requests.get(toon_url).json()
for timestamp, value in values.iteritems():
print(timestamp, value)
payload = 'thermstat_boilerChPressure value=' + str(value) + ' ' + str(timestamp + '000000000')
r = requests.post(db_url, data=payload, headers=headers)
Install influxdb and grafana
Create database to store data ('toon' in my case)
$ influx
Connected to http://localhost:8086 version 1.3.6
InfluxDB shell version: 1.3.6
> CREATE DATABASE toon
Change script to reflect your toon and influxdb server urls
Also the data you want to copy (tested with thermstat_boilerChPressure)
Add datasource in grafana to use influxdb and db toon
Create dashboard and graph to display data you want to view like this. You can see when the CV got it's yearly maintenance

Regards, Ron.
Re: Toon app: boiler status
Another small find from version 4.8 onwards for the graph app:
if you change the following line in GraphScreen.qml:
into
You will get an extra tab in the graph screen called 'boiler' which shows you the minutes and hours the boiler has been burning.
if you change the following line in GraphScreen.qml:
Code: Select all
visible: globals.thermostatFeatures["FF_HeatingBeat_UiElements"]
Code: Select all
visible: true
member of the Toon Software Collective
-
- Member
- Posts: 153
- Joined: Thu Oct 03, 2013 7:53 pm
Re: Toon app: boiler status
If Grafana is showing a red triangle in the left top of the graph then you have to set the time interval in the datasource to:
As in copy and paste that and hit save&test. Then it works.
Code: Select all
>60s
Re: Toon app: boiler status
Could you explain how i can get this data into Domoticz?Ierlandfan wrote:Posting to Grafana is already integrated into Domoticz.
Re: Toon app: boiler status
Great findings, unfortunately i upgraded to 4.9.23. Before the upgrade i used the happ_thermstat?action=printTableInfo url to load information into my domoticz, for example when my hotwater was on so domoticz could lower my screens in case they were open. Downgrading to happ-thermstat_1.554-trunk_qb2.ipk while on firmware 4.9.23 makes my boilermodule unseen by toon. Now my question is how can i check whether my hot water is on or not, via toon 

-
- Starting Member
- Posts: 47
- Joined: Thu Sep 21, 2017 9:14 pm
Re: Toon app: boiler status
Hallo, I like to have the boilerstatus app as a tile on my rooted toon only thing is i don't now how to do this the firmware on my toon is ad this moment 4.7.23
Isn't possible to do this install this by the Toon store? I do not now how to install this by using putty!
probably there are more people how have this problem, it will fore those being muts conveniently be if this is possible by the Toon store.
Thz.
Isn't possible to do this install this by the Toon store? I do not now how to install this by using putty!
probably there are more people how have this problem, it will fore those being muts conveniently be if this is possible by the Toon store.
Thz.
Re: Toon app: boiler status
The boiler status tile is available for toons with firmwares 3.0.29 - 3.5.4. For other versions, the app needs a full rewrite.
-
- Starting Member
- Posts: 47
- Joined: Thu Sep 21, 2017 9:14 pm
Re: Toon app: boiler status
Ohww thats a little bit of a pity.
Thnz anyway for the reply.
grz
Thnz anyway for the reply.
grz
Re: Toon app: boiler status
To add to this post for convenience a complete overview of all variables available in the rrd databases from version 4.10.Toonz wrote:I believe these are the parameters you can use in the http call which I have successfully tested:
readableTime (values 0 or 1 - converts Epoch to normal time
skipEmpty (values 0 or 1 - skips null value readings)
nullForNaN (values 0 or 1 - shows null instead of NaN)
loggerName (string without quotes)
rra (string without quotes)
from (epoch time)
to (epoch time)
samples (integer value - determines how many values you will receive back)
Example:More parameters exist but these are for the function setRrdData with which you can create rra data yourselfCode: Select all
http://192.168.x.x/hcb_rrd?action=getRrdData&loggerName=thermstat_boilerChPressure&rra=year&readableTime=1&samples=100&nullForNaN=1&from=1504301154&to=1509301154&skipEmpty=1
Note that the ID's after the smart plug variables are different for each smart plug. Each plug will have it's own set of databases.
- Attachments
-
- 4_10_rrd_contents_xls.zip
- (10.13 KiB) Downloaded 629 times
member of the Toon Software Collective
Re: Toon app: boiler status
So I downgraded to happ-thermstat_1.554-trunk_qb2.ipk because I wanted to see the data on http://TOONIP/happ_thermstat?action=printTableInfo . It is working, but on my 4.9.23 firmware the boilermodule tile is not usable, and that is not what I want. However, I cannot find the current happ-thermstat (which is version 1.1117-ene-master I believe) ipk file online, and also not on my toon in the cache dir. How can I restore the situation before downgrading to happ-thermstat_1.554-trunk_qb2.ipk ? Is there anyone here that can provide the current happ-thermstat ipk file or do I have to enable the VPN and try to upgrade ? I'm quite new to this, and do not know the exact direction I should go now.DennisD wrote:Great findings, unfortunately i upgraded to 4.9.23. Before the upgrade i used the happ_thermstat?action=printTableInfo url to load information into my domoticz, for example when my hotwater was on so domoticz could lower my screens in case they were open. Downgrading to happ-thermstat_1.554-trunk_qb2.ipk while on firmware 4.9.23 makes my boilermodule unseen by toon. Now my question is how can i check whether my hot water is on or not, via toon
Re: Toon app: boiler status
I just did a factory reset on Toon itself. You do lose your existingvdata but that wasn't a problem for me.
Re: Toon app: boiler status
And what happens during a factory reset? Do I need to 'reroot' the device? Are the iptables restored? What happens to the root passwd? I only have a few days existing data, loosing that is not a problem.DennisD wrote:I just did a factory reset on Toon itself. You do lose your existingvdata but that wasn't a problem for me.
Re: Toon app: boiler status
A factory reset will:rubyan wrote:And what happens during a factory reset? Do I need to 'reroot' the device? Are the iptables restored? What happens to the root passwd? I only have a few days existing data, loosing that is not a problem.
erase all databases on toon
erase personal setiings like the week program, tile preferences etc.
erase wifi settings
reset toon's configuration (config_happ_scsync.xml) to its default settings
It will NOT:
reset the password
reset iptables.conf
remove any software packages
(It will also remove a bunch of files in RAM, but these are restored as soon as the machine has rebooted).