Toon as a domotica controller?
Moderators: marcelr, TheHogNL, Toonz
Re: Toon as a domotica controller?
The first screen resides in a separate flash partition (must be BMP, 32bit RGBA), the second resides in /usr/share/images/, as a raw, compressed framebuffer image (BGR IIRC). This directory also holds the screens for shutdown, reboot etc. The rest are loadscreen_0 and 1 as you showed.
Re: Toon as a domotica controller?
Hi,
Just got into the 'hacking the toon'. Rooted the toon got everything setup with my domoticz server. Thanks for all the tips and scripts! Excellent work has been done. I have two questions regarding the Toon;
-Wifi
Got the toon working wired but no wifi setup on the toon menu (its not available in the menu). Managed to setup wifi by entering wifi setup in the wlan0.conf but this seems to be overwritten on reboot. The other conf is empty.
./etc/network/wpa_supplicant.wlan0.conf
./etc/wpa_supplicant.conf
Any info on where the wpa setup derives from so I can make a persistent wifi connection?
-menu screen on toon
The menu is empty and getting to the main screen requires pressing on the screen. I also get an annoying time box in the upper screen. Looks like some sort of screensaver of sort. Is there any info on how the main Menu can be active allways?
I am using version 3.6 of Toon.
Best regards,
Ewoud
Just got into the 'hacking the toon'. Rooted the toon got everything setup with my domoticz server. Thanks for all the tips and scripts! Excellent work has been done. I have two questions regarding the Toon;
-Wifi
Got the toon working wired but no wifi setup on the toon menu (its not available in the menu). Managed to setup wifi by entering wifi setup in the wlan0.conf but this seems to be overwritten on reboot. The other conf is empty.
./etc/network/wpa_supplicant.wlan0.conf
./etc/wpa_supplicant.conf
Any info on where the wpa setup derives from so I can make a persistent wifi connection?
-menu screen on toon
The menu is empty and getting to the main screen requires pressing on the screen. I also get an annoying time box in the upper screen. Looks like some sort of screensaver of sort. Is there any info on how the main Menu can be active allways?
I am using version 3.6 of Toon.
Best regards,
Ewoud
Re: Toon as a domotica controller?
Sounds like part of the qt-gui has been screwed up. Did you edit parts of the gui at all? Anything in /HCBv2/qml/?
If so, start checking for typo's there.
If not, try and restart the gui manually from a shell, using:
and check for errors in the (large amount of) output.
Oh, which version was it again? 3.6.2 or 3.6.3? 3.6.2 had serious issues, IIRC.
If so, start checking for typo's there.
If not, try and restart the gui manually from a shell, using:
Code: Select all
killall qt-gui; /HCBv2/sbin/qt-gui -platform linuxfb -plugin Tslib --daemon 2>&1
Oh, which version was it again? 3.6.2 or 3.6.3? 3.6.2 had serious issues, IIRC.
Re: Toon as a domotica controller?
Thanks for the quick reply! I checked installed version with; opkg list-installed
base-files - 3.0.14-r100
base-passwd - 3.5.20-r1
base-qb2-ene - 3.6.3-1022-0
so it seems 3.6.3. I saw it was running on an old version so did a opkg update and upgrade. Also changed the qml file to get rid of the Eneco subscription notice.
Did the manual reboot of the qt_gui. Some config not found;
[hbas]Config '<qt-gui>noDiscoByebye' not found, using default '0'
[hbas]Config '<qt-gui>configProvider' not found, using default '(null)'
[hbas]Config '<qt-gui>packageUuid' not found, using default 'eneco-001-245155:qt-gui'
...
[hbas]Config '<qt-gui>logProvider' not found, using default '(null)'
The following errors:
Loading language from file:///HCBv2/qml/apps/systray/lang
ERROR: Invalid language package url: "/HCBv2/qml/apps/systray/lang"
Loaded fullscreen file:///HCBv2/qml/apps/thermostat/TemperaturePresetScreen.qml > Screen_QMLTYPE_36(0x22fa658)
stub Widget init for file:///HCBv2/qml/apps/thermostat/TemperaturePresetScreen.qml
<Unknown File>: Error: Cannot assign [undefined] to QString
stub init for MenuItem file:///HCBv2/qml/apps/homescreen/DefaultMenuItem.qml
prominent widget registered: file:///HCBv2/qml/apps/thermostat/ThermostatSidePanel.qml
<Unknown File>: Error: Cannot assign [undefined] to QString
stub init for MenuItem file:///HCBv2/qml/apps/homescreen/DefaultMenuItem.qml
Loaded fullscreen file:///HCBv2/qml/apps/thermostat/VacationOverviewScreen.qml > VacationOverviewScreen_QMLTYPE_109(0x241ccf8)
stub Widget init for file:///HCBv2/qml/apps/thermostat/VacationOverviewScreen.qml
Loaded fullscreen file:///HCBv2/qml/apps/thermostat/ThermostatProgramScreen.qml > ThermostatProgramScreen_QMLTYPE_122(0x250e418)
<Unknown File>: Error: Cannot assign [undefined] to QUrl
...
Error loading ../../apps/internetSettings/InternetSettingsApp.qml: file:///HCBv2/qml/apps/internetSettings/InternetSettingsApp.qml:359 Expected token `;'
--> fixed the above error by removing a question mark in this qml which VI put there somehow. Im more a nano editor it seems. Will check tomorrow if the internet settings menu is available.
--UPDATE
This morning still no wifi setup. Did a factory reset and could enter wifi settings. So wiring problem solved. The annoying part of the home screen does still pop up constantly (even on boot)

Ewoud
base-files - 3.0.14-r100
base-passwd - 3.5.20-r1
base-qb2-ene - 3.6.3-1022-0
so it seems 3.6.3. I saw it was running on an old version so did a opkg update and upgrade. Also changed the qml file to get rid of the Eneco subscription notice.
Did the manual reboot of the qt_gui. Some config not found;
[hbas]Config '<qt-gui>noDiscoByebye' not found, using default '0'
[hbas]Config '<qt-gui>configProvider' not found, using default '(null)'
[hbas]Config '<qt-gui>packageUuid' not found, using default 'eneco-001-245155:qt-gui'
...
[hbas]Config '<qt-gui>logProvider' not found, using default '(null)'
The following errors:
Loading language from file:///HCBv2/qml/apps/systray/lang
ERROR: Invalid language package url: "/HCBv2/qml/apps/systray/lang"
Loaded fullscreen file:///HCBv2/qml/apps/thermostat/TemperaturePresetScreen.qml > Screen_QMLTYPE_36(0x22fa658)
stub Widget init for file:///HCBv2/qml/apps/thermostat/TemperaturePresetScreen.qml
<Unknown File>: Error: Cannot assign [undefined] to QString
stub init for MenuItem file:///HCBv2/qml/apps/homescreen/DefaultMenuItem.qml
prominent widget registered: file:///HCBv2/qml/apps/thermostat/ThermostatSidePanel.qml
<Unknown File>: Error: Cannot assign [undefined] to QString
stub init for MenuItem file:///HCBv2/qml/apps/homescreen/DefaultMenuItem.qml
Loaded fullscreen file:///HCBv2/qml/apps/thermostat/VacationOverviewScreen.qml > VacationOverviewScreen_QMLTYPE_109(0x241ccf8)
stub Widget init for file:///HCBv2/qml/apps/thermostat/VacationOverviewScreen.qml
Loaded fullscreen file:///HCBv2/qml/apps/thermostat/ThermostatProgramScreen.qml > ThermostatProgramScreen_QMLTYPE_122(0x250e418)
<Unknown File>: Error: Cannot assign [undefined] to QUrl
...
Error loading ../../apps/internetSettings/InternetSettingsApp.qml: file:///HCBv2/qml/apps/internetSettings/InternetSettingsApp.qml:359 Expected token `;'
--> fixed the above error by removing a question mark in this qml which VI put there somehow. Im more a nano editor it seems. Will check tomorrow if the internet settings menu is available.
--UPDATE
This morning still no wifi setup. Did a factory reset and could enter wifi settings. So wiring problem solved. The annoying part of the home screen does still pop up constantly (even on boot)

Ewoud
Re: Toon as a domotica controller?
Looks like you still have part of the old flash gui lingering on your machine.
Please check /etc/inittab for a line starting with "flas" and comment it out.
Then check for a line starting with "qtqt" and make sure that it is not commented out.
Please check /etc/inittab for a line starting with "flas" and comment it out.
Then check for a line starting with "qtqt" and make sure that it is not commented out.
Re: Toon as a domotica controller?
Thanks!
Was indeed the line in the /etc/inittab. Commented it out and works perfectly now. Somehow this line was still active which results in this screen.
grts,
Ewoud
Was indeed the line in the /etc/inittab. Commented it out and works perfectly now. Somehow this line was still active which results in this screen.
grts,
Ewoud
Re: Toon as a domotica controller?
For people who have the toon measuring the P1 port and want the values in domoticz
This is a dzVents script I wrote.
I will also make one for a none P1 smart meter using the script of Hypermobile but then in dzVents
Replace your dev_* number you can find in http://***.***.***.***/hdrv_zwave?action=getDevices
And replace the IDX values at the buttom of the script for you P1 energy meter and P1 gas meter
This is a dzVents script I wrote.
I will also make one for a none P1 smart meter using the script of Hypermobile but then in dzVents
Replace your dev_* number you can find in http://***.***.***.***/hdrv_zwave?action=getDevices
And replace the IDX values at the buttom of the script for you P1 energy meter and P1 gas meter
Code: Select all
return {
-- 'active' controls if this entire script is considered or not
active = true, -- set to false to disable this script
logging = {
level = domoticz.LOG_INFO, -- Select one of LOG_INFO, LOG_DEBUG, LOG_ERROR, LOG_FORCE to override system log level
marker = "P1 toon"
},
on = {
timer = {
'every minute'
}
},
execute = function(domoticz)
local ToonIP = domoticz.variables('UV_ToonIP').value
--Replace all dev_2 for your number you can find @ http://%s/hdrv_zwave?action=getDevices
--Replace IDX number updateP1 and updateGas
-- Handle json
--local json = assert(loadfile "C:\\Program Files (x86)\\Domoticz\\scripts\\lua\\json.lua")() -- For Windows
--local json = assert(loadfile "/home/maes/domoticz/scripts/lua/JSON.lua")() -- For Linux
local json = assert(loadfile "/volume1/@appstore/domoticz/var/scripts/lua/JSON.lua")() -- For Synology
json.strictTypes = true
local handle2 = assert(io.popen(string.format('curl http://%s/hdrv_zwave?action=getDevices.json', ToonIP)))
local ZwaveInfo = handle2:read('*all')
handle2:close()
--na testen werkte dit. geen idee waarom
ZwaveInfo = string.gsub(ZwaveInfo, "dev_2.", "dev_2")
ZwaveInfo = string.gsub(ZwaveInfo, "dev_2:", "dev_2\":")
local jsonZwaveInfo = json:decode(ZwaveInfo)
if jsonZwaveInfo == nil then
return
end
--dev_2.1:CurrentGasQuantity
--Elec Hoog
--dev_2.3:CurrentElectricityFlow
--dev_2.3:CurrentElectricityQuantity
--Elec Laag
--dev_2.5:CurrentElectricityQuantity
--dev_2.5:CurrentElectricityFlow
-- remove the .
local CurrentGasQuantity = tonumber(jsonZwaveInfo["dev_21"]["CurrentGasQuantity"])
--print(CurrentGasQuantity .. " CurrentGasQuantity")
local CurrentElectricityQuantityHoog = tonumber(jsonZwaveInfo["dev_23"]["CurrentElectricityQuantity"])
--print(CurrentElectricityQuantityHoog .. "kWh CurrentElectricityQuantityHoog")
local CurrentElectricityFlowHoog = tonumber(jsonZwaveInfo["dev_23"]["CurrentElectricityFlow"])
--print(CurrentElectricityFlowHoog .. "W CurrentElectricityFlowHoog")
local CurrentElectricityQuantityLaag = tonumber(jsonZwaveInfo["dev_25"]["CurrentElectricityQuantity"])
--print(CurrentElectricityQuantityLaag .. "kWh CurrentElectricityQuantityLaag")
local CurrentElectricityFlowLaag = tonumber(jsonZwaveInfo["dev_25"]["CurrentElectricityFlow"])
--print(CurrentElectricityFlowLaag .. "W CurrentElectricityFlowLaag")
local totalPower = CurrentElectricityFlowHoog + CurrentElectricityFlowLaag
--print(totalPower .. "W totalPower")
--Elec opgewekt Laag
--dev_2.4:CurrentElectricityQuantity
--dev_2.4:CurrentElectricityFlow
--Elec opgewekt Laag
--dev_2.6:CurrentElectricityQuantity
--dev_2.6:CurrentElectricityFlow
local CurrentElectricityDeliveredLaag = tonumber(jsonZwaveInfo["dev_24"]["CurrentElectricityQuantity"])
--print(CurrentElectricityDeliveredLaag .. "kWh CurrentElectricityDeliveredLaag")
local CurrentElectricityDeliveredFlowLaag = tonumber(jsonZwaveInfo["dev_24"]["CurrentElectricityFlow"])
--print(CurrentElectricityDeliveredFlowLaag .. "W CurrentElectricityFlowLaag")
local CurrentElectricityDeliveredHoog = tonumber(jsonZwaveInfo["dev_26"]["CurrentElectricityQuantity"])
--print(CurrentElectricityDeliveredHoog .. "kWh CurrentElectricityDeliveredLaag")
local CurrentElectricityDeliveredFlowHoog = tonumber(jsonZwaveInfo["dev_26"]["CurrentElectricityFlow"])
--print(CurrentElectricityDeliveredFlowHoog .. "W CurrentElectricityFlowLaag")
local totalDeliveredPower = CurrentElectricityDeliveredFlowHoog + CurrentElectricityDeliveredFlowLaag
--print(totalDeliveredPower .. "W totalPower")
--USAGE1= energy usage meter tariff 1
--USAGE2= energy usage meter tariff 2
--RETURN1= energy return meter tariff 1
--RETURN2= energy return meter tariff 2
--CONS= actual usage power (Watt)
--PROD= actual return power (Watt)
--updateP1(usage1, usage2, return1, return2, cons, prod): Function. Updates the device. Supports command options.
domoticz.log('<font color="green">P1 from toon: ' .. CurrentElectricityQuantityLaag/1000 .. 'kwh USAGE1 | ' ..CurrentElectricityQuantityHoog/1000 .. 'kwh USAGE2 | ' .. CurrentElectricityDeliveredLaag/1000 .. 'kwh RETURN1 | ' .. CurrentElectricityDeliveredHoog/1000 .. 'kwh RETURN2 | ' .. totalPower .. 'w consumed | '.. totalDeliveredPower .. 'w produced', domoticz.LOG_INFO)
domoticz.devices(16).updateP1(CurrentElectricityQuantityLaag, CurrentElectricityQuantityHoog, CurrentElectricityDeliveredLaag, CurrentElectricityDeliveredHoog, totalPower, totalDeliveredPower)
domoticz.log('<font color="green">Gas from toon: ' .. CurrentGasQuantity/1000 .. 'm3', domoticz.LOG_INFO)
domoticz.devices(17).updateGas(CurrentGasQuantity)
end
}
Re: Toon as a domotica controller?
Hello,
I use an scrip for reading out the GAS and POWER from TOON to Domoticz that works super.
I see that you can put the GAS and POWER price in domoticz: go to setup > settings > Meters/Counters you will see the following fields: RFXMeter/Counter Dividers:
But for some how I don't see these prices in Domoticz does somebody know how I can see these prices in domoticz? or will this only with a direct P1 cable?
I see in Domoticz the daily GAS/POWER use..
I use an scrip for reading out the GAS and POWER from TOON to Domoticz that works super.
I see that you can put the GAS and POWER price in domoticz: go to setup > settings > Meters/Counters you will see the following fields: RFXMeter/Counter Dividers:
But for some how I don't see these prices in Domoticz does somebody know how I can see these prices in domoticz? or will this only with a direct P1 cable?
I see in Domoticz the daily GAS/POWER use..
Re: Toon as a domotica controller?
I want to suggest not using the Quantity counters from getDevices.json for the non P1 smart meter version (maybe also not for the P1 version).Eggybert wrote: I will also make one for a none P1 smart meter using the script of Hypermobile but then in dzVents
When rebooting Toon or restarting meter adapter (I think) the Quantity counters will reset to zero. This gives a high wrong value in Domoticz for that day.
Maybe beter using RRD like I did. Look here for an example for gas and electricity.
When rebooting Toon you don't get strange values in Domoticz.
-
- Member
- Posts: 76
- Joined: Sun Jan 14, 2018 5:12 pm
Re: Toon as a domotica controller?
We got a workaround for that; by saving the last Quantity in a User-Var.glsf91 wrote:I want to suggest not using the Quantity counters from getDevices.json for the non P1 smart meter version (maybe also not for the P1 version).Eggybert wrote: I will also make one for a none P1 smart meter using the script of Hypermobile but then in dzVents
When rebooting Toon or restarting meter adapter (I think) the Quantity counters will reset to zero. This gives a high wrong value in Domoticz for that day.
Maybe beter using RRD like I did. Look here for an example for gas and electricity.
When rebooting Toon you don't get strange values in Domoticz.
Re: Toon as a domotica controller?
I don't see the variable in the above script.Hypermobile wrote:
We got a workaround for that; by saving the last Quantity in a User-Var.
-
- Member
- Posts: 76
- Joined: Sun Jan 14, 2018 5:12 pm
Re: Toon as a domotica controller?
that the P1 Versionglsf91 wrote:I don't see the variable in the above script.Hypermobile wrote:
We got a workaround for that; by saving the last Quantity in a User-Var.
Non P1 needs a user-var
script ain't ready yet
Re: Toon as a domotica controller?
@glsf91
I use your scrip for my analog meter the GAS and POWER from TOON to Domoticz works super.
I also see in Domoticz you can add the price from your provider, do you know how I can show this part in Domoticz? so I have the GAS and POWER price in Toon.
I use your scrip for my analog meter the GAS and POWER from TOON to Domoticz works super.
I also see in Domoticz you can add the price from your provider, do you know how I can show this part in Domoticz? so I have the GAS and POWER price in Toon.
Re: Toon as a domotica controller?
Go to the graph of the GAS and Power graph device and click on the Report button.michel30 wrote:@glsf91
I use your scrip for my analog meter the GAS and POWER from TOON to Domoticz works super.
I also see in Domoticz you can add the price from your provider, do you know how I can show this part in Domoticz? so I have the GAS and POWER price in Toon.
Re: Toon as a domotica controller?


Thanks this works super, by the way thanks for the PHP scrip..
Regards,
Michel