External Temprature sensor
Moderators: marcelr, TheHogNL, Toonz
External Temprature sensor
Hi,
Is it possible to use an external temperature sensor with Toon(wired, z-wave or via a sensor added in Domoticz or Home Assistant)?
I don't want Toon in my livingroom as I use a tablet with Home Assistant.
I have a Rooted Toon V1
Greatings,
RvE
Is it possible to use an external temperature sensor with Toon(wired, z-wave or via a sensor added in Domoticz or Home Assistant)?
I don't want Toon in my livingroom as I use a tablet with Home Assistant.
I have a Rooted Toon V1
Greatings,
RvE
Re: External Temprature sensor
If you mean, show the temperature on a tile (getting the data via domotizs or HA) then yes.
If you mean using an external temperature sensor for use by the internal thermostat function to control your boiler, then no....
If you mean using an external temperature sensor for use by the internal thermostat function to control your boiler, then no....
member of the Toon Software Collective
Re: External Temprature sensor
So this IS possible... just tested on a Toon1 (need to test on a Toon2 yet)
First, find a way to put (and update) your external temperature into a file on your toon (for example in /var/externaltemp). There are many ways to do this, please figure that out yourself.
The file should contain only one line, the temperature. I think it must be in this floating point format xx.yyyy so for example 28.345
Then edit /qmf/etc/qmf_release.xml and change useDynamicTempCorrection to 0 and create the line with sysFsTempAddress to point to a file which contains your external temperature.
Leave the other values the same.
And then reboot
First, find a way to put (and update) your external temperature into a file on your toon (for example in /var/externaltemp). There are many ways to do this, please figure that out yourself.
The file should contain only one line, the temperature. I think it must be in this floating point format xx.yyyy so for example 28.345
Then edit /qmf/etc/qmf_release.xml and change useDynamicTempCorrection to 0 and create the line with sysFsTempAddress to point to a file which contains your external temperature.
Code: Select all
<happ_thermstat>
<useDynamicTempCorrection>0</useDynamicTempCorrection>
<sysFsTempAddress>/var/externaltemp</sysFsTempAddress>
</happ_thermstat>
And then reboot
Member of the Toon Software Collective
Re: External Temprature sensor
Thanx a lot.
I'm not very good at Linux and coding but I will find a way to 'upload' the temperature to Toon from my Home Assistant.
I think I need to make a file share or something to make the file available on the network and then write values to that file every 30 of 60 seconds.
Greetings,
RvE
I'm not very good at Linux and coding but I will find a way to 'upload' the temperature to Toon from my Home Assistant.
I think I need to make a file share or something to make the file available on the network and then write values to that file every 30 of 60 seconds.
Greetings,
RvE
Re: External Temprature sensor
Not sure about home assistant, but if you can post your data on a webserver, it's quite easy to transfer the data to your toon, using wget.
Re: External Temprature sensor
I have a externat temperature sensor in Home Assistant.
Via Node_Red I've managed to write the temperature in a txt file.
I've installed apache2 webserver and used a symlink to the txt file.
On Toon I've created a simpel script that wil download the txt file via wget with a loop every 25 seconds.
I've edited the file /qmf/etc/qmf_release.xml
But no luck so far.
Here is the qmf_release.xml
The temperature in Toon is 18 with a correction of 12. So Toon displays a temperature of 30.
I will check the file permissions of /var/externaltemp/temp.txt.
I'm not shure if I can change the file permissions with wget.
Next step is to automaticly start the script at boot. I've tried moving the script to /etc/init.d but no luck so far.
Via Node_Red I've managed to write the temperature in a txt file.
I've installed apache2 webserver and used a symlink to the txt file.
On Toon I've created a simpel script that wil download the txt file via wget with a loop every 25 seconds.
I've edited the file /qmf/etc/qmf_release.xml
But no luck so far.
Here is the qmf_release.xml
Code: Select all
<happ_thermstat>
<useDynamicTempCorrection>0</useDynamicTempCorrection>
<sysFsTempAddress>/var/externaltemp/temp.txt</sysFsTempAddress>
</happ_thermstat>
I will check the file permissions of /var/externaltemp/temp.txt.
I'm not shure if I can change the file permissions with wget.
Next step is to automaticly start the script at boot. I've tried moving the script to /etc/init.d but no luck so far.
Re: External Temprature sensor
I've made one big Noob mistake....
I did not make a backup of the qmf_release.xml file
Is there a way to revert back to the original file?
(or reinstall everything)
I did not make a backup of the qmf_release.xml file

Is there a way to revert back to the original file?
(or reinstall everything)
Re: External Temprature sensor
Ok... I'm almost done now
I found out that Toon is very slow updating the temperature.
So if I manually changed the temperature to 24.5, Toon will gradually change the temperature to 24.5. I think the whole process last a few minutes. So thats why I thought the scripts and settings did not work because I did not see any changes on the screen.
I found a bug in Toon. with this setup.
If I want to calibrate the temperature in the menu of Toon, it wil change to a very odd value and it is not possible to change that value..... So hands of of that setting
The Node Red script on Home Assistant works
The webserver works
The wget download script works
Toon reads the contents of the text file.
Only one thing that I need to solve is to automatically start the script at boot.
For the info:
Node Red see attached file. download script (/etc/init.d/download_temp.sh):
and qmf_release.xml:



I found out that Toon is very slow updating the temperature.
So if I manually changed the temperature to 24.5, Toon will gradually change the temperature to 24.5. I think the whole process last a few minutes. So thats why I thought the scripts and settings did not work because I did not see any changes on the screen.
I found a bug in Toon. with this setup.
If I want to calibrate the temperature in the menu of Toon, it wil change to a very odd value and it is not possible to change that value..... So hands of of that setting

The Node Red script on Home Assistant works
The webserver works
The wget download script works
Toon reads the contents of the text file.
Only one thing that I need to solve is to automatically start the script at boot.
For the info:
Node Red see attached file. download script (/etc/init.d/download_temp.sh):
Code: Select all
#!/bin/sh
while true
do
wget -q -N -O /var/externaltemp/temp http://192.168.178.6/temp.txt
sleep 30
done
Code: Select all
<happ_thermstat>
<useDynamicTempCorrection>0</useDynamicTempCorrection>
<sysFsTempAddress>/var/externaltemp/temp</sysFsTempAddress>
</happ_thermstat>
Re: External Temprature sensor
Check /etc/inittab
There is an example for the TSC script (/usr/bin/tsc) which you can use as example to alway start your script
There is an example for the TSC script (/usr/bin/tsc) which you can use as example to alway start your script
Member of the Toon Software Collective
Re: External Temprature sensor
Not shure yet how I can use that but I will give it a try.TheHogNL wrote:Check /etc/inittab
There is an example for the TSC script (/usr/bin/tsc) which you can use as example to alway start your script
Last night I woke up because it was very hot in the house.
Turns out that the temperature reading in Toon was 0.0 so Toon was heating the whole house like crazy. And that during the warmest weeks of the year.


This morning I was checkin what was wrong.
I think that the wifi connection was lost somehow and the wget command did not work.
the temp file was empty. I don't know why the file should be empty if wget fails. It seems to me that the last successful reading should still be in the file.
I will try to reproduce the error.
I need to do something that if the reading is zero, it will automatically write a value of 60.0 to the file so Toon won't start heating the whole house.
If wget comes back again, the file will be overwritten by the right temperature.
Greetings,
RvE
Re: External Temprature sensor
Sorry for the many post. I can not (yet) edit a post.
Fixed the 'bug'
Found out that wget did write an empty file upon error.
So I changed the script a litlle
Wget downloads the file to the file dowload. If no error, mv moves that file to temp
If there is a error then mv wil not be launched.
Fixed the 'bug'
Found out that wget did write an empty file upon error.
So I changed the script a litlle
Code: Select all
wget -N -O /var/externaltemp/download http://192.168.178.6/temp.txt && mv /var/externaltemp/download /var/externaltemp/temp
If there is a error then mv wil not be launched.
Re: External Temprature sensor
For your info and for others might want to do something similar:
Change the rights of the script with: chmod +x /etc/init.d/download_temp
Than add the following line to /etc/initttab:
It all seems to work now. Rebooted Toon. rm the temp file, wait 30 seconds and check if the file is created.
(working on a Node red flow to check the sensor value and the value from Toon and if they don't match within 1 minute then notify.notify).
It's a huge step for me because I'm not that good in this
Thanx all for the help!
RvE
Change the rights of the script with: chmod +x /etc/init.d/download_temp
Than add the following line to /etc/initttab:
Code: Select all
# HCBv2 static stuff
# #ovpn:235:respawn:/usr/sbin/openvpn --config /etc/openvpn/vpn.conf --verb 0 >/dev/null 2>&1
qtqt:245:respawn:/usr/bin/startqt >/dev/null 2>&1
tscs:245:respawn:/usr/bin/tsc >/var/log/tsc 2>&1
gett:235:respawn:/sbin/getty -L 115200 ttymxc0 vt102
temp:245:respawn:/etc/init.d/download_temp >/dev/null 2>&1

(working on a Node red flow to check the sensor value and the value from Toon and if they don't match within 1 minute then notify.notify).
It's a huge step for me because I'm not that good in this

Thanx all for the help!
RvE
Re: External Temprature sensor
Nice work! This shows how much can be done with a bit of just trying and reading guides/manuals etc.
Unfortunatly this doesn't work on a Toon2 as it has other type of temp sensors which can not be changed to another file as in a Toon1
Unfortunatly this doesn't work on a Toon2 as it has other type of temp sensors which can not be changed to another file as in a Toon1

Member of the Toon Software Collective
Re: External Temprature sensor
The only thing is that if I change something, and that works, something else stops working.TheHogNL wrote:Nice work! This shows how much can be done with a bit of just trying and reading guides/manuals etc.
Like now I don't have webacces anymore so Toon can't be controlled via Home Assistant

So back to the search function / google again.