Toon Energy Readings on Domoticz Topic is solved

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Toon Energy Readings on Domoticz

Post by gielie »

marktn wrote:Maybe a good wiki is an idea? I see a lot in this post. But don´t know where to start.

send from tapatalk app.
Start with the basics, how to read out Toon and create a switch.
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
MatthijsPH
Posts: 15
Joined: Friday 01 May 2015 19:27
Target OS: Linux
Domoticz version: 3.5305
Location: The Netherlands
Contact:

Re: Toon Energy Readings on Domoticz

Post by MatthijsPH »

gielie wrote: Could you post the complete code and the name of your switches so I can compare.
my script "script_variable_verwarming.lua" looks like this:

Code: Select all

local toonState = 'varToonState'
local toonScene = 'varToonScene'
local toonSwitch= 'toonScenes'

commandArray = {}
if uservariablechanged[toonState] then	
	if uservariables[toonState] == 0 then 
	   commandArray['Variable:' .. toonScene] = tostring('Comfort')
	   commandArray[toonSwitch]='Set Level 40'
	   print('Toon ingesteld op scene Comfort')
	elseif uservariables[toonState] == 1 then
	   commandArray['Variable:' .. toonScene] = tostring('Thuis')
	   commandArray[toonSwitch]='Set Level 30'
	   print('Toon ingesteld op scene Thuis')
	elseif uservariables[toonState] == 2 then 
	   commandArray['Variable:' .. toonScene] = tostring('Slapen')
	   commandArray[toonSwitch]='Set Level 20'
	   print('Toon ingesteld op scene Slapen')
	elseif uservariables[toonState] == 3 then 
	   commandArray['Variable:' .. toonScene] = tostring('Weg')
	   commandArray[toonSwitch]='Set Level 10'
	   print('Toon ingesteld op scene Weg')
    	elseif uservariables[toonState] == 4 then
	   commandArray['Variable:' .. toonScene] = tostring('Overig')
	   commandArray[toonSwitch]='Set Level 0'
	   print('Toon ingesteld op scene Overig')
	end		
end	

return commandArray
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

gielie wrote:
Its not working, what is wrong?

Could you post the complete code and the name of your switches so I can compare.

Sorry for my delay... I didn't post the full script in the previous post because i thought it was kinda easy to figure it out. I am just starting with lua and wanted the script to be cofigurable so anyone can use it...

so here it is:

Code: Select all

-- script_time_toonselector.lua
-- Reads the Toon Thermostat Setpoint Temperature and updates the
-- selector in Domoticz to represent the current Active State.
-- Off scene is an option, leave it out if not needed.
-- Action commands wil not be executed.

commandArray = {}

-- Settings: Configure as desired

-- Name of the switch with the temperature setpoint.
ThermostatSetPointName = 'Room Setpoint'

-- Temperature SetPoints. 
HomeSetPoint = '20.50'   
ComfortSetPoint = '21.00'
SleepSetPoint = '19.00'
AwaySetPoint = '17.50' 
OffSetPoint = '6.00' --optional

-- Name of the selector for Toon
ToonSelector = 'Toon scenes'

-- Name of the levels in the selector
HomeLevel = 'Home'
ComfortLevel = 'Comfort'
SleepLevel = 'Sleep'
AwayLevel = 'Away'
OffLevel = 'Off' --optional

-- Values from each level name
HomeLevelValue = '30'
ComfortLevelValue = '40'
SleepLevelValue = '20'
AwayLevelValue = '10'
OffLevelValue = '0' --optional

-- End of settings

-- Toon Thermostat SetPoint:
ThermostatSetPoint = otherdevices_svalues[ThermostatSetPointName]

if (ThermostatSetPoint == HomeSetPoint) then
        --print("SetPoint equals to Home");
		if (otherdevices[ToonSelector] ~= HomeLevel) then
		print("Updating '" .. ToonSelector .. "' selector to '" .. HomeLevel .. "'")
		commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..HomeLevelValue
		end
		
elseif (ThermostatSetPoint == ComfortSetPoint) then
        --print("SetPoint equals to Comfort");
		if (otherdevices[ToonSelector] ~= ComfortLevel) then
		print("Updating '" .. ToonSelector .. "' selector to '" .. ComfortLevel .. "'")
		commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..ComfortLevelValue
		end
		
elseif (ThermostatSetPoint == SleepSetPoint) then
        --print("SetPoint equals to Sleep");
		if (otherdevices[ToonSelector] ~= 'Sleep') then
		print("Updating '" .. ToonSelector .. "' selector to '" .. SleepLevel .. "'")
		commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..SleepLevelValue
		end
		
elseif (ThermostatSetPoint == AwaySetPoint) then
        --print("SetPoint equals to Away");
		if (otherdevices[ToonSelector] ~= 'Away') then
		print("Updating '" .. ToonSelector .. "' selector to '" .. AwayLevel .. "'")
		commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..AwayLevelValue
		end

-- Optional		
elseif (ThermostatSetPoint == OffSetPoint) then
        --print("SetPoint equals to Off");
		if (otherdevices[ToonSelector] ~= 'Off') then
		print("Updating '" .. ToonSelector .. "' selector to '" .. OffLevel .. "'")
		commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..OffLevelValue
		end
end

return commandArray
Just configure settings to yours... This script reads from the Toon setpoint

Screenshot:
Image
marcoheijkoop
Posts: 4
Joined: Sunday 30 August 2015 22:18
Target OS: NAS (Synology & others)
Domoticz version: 2.4031
Location: Rotterdam, The Netherlands
Contact:

Re: Toon Energy Readings on Domoticz

Post by marcoheijkoop »

marcoheijkoop wrote:I'm getting this error when following above steps

Code: Select all

Traceback (most recent call last):
  File "/usr/local/domoticz/var/scripts/toon2domoticz.py", line 33, in <module>
    state = toon.get_program_state()
  File "/usr/lib/python2.7/site-packages/Toon.py", line 108, in get_program_state
    self.retrieve_toon_state()
  File "/usr/lib/python2.7/site-packages/Toon.py", line 72, in retrieve_toon_state
    raise Exception('Incomplete response')
Exception: Incomplete response
Still can't figure out what is wrong. If i check the line it looks likes i didn't get any response from Toon.
But i can't figure out why. If i login on Toon op Afstand everything looks fine
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

Just edited the wiki for Toon

http://www.domoticz.com/wiki/Toon
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Toon Energy Readings on Domoticz

Post by marktn »

kurniawan77 wrote:Just edited the wiki for Toon

http://www.domoticz.com/wiki/Toon
Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.

Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0

I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!

What is going wrong?
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: RE: Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

marktn wrote:
kurniawan77 wrote:Just edited the wiki for Toon

http://www.domoticz.com/wiki/Toon
Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.

Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0

I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!

What is going wrong?
I get that error once in a while too. It's just eneco's crap server. They go down sometimes...
Just got one btw...

Image
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: RE: Re: Toon Energy Readings on Domoticz

Post by marktn »

kurniawan77 wrote:
marktn wrote:
kurniawan77 wrote:Just edited the wiki for Toon

http://www.domoticz.com/wiki/Toon
Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.

Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0

I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!

What is going wrong?
I get that error once in a while too. It's just eneco's crap server. They go down sometimes...
Just got one btw...

Image
Thanks! But it also doensn't switch. When i paste the link in my browsers it works, only not in domoticz with a virtual switch
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

marktn wrote:
kurniawan77 wrote:
marktn wrote:
Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.

Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0

I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!

What is going wrong?
I get that error once in a while too. It's just eneco's crap server. They go down sometimes...
Just got one btw...

Image
Thanks! But it also doensn't switch. When i paste the link in my browsers it works, only not in domoticz with a virtual switch
That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by marktn »

kurniawan77 wrote:
marktn wrote:
kurniawan77 wrote: I get that error once in a while too. It's just eneco's crap server. They go down sometimes...
Just got one btw...

Image
Thanks! But it also doensn't switch. When i paste the link in my browsers it works, only not in domoticz with a virtual switch
That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.

I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

Why is your idx in the last post 3901 and in this one 4305?


marktn wrote:
kurniawan77 wrote: That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.

I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
[/quote]
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by marktn »

https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?


kurniawan77 wrote:Why is your idx in the last post 3901 and in this one 4305?


marktn wrote:
kurniawan77 wrote: That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.

I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
[/quote]
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

marktn wrote:https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?


kurniawan77 wrote:Why is your idx in the last post 3901 and in this one 4305?


marktn wrote:

I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
Yep, that level 30 home
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

Is your selector protected?
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by marktn »

kurniawan77 wrote:
marktn wrote:https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?


kurniawan77 wrote:Why is your idx in the last post 3901 and in this one 4305?


Yep, that level 30 home
Any other ideas to get it work? I can give you access to domoticz!?

send from tapatalk app.
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

marktn wrote:
kurniawan77 wrote:
marktn wrote:https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?


Yep, that level 30 home
Any other ideas to get it work? I can give you access to domoticz!?

send from tapatalk app.
I could give it a try... Beloof niks
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by marktn »

kurniawan77 wrote:
marktn wrote:
kurniawan77 wrote: Yep, that level 30 home
Any other ideas to get it work? I can give you access to domoticz!?

send from tapatalk app.
I could give it a try... Beloof niks

See PM
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kurniawan77
Posts: 46
Joined: Wednesday 21 January 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz

Post by kurniawan77 »

marktn wrote:
kurniawan77 wrote:
marktn wrote: Any other ideas to get it work? I can give you access to domoticz!?

send from tapatalk app.
I could give it a try... Beloof niks

See PM
Nailed it!!! Issue solved by configuring your local IP addresses in settings (no username and password)Image
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Toon Energy Readings on Domoticz

Post by marktn »

Thanks for helping!

send from tapatalk app.
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Toon Energy Readings on Domoticz

Post by gielie »

kurniawan77 wrote:
gielie wrote:
Its not working, what is wrong?

Could you post the complete code and the name of your switches so I can compare.

Sorry for my delay... I didn't post the full script in the previous post because i thought it was kinda easy to figure it out. I am just starting with lua and wanted the script to be cofigurable so anyone can use it...

so here it is:
Great thanks, i finaly got it working.
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest