Page 2 of 5
Toon Energy Readings on Domoticz
Posted: Wednesday 01 April 2015 11:47
by Mooseknuckle
Yes I use cron. Sorry but this is the only way I know to get the info. There are commands to set the state but I don't know if there are commands to get the state from toon. Getting it from toon would make this a lot more dynamic.
Re: Toon Energy Readings on Domoticz
Posted: Wednesday 01 April 2015 11:59
by kurniawan77
Mooseknuckle wrote:Hi,
Yes I use cron. Sorry but this is the only way I know to get the info. There are commands to set the state but I don't know if there are commands to get the state from toon. Getting it from toon would make this a lot more dynamic.
Well there is a way but i simply don't have the know hows....
https://github.com/rvdm/toon/blob/master/Toon.py
i see request urls like "
https://toonopafstand.eneco.nl/toonMobi ... eToonState" but u have to be logged in to it. And as we are already logged in through Domoticz..... but i get stuck over here
Would be a lot easier if this was implemented in Domticz @gizmocuz

Re: Toon Energy Readings on Domoticz
Posted: Thursday 02 April 2015 10:05
by zwaz
is this al working without a subscription by Eneco? Can domoticz also change the temp. in the room and make a program for the whole week? This so i can buy one on marktplaats with an subscription by another supplieer.
Re: Toon Energy Readings on Domoticz
Posted: Thursday 02 April 2015 10:23
by Mooseknuckle
I could be wrong but I don't think it will work without eneco. At the moment Domoticz does not communicate with Toon directly but via Eneco because there is no api available for toon yet.
Re: Toon Energy Readings on Domoticz
Posted: Friday 01 May 2015 9:02
by PD0SBH
The bash script to check the temperature setpoint and activate a virtual switch done in LUA. This script also makes sure only 1 scene is active at a time.
Code: Select all
-- script_time_toon_state.lua
-- Read the Toon Thermostat Setpoint Temperature and (de)activate 4 Dummy
-- switches in Domoticz to represent the current Active State.
commandArray = {}
-- Name of the switch with the temperature setpoint.
sThermostatSetPointName = 'Huiskamer Instelling'
-- Temperature SetPoints.
sTemperatureHome = '20.00'
sTemperatureComfort = '20.50'
sTemperatureAway = '15.00'
sTemperatureSleep = '16.00'
-- Names of the 4 switches.
-- Home, Away, Comfort, Sleep
sSceneHome = 'Toon Scene Thuis'
sSceneAway = 'Toon Scene Home'
sSceneComfort = 'Toon Scene Comfort'
sSceneSleep = 'Toon Scene Slapen'
-- Toon Thermostat SetPoint:
sThermostatSetPoint = otherdevices_svalues[sThermostatSetPointName]
--print("SetPoint: Temperature is " .. sThermostatSetPoint .. " ");
-- Toon Scene Home
if (sThermostatSetPoint == sTemperatureHome) then
--print("SetPoint means scene Home");
if (otherdevices[sSceneHome] == 'Off') then
print("Setting Toon SceneHome On")
commandArray[sSceneHome]='On'
end
if (otherdevices[sSceneAway] == 'On') then
print("Setting Toon SceneAway Off")
commandArray[sSceneAway]='Off'
end
if (otherdevices[sSceneComfort] == 'On') then
print("Setting Toon SceneComfort Off")
commandArray[sSceneComfort]='Off'
end
if (otherdevices[sSceneSleep] == 'On') then
print("Setting Toon SceneSleep Off")
commandArray[sSceneSleep]='Off'
end
-- Toon Scene Comfort
elseif (sThermostatSetPoint == sTemperatureComfort) then
--print("SetPoint means scene Comfort");
if (otherdevices[sSceneComfort] == 'Off') then
print("Setting Toon SceneComfort On")
commandArray[sSceneComfort]='On'
end
if (otherdevices[sSceneAway] == 'On') then
print("Setting Toon SceneAway Off")
commandArray[sSceneAway]='Off'
end
if (otherdevices[sSceneHome] == 'On') then
print("Setting Toon SceneHome Off")
commandArray[sSceneHome]='Off'
end
if (otherdevices[sSceneSleep] == 'On') then
print("Setting Toon SceneSleep Off")
commandArray[sSceneSleep]='Off'
end
-- Toon Scene Away
elseif (sThermostatSetPoint == sTemperatureAway) then
--print("SetPoint means Scene Away");
if (otherdevices[sSceneAway] == 'Off') then
print("Setting Toon SceneAway On")
commandArray[sSceneAway]='On'
end
if (otherdevices[sSceneComfort] == 'On') then
print("Setting Toon SceneComfort Off")
commandArray[sSceneComfort]='Off'
end
if (otherdevices[sSceneHome] == 'On') then
print("Setting Toon SceneHome Off")
commandArray[sSceneHome]='Off'
end
if (otherdevices[sSceneSleep] == 'On') then
print("Setting Toon SceneSleep Off")
commandArray[sSceneSleep]='Off'
end
-- Toon Scene Sleep
elseif (sThermostatSetPoint == sTemperatureSleep) then
--print("SetPoint means Scene Sleep");
if (otherdevices[sSceneSleep] == 'Off') then
print("Setting Toon SceneSleep On")
commandArray[sSceneSleep]='On'
end
if (otherdevices[sSceneComfort] == 'On') then
print("Setting Toon SceneComfort Off")
commandArray[sSceneComfort]='Off'
end
if (otherdevices[sSceneHome] == 'On') then
print("Setting Toon SceneHome Off")
commandArray[sSceneHome]='Off'
end
if (otherdevices[sSceneAway] == 'On') then
print("Setting Toon SceneAway Off")
commandArray[sSceneAway]='Off'
end
end
return commandArray
Re: Toon Energy Readings on Domoticz
Posted: Saturday 26 September 2015 11:52
by kurniawan77
How funny... i have made this ....(thanks to Mooseknuckle)
Code: Select all
#!/bin/sh
# Configure settings as desired
# SETTINGS:
# Domoticz IP and Port
DOMO_IP="192.168.129.110"
DOMO_PORT="8080"
# Device idx in Domoticz
TOON_SETPOINT_IDX="6"
TOON_COMFORT_IDX="32"
TOON_HOME_IDX="33"
TOON_SLEEP_IDX="31"
TOON_AWAY_IDX="28"
TOON_OFF_IDX="37"
# Toon program setpoints
TOON_COMFORT_SP="21.0"
TOON_HOME_SP="20.5"
TOON_SLEEP_SP="19.0"
TOON_AWAY_SP="17.5"
TOON_OFF_SP="6.0" # This is just an extra program/ switch in Domoticz
# End of Settings!
#############################################################################################################################################################
temp=`curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SETPOINT_IDX" | grep -oP '(?<="SetPoint" : ").*(?=",)'`
if expr "$temp" '=' "$TOON_COMFORT_SP"
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" '!=' "$TOON_COMFORT_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_COMFORT_IDX" | grep "Status" | grep "Off" > /dev/null
if [ $? -eq 0 ] ; then
echo "Comfort already OFF"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_COMFORT_IDX&switchcmd=Off"
fi
fi
if expr "$temp" '=' "$TOON_HOME_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_HOME_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_HOME_IDX&switchcmd=On"
fi
elif expr "$temp" '!=' "$TOON_HOME_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_HOME_IDX" | grep "Status" | grep "Off" > /dev/null
if [ $? -eq 0 ] ; then
echo "Thuis already OFF"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_HOME_IDX&switchcmd=Off"
fi
fi
if expr "$temp" '=' "$TOON_SLEEP_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SLEEP_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_SLEEP_IDX&switchcmd=On"
fi
elif expr "$temp" '!=' "$TOON_SLEEP_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_SLEEP_IDX" | grep "Status" | grep "Off" > /dev/null
if [ $? -eq 0 ] ; then
echo "Slapen already OFF"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_SLEEP_IDX&switchcmd=Off"
fi
fi
if expr "$temp" '=' "$TOON_AWAY_SP"
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" '!=' "$TOON_AWAY_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_AWAY_IDX" | grep "Status" | grep "Off" > /dev/null
if [ $? -eq 0 ] ; then
echo "Away already OFF"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_AWAY_IDX&switchcmd=Off"
fi
fi
if expr "$temp" '=' "$TOON_OFF_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_OFF_IDX" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "OFF already ON"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_OFF_IDX&switchcmd=On"
fi
elif expr "$temp" '!=' "$TOON_OFF_SP"
then
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$TOON_OFF_IDX" | grep "Status" | grep "Off" > /dev/null
if [ $? -eq 0 ] ; then
echo "OFF already OFF"
else
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=$TOON_OFF_IDX&switchcmd=Off"
fi
fi
Re: Toon Energy Readings on Domoticz
Posted: Tuesday 27 October 2015 20:35
by HansieNL
Hello,
I wanna add Toon scene buttons to set the temperature. So I got few questions.
1. Where exactly to put the scripts?
2. What (virtual) hardware, switches and scenes do I have to setup?
Re: Toon Energy Readings on Domoticz
Posted: Wednesday 28 October 2015 8:44
by jjnj
I just made a couple of switches for home, away, sleeping and comfort. Those switches are also in use for Alarm etc. But when for example home is switched on a http command will trigger: json.htm?type=command¶m=thermostatstate&idx=6&state=1
The state is the warming scene you want to set.
And because I don't know lua yet I just made a blockly: when home is switches, the other switches are switches off of another was on, so only one switch is active and you will know which one
Re: Toon Energy Readings on Domoticz
Posted: Wednesday 28 October 2015 21:15
by HansieNL
What I have done so far...
1 Created dummy hardware
2 Created 4 virtual on/off switches (Thermostaat Comfort, Thuis, Slapen en Weg)
3 Set the on action http command to send when set the switch to on. (Maybe it's better to do that in blocky?)
When I set switch to on, the switch icon change from grey to color and the warming scene state is sent. So this part is working ok.
I like the other switches to be switched to off now.
I can't get this working in blocky.

@ jjnj Is it possible to send me a screenshot of your blocky event?
Re: Toon Energy Readings on Domoticz
Posted: Wednesday 28 October 2015 23:21
by jjnj
I cant right now, not on a pc. It's just the following, if thuis is on do: weg, slapen, comfort off. And just put the json command on the switch itself (at least I think this is easier)
Re: Toon Energy Readings on Domoticz
Posted: Thursday 29 October 2015 17:49
by HansieNL
Got it working. I did setup an event as you told me how to do and that works, but now I use the lua script from PD0SBH. The script also set the switch if setpoint is changed on Toon thermostat.
Thanks for helping.
Re: Toon Energy Readings on Domoticz
Posted: Thursday 05 November 2015 9:16
by kkc1983
Is it also possible to read out the city heating (Stadsverwarming)?
Re: Toon Energy Readings on Domoticz
Posted: Friday 06 November 2015 7:33
by HansieNL
Because I'm new to Domoticz and just got my Hue lamps an Toon thermostat I got a question. Now I've setup 2 dummy hardware entries. Is that ok or should I delete one and create all virtual sensors from the same dummy hardware?

- dummies.jpg (209.75 KiB) Viewed 5828 times
Re: Toon Energy Readings on Domoticz
Posted: Friday 06 November 2015 9:07
by HansieNL
The picture is a screenshot of my hardware and Toon is added (Idx 6).I've added ToonSetpoints as dummy hardware, because want to have on/off switches for the setpoints.
My question is about the dummy hardware (idx 5 wdrechtemp and idx 7 toonsetpoints). Is just one dummy hardware entry ok and create all virtual sensors from there?
Re: Toon Energy Readings on Domoticz
Posted: Saturday 14 November 2015 23:41
by voorstad
Has anyone looked into the ToonAPI already?
http://www.toonapi.com/
Is this of any use for Domoticz?
Re: Toon Energy Readings on Domoticz
Posted: Tuesday 17 November 2015 14:10
by voorstad
voorstad wrote:Has anyone looked into the ToonAPI already?
http://www.toonapi.com/
Is this of any use for Domoticz?
Too early. I now see there will be a ToonAPI launchparty on december 4:
https://www.eventbrite.com/e/launch-par ... 9332385686
Re: Toon Energy Readings on Domoticz
Posted: Saturday 21 November 2015 13:17
by kurniawan77
Anyone updated to 3.2.10 already?
Re: Toon Energy Readings on Domoticz
Posted: Sunday 22 November 2015 17:55
by rharmsen
I found some more information about the API here:
https://api-tst.quby.nl/store/
Hope this will get better the 3th of december (they moved the launchparty)
Re: Toon Energy Readings on Domoticz
Posted: Sunday 22 November 2015 20:45
by AlwinHummels
PD0SBH wrote:The bash script to check the temperature setpoint and activate a virtual switch done in LUA. This script also makes sure only 1 scene is active at a time.
I try to get your script working but it fails or I do it wrong (I think the last)
Can you please tel me how to setup so it will work on my installation.
I've Domoticz 2.3674 on a Raspberry Pi
I put your script (copy past) on the scripts/lua folder
I made a dummy hardware and called that "Toon setpoints" ( what type do I have to set for virtual sensor)
After that i went to the switches tab and created some switches called: Toon Scene Thuis, Toon Scene Weg, Toon Scene Comfort, Toon Scene Slapen
Are those namings correct?
Did I miss something here. becouse the licht bulp goes on an off when I click on any switch I created but nothing happens I can put them all on or off but putting one one doesn't switch the others off.
Also my toon doesný react on this.
Please help
On my log I see:
Code: Select all
2015-11-26 10:47:42.129 Error: ToonThermostat: Error getting current state!
what does that mean and how can I fix this?
Code: Select all
2015-11-26 10:40:40.385 Domoticz V2.3691 (c)2012-2015 GizMoCuz
2015-11-26 10:40:40.387 Build Hash: 7d2e770, Date: 2015-11-25 19:34:13
2015-11-26 10:40:40.388 System: Raspberry Pi
2015-11-26 10:40:40.390 Startup Path: /home/pi/domoticz/
2015-11-26 10:40:40.912 Sunrise: 08:19:00 SunSet:16:37:00
2015-11-26 10:40:40.912 EventSystem: reset all events...
2015-11-26 10:40:41.010 Active notification subsystems: (0/10)
2015-11-26 10:40:41.092 Webserver started on port: 8080
2015-11-26 10:40:41.147 Webserver started on port: 443
2015-11-26 10:40:41.176 Started shared server on: 0.0.0.0
2015-11-26 10:40:42.356 Incoming connection from: 192.168.192.10
2015-11-26 10:40:43.201 ToonThermostat: Worker started...
2015-11-26 10:40:43.205 EventSystem: reset all events...
2015-11-26 10:40:43.207 EventSystem: reset all device statuses...
2015-11-26 10:40:43.232 EventSystem: Started
2015-11-26 10:41:09.858 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:41:09.864 (Toon) Temp (Room Temperature)
2015-11-26 10:41:40.298 (Toon) General/kWh (Slaapkamer-Pi)
2015-11-26 10:41:40.307 (Toon) General/kWh (Lamp woonkmr)
2015-11-26 10:41:40.321 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:41:40.325 (Toon) P1 Smart Meter (Gas)
2015-11-26 10:42:10.711 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:42:10.717 (Toon) Temp (Room Temperature)
2015-11-26 10:42:40.868 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:43:11.026 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:43:11.032 (Toon) Temp (Room Temperature)
2015-11-26 10:43:11.041 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:43:41.219 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:44:11.372 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:44:11.378 (Toon) Temp (Room Temperature)
2015-11-26 10:44:11.387 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:45:11.701 (Toon) General/kWh (Slaapkamer-Pi)
2015-11-26 10:45:11.709 (Toon) General/kWh (Lamp woonkmr)
2015-11-26 10:45:11.714 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:45:11.719 (Toon) Temp (Room Temperature)
2015-11-26 10:45:41.890 (Toon) General/kWh (Slaapkamer-Pi)
2015-11-26 10:45:41.899 (Toon) General/kWh (Lamp woonkmr)
2015-11-26 10:46:12.053 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:46:12.059 (Toon) Temp (Room Temperature)
2015-11-26 10:46:51.296 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:46:51.303 (Toon) Temp (Room Temperature)
2015-11-26 10:46:51.313 (Toon) P1 Smart Meter (Gas)
2015-11-26 10:47:42.129 Error: ToonThermostat: Error getting current state!
2015-11-26 10:48:13.494 (Toon) General/kWh (Slaapkamer-Pi)
2015-11-26 10:48:13.501 (Toon) General/kWh (Lamp woonkmr)
2015-11-26 10:48:13.506 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:48:13.512 (Toon) Temp (Room Temperature)
2015-11-26 10:48:43.681 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:49:13.873 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:49:13.879 (Toon) Temp (Room Temperature)
2015-11-26 10:50:14.182 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:50:14.188 (Toon) Temp (Room Temperature)
2015-11-26 10:50:51.358 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:50:51.364 (Toon) Temp (Room Temperature)
2015-11-26 10:51:51.696 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:51:51.705 (Toon) Temp (Room Temperature)
2015-11-26 10:51:51.713 (Toon) P1 Smart Meter (Energy)
2015-11-26 10:51:51.717 (Toon) P1 Smart Meter (Gas)
2015-11-26 10:52:52.020 (Toon) Thermostat (ToonThermostat)
2015-11-26 10:52:52.025 (Toon) Temp (Room Temperature)
2015-11-26 10:52:52.034 (Toon) P1 Smart Meter (Energy)
Re: Toon Energy Readings on Domoticz
Posted: Tuesday 08 December 2015 19:11
by sj3fk3
http://www.toonapi.com/ is released to the public! I'm going to look into a node-red implementation, direct domoticz support would also be great of course
