Page 1 of 1

Help me? Idea, add or sub text with push buttons

Posted: Tuesday 09 November 2021 11:55
by Thuis
Hello, could some one help me with an idea i have?

Sorry i just do not know if it is possible, but like to ask if it is and how it could be done.

I want to read out a text device.

To init the text device i want to use a push button called "init".
When init is true, the text device goes to 20. (degrees)

Say i have a push button (temp+), when i push it, i want that text device to add one.
And say i have another push button (temp-), when i push it, i want the text device to sub one.

But i have no clue how to do this in domoticz lua or dzventz.

Im trying though:
Spoiler: show
-- Text for temp up

if push_Plus and init then
textdevice = initwaarde+1 elseif
push_Plus then
textdevice = textdevice+1
end

-- Text for temp down

if push_Min and init then
textdevice = initwaarde-1 elseif
push_Min then
textdevice = textdevice-1
end
Some help would be very nice, and thanks in advance.

Re: Help me? Idea, add or sub text with push buttons

Posted: Thursday 11 November 2021 13:02
by Thuis
Thanks but no thanks, figured it out, using a counter instead of a textdevice.

Close topic, thank you.

Re: Help me? Idea, add or sub text with push buttons

Posted: Thursday 11 November 2021 13:17
by user4563
Hi,

Can you please post the code to help others that may come across the same situation?

Re: Help me? Idea, add or sub text with push buttons

Posted: Thursday 11 November 2021 13:26
by waltervl
Well, for the same use case I would have used a Thermostat Setpoint device. There is a build in up/down button on it. So no need to use 2 extra buttons to set a temp higher or lower.
https://www.domoticz.com/wiki/Dummy_for ... t_Setpoint