Page 1 of 1

Help with Blockly...

Posted: Friday 18 October 2024 8:59
by fjuppe
Hello,

I have tried to search for an answer but without success;

This Blockly block updates a parameter (0219) with fixed value = 100 and works OK. But I want to use an existing user variable instead of the fixed value in the URL. Is this possible in Blockly and what would I write as "val=" ???

Thanks a lot in advance!
Blockly.png
Blockly.png (15.59 KiB) Viewed 1599 times

Re: Help with Blockly...

Posted: Friday 18 October 2024 21:44
by solarboy
First create a new global variable in setup>user variables. Give it type "float". Then set it to 100 in Blockly using Logic>Set and Devices>User variables and choosing from the 4 options corresponding to the first letter of your variable.

Re: Help with Blockly...

Posted: Saturday 19 October 2024 10:25
by fjuppe
Hello,
Thank you "solarboy" for your reply. I already have a Blockly that updates the user variable. Now, what I want to do is use thatvariable as the value ("val=") in the http request but I dont know how to correctly format it....
/fjuppe

Re: Help with Blockly...

Posted: Saturday 19 October 2024 12:14
by BartSr
not a direct answer but I would advice to use dzVents being very flexible. And yes it has a learning curve .....

Re: Help with Blockly...

Posted: Monday 21 October 2024 14:12
by fjuppe
Hello,

I finally got dzVents to work. This is the code for setpoint to Husdata (heatpump interface). To set temperature, you must multiply with 10. To set 10 degrees, send 100. I dont check for same value because I dont use the timer....

Code: Select all

return {
    on = {
		devices = { 'Set Pool Temp' },
		--timer = { 'on every 2 minutes' }
	},
	execute = function(domoticz, device)
	    local setpoint = domoticz.devices('Set Pool Temp').setPoint
	    local NewParallel = (setpoint)*10
	    --local ActualParallel = tonumber(domoticz.devices('Parallel').state)

	    --if NewParallel/10 ~= ActualParallel then
	        domoticz.openURL('http://xxxx.tplinkdns.com:xx/api/set?idx=0219&val=' .. NewParallel)
	    --end
	    end
}

Re: Help with Blockly...

Posted: Monday 21 October 2024 14:31
by BartSr
happy it works now

once you know the basics of dzVents it's very easy and powerfull

Re: Help with Blockly...

Posted: Monday 21 October 2024 14:39
by fjuppe
Thank you for your push against dzVents…😃