[Solved] Get temperature from domoticz to display it

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
manubis_sanchez
Normal user
Posts: 3
Joined: 02 Feb 2020, 15:32

[Solved] Get temperature from domoticz to display it

#1 Post by manubis_sanchez » 02 Feb 2020, 15:45

Hello,
My Domoticz server have a weather device wich give me the outside temperature (from internet). I want to get this value from my domoticz server to ESPeasy to display it on a LCD screen.
I think I have to create a dummy device on ESPeasy and use a rule to feed it... but I don't know how exactly.
Could you help me please ? Thanks,

Manubis
Last edited by manubis_sanchez on 04 Feb 2020, 10:53, edited 1 time in total.

User avatar
enesbcs
Normal user
Posts: 473
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: Get temperature from domoticz to display it

#2 Post by enesbcs » 02 Feb 2020, 22:35

manubis_sanchez wrote:
02 Feb 2020, 15:45
I think I have to create a dummy device on ESPeasy and use a rule to feed it... but I don't know how exactly.
For example eventvalue:
https://www.letscontrolit.com/wiki/inde ... alue.25.29

manubis_sanchez
Normal user
Posts: 3
Joined: 02 Feb 2020, 15:32

Re: Get temperature from domoticz to display it

#3 Post by manubis_sanchez » 03 Feb 2020, 20:07

Thank you ! I find the rule to update my device.

The answer :

Code: Select all

on tempext do
  TaskValueSet,3,1,%eventvalue%
endon
Now I have to find how to send it from Domoticz with the correct value. I think I have to use dzvents... If someone can help me on this =)

User avatar
enesbcs
Normal user
Posts: 473
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: Get temperature from domoticz to display it

#4 Post by enesbcs » 03 Feb 2020, 20:15

manubis_sanchez wrote:
03 Feb 2020, 20:07
Now I have to find how to send it from Domoticz with the correct value. I think I have to use dzvents... If someone can help me on this =)
Either LUA or dzVents can be used. Sensor values can be appended as strings.

dzVents:
--------
local url = 'http://10.0.0.99/control?cmd=tempext,20'
domoticz.openURL(url)

LUA:
----
commandArray = {}
commandArray['OpenURL'] = 'http://10.0.0.99/control?cmd=tempext,20'
return commandArray

manubis_sanchez
Normal user
Posts: 3
Joined: 02 Feb 2020, 15:32

Re: Get temperature from domoticz to display it

#5 Post by manubis_sanchez » 03 Feb 2020, 22:15

Here's my code but it don't work :

Code: Select all

return {
	on = {
		timer = { 'every minute' }, -- for testing
		httpResponses = { 'trigger'	}
	},
	execute = function(domoticz, item)
		if (item.isTimer) then
			domoticz.openURL({
			 url = 'http://192.168.1.xx/control?cmd=event,tempext=14',
			 method = 'GET',
			 callback = 'trigger'
			})
		end

		if (item.isHTTPResponse) then

			if (item.statusCode == 200) then
				domoticz.log('URL sent', domoticz.LOG_ERROR) -- for testing too
				end
			else
				domoticz.log('There was a problem handling the request', domoticz.LOG_ERROR)
				domoticz.log(item, domoticz.LOG_ERROR)
			end
	end
}
I don't know how to be sure the http request is really sent.

Edit : I found a way. I use Data Push - HTTP in the Domoticz menu and it works perfectly (It send the data when the value change so it's perfect !)

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests