Page 1 of 5
Toon Energy Readings on Domoticz
Posted: Friday 27 March 2015 11:43
by bernard
Question : I just added Toon to Domoticz. I see gas usage, Energy reading (high cost) , room temperature, current temperature.
I do not see the energy Usage Low Cost. How do I add this to DOmoticz ?
Re: Toon Energy Readings on Domoticz
Posted: Friday 27 March 2015 13:03
by ThinkPad
I can't help you with the Toon <> Domoticz part, but if you have a smartmeter, you could also try not only reading the meter with Toon, but also with the Pi.
This is probably possible by using a RJ11-splitter and a P1 USB-Serial cable. I have done this in the past with an Arduino and a Pi both reading the smartmeter and it worked fine.
But if you don't have a smartmeter (yet) i can't help you unfortunately, something for the programmers

Re: Toon Energy Readings on Domoticz
Posted: Friday 27 March 2015 14:21
by Mooseknuckle
Hi there,
I also have the toon thermostat but no smart meter (yet). Maybe you just have to wait a day. The low cost energy reading is not a seperate device in Domoticz. When I check the log for my energy meter I see both the low and high cost reading in one graph. And because its daytime now you probably just see the high cost.
Re: Toon Energy Readings on Domoticz
Posted: Friday 27 March 2015 15:11
by bernard
I'll wait a few hours and report back here what the outcome is.
Anyone also experience with Toon - DOmoticz and Fibaro smart plug ?
Re: Toon Energy Readings on Domoticz
Posted: Friday 27 March 2015 15:20
by bernard
ThinkPad wrote:I can't help you with the Toon <> Domoticz part, but if you have a smartmeter, you could also try not only reading the meter with Toon, but also with the Pi.
This is probably possible by using a RJ11-splitter and a P1 USB-Serial cable. I have done this in the past with an Arduino and a Pi both reading the smartmeter and it worked fine.
But if you don't have a smartmeter (yet) i can't help you unfortunately, something for the programmers

I do have a smart meter and have some experience with logging via raspberry.
On github I've got a p1 logger witch logs to a sql database
https://github.com/bernardflach/P1Logger
Re: Toon Energy Readings on Domoticz
Posted: Friday 27 March 2015 15:39
by bernard
I think i've sorted the low and high cost out .. DOmoticz receives, so it seems, both values. The graph says : value1 and value2
If i' m correct the value2 will be used within a few hours now.
Re: Toon Energy Readings on Domoticz
Posted: Saturday 28 March 2015 9:18
by bernard
And Yes

Domoticz registeres both values

awesome
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 11:45
by Adriaan25
Bernard, good to hear it's working!
I was wondering, by the way, what you meant by "room temperature" and "current temperature". Do you mean the room temperature and set-point (target) temperature?
I'm moving soon to a new place, and I'm considering to get Toon as well.
Could you perhaps list all the "Toon" devices that become available in Domoticz (maybe with a screenshot or something)?
This would give me a better indication of the possibilities and make a more informed choice for Toon.

Thanks in advance!
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 13:04
by bernard
That's exactly what i meant
I hope the Domoticz Team can add the specific Toon Scenes to the system And support for smart Plugs registered in Toon
I see in Domoticz :
- Room Temperature
- Target Temperature
- Energy Reading
- Gas Reading
- And one Standard switch witch i don't know what it does. I tried it several times but nothing happens.
In the Toon settings in Domoticz you can add the gas & Energy Fee
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 13:20
by Adriaan25
Thanks for clearing that up!
I'm pretty sure there is already support for "Toon Scenes". In the wiki it says:
Setting the programState via json:
json.htm?type=command¶m=thermostatstate&idx=123&state=3.
STATE_RELAX = 0,
STATE_ACTIVE = 1
STATE_SLEEP = 2
STATE_AWAY = 3
STATE_HOLIDAY = 4
Maybe this is the function of the "standard switch" you mentioned?
Does this switch have a particular name?
And as far as I understand, the "smart plugs" are essentially Fibaro Wall plugs.
I suppose you can either hook them up to a Z-wave controller (which will give domoticz access) or to the Toon Thermostat.
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 14:46
by bernard
I'll post some screenshots (hopefully tonight otherwise tomorrow)
I added the Fibaro Wall plugs to my Toon so others can easily (if needed) start my radio (Webradio) or TV.
Note : Found some new info on this forum regarding the Fibaro wall Plugs :
http://www.domoticz.com/forum/viewtopic.php?f=5&t=4908
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 14:52
by R0cc0
The switch shows the status of the burner in your boiler (Or "CV ketel" as we call it in Dutch)
(I think this only works if Toon is used as an on/off device (instead of Opentherm) )
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 14:55
by bernard
R0cc0 wrote:The switch shows the status of the burner in your boiler (Or "CV ketel" as we call it in Dutch)
(I think this only works if Toon is used as an on/off device (instead of Opentherm) )
I'll check it out and report back.
Re: Toon Energy Readings on Domoticz
Posted: Monday 30 March 2015 16:04
by Mooseknuckle
I don't know if this is the proper way to do it but what I did to get the toon scenes in Domoticz is created a virtual switch for every scene. After this I made a script that checks the temperature setting of the toon setpoint.
This is how I get the temp value:
Code: Select all
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=SWITCH_IDX" | grep -oP '(?<="SetPoint" : ").*(?=",)'
Based on that value it turns the virtual switch on for that scene.
You can also activate the scenes from Domoticz with the commands Adriaan25 mentioned, for example:
Code: Select all
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=thermostatstate&idx=SWITCH_IDX&state=1"
It works but if anybody has a better idea to do this please let me know.
Re: Toon Energy Readings on Domoticz
Posted: Tuesday 31 March 2015 21:02
by bernard
hereby a screenshot of my "Toon" devices in Domoticz.
I tested something new today : I splitted my P1 port from my smartmeter and added a USB serial cable to my pi : P1 Smart meter USB.
This works

Toon Energy Readings on Domoticz
Posted: Tuesday 31 March 2015 23:29
by kurniawan77
Mooseknuckle wrote:I don't know if this is the proper way to do it but what I did to get the toon scenes in Domoticz is created a virtual switch for every scene. After this I made a script that checks the temperature setting of the toon setpoint.
This is how I get the temp value:
Code: Select all
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=SWITCH_IDX" | grep -oP '(?<="SetPoint" : ").*(?=",)'
Based on that value it turns the virtual switch on for that scene.
Can you help me out with this?
I don't know what to do with your script. What kind of script is it? is it bash? And what SWITCH_IDX do you use actually, is it from the Eneco Toon Room SetPoint or from the virtual switch?
Would you be kind to guide me please?
Re: Toon Energy Readings on Domoticz
Posted: Wednesday 01 April 2015 9:05
by bernard
Yes, This is in bash. You call this way a JSON script to control Toon (or other devices) via Domoticz
The IDX is the unique device identifier.
In this case you want to set the scene of Toon so you set the Thermostat (SetPoint)
Toon Energy Readings on Domoticz
Posted: Wednesday 01 April 2015 9:33
by Mooseknuckle
What I wanted to do is show the Toon scenes in Domoticz so I can trigger actions based on the scene that is active on the thermostat. I Created 4 virtual switches for the Toon scenes. After that I made a shell script that runs every 2 minutes. The script checks the toon setpoint temp. Based on that setting it switches on the vswitch for that scene.
Here is my script:
Code: Select all
#!/bin/bash
DOMO_IP="192.168.1.26"
DOMO_PORT="8080"
TOON_SETPOINT_IDX="66"
TOON_AWAY_IDX="82"
TOON_THUIS_IDX="84"
TOON_COMFORT_IDX="81"
TOON_SLAPEN_IDX="83"
temp=`curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SETPOINT_IDX" | grep -oP '(?<="SetPoint" : ").*(?=",)'`
if expr "$temp" '=' 20.0
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_COMFORT_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Comfort already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_COMFORT_IDX&switchcmd=On"
fi
elif expr "$temp" '=' 15.0
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_AWAY_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Away already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_AWAY_IDX&switchcmd=On"
fi
elif expr "$temp" '=' 16.0
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SLAPEN_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Slapen already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_SLAPEN_IDX&switchcmd=On"
fi
elif expr "$test" '=' 19.5
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_THUIS_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Thuis already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_THUIS_IDX&switchcmd=On"
fi
fi
Ofcourse you have to change the ip address, the idx numbers and the temperature values to match your settings

Re: Toon Energy Readings on Domoticz
Posted: Wednesday 01 April 2015 9:45
by gizmocuz
bernard wrote:I'll wait a few hours and report back here what the outcome is.
Anyone also experience with Toon - DOmoticz and Fibaro smart plug ?
Send you a PM
Re: Toon Energy Readings on Domoticz
Posted: Wednesday 01 April 2015 11:21
by kurniawan77
Mooseknuckle wrote:Hi,
What I wanted to do is show the Toon scenes in Domoticz so I can trigger actions based on the scene that is active on the thermostat. I Created 4 virtual switches for the Toon scenes. After that I made a shell script that runs every 2 minutes. The script checks the toon setpoint temp. Based on that setting it switches on the vswitch for that scene.
Here is my script:
Code: Select all
#!/bin/bash
DOMO_IP="192.168.1.26"
DOMO_PORT="8080"
TOON_SETPOINT_IDX="66"
TOON_AWAY_IDX="82"
TOON_THUIS_IDX="84"
TOON_COMFORT_IDX="81"
TOON_SLAPEN_IDX="83"
temp=`curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SETPOINT_IDX" | grep -oP '(?<="SetPoint" : ").*(?=",)'`
if expr "$temp" '=' 20.0
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_COMFORT_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Comfort already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_COMFORT_IDX&switchcmd=On"
fi
elif expr "$temp" '=' 15.0
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_AWAY_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Away already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_AWAY_IDX&switchcmd=On"
fi
elif expr "$temp" '=' 16.0
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SLAPEN_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Slapen already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_SLAPEN_IDX&switchcmd=On"
fi
elif expr "$test" '=' 19.5
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_THUIS_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Thuis already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_THUIS_IDX&switchcmd=On"
fi
fi
Ofcourse you have to change the ip address, the idx numbers and the temperature values to match your settings

Aha, now i understand! i assume you use cron to run the script every two minutes?
Is it also possible to get the STATE from toon instead of the temperature values?