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

Moderator: leecollings

Post Reply
User avatar
Thuis
Posts: 281
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

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

Post 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.
If you can not handle a computer, you buy a Mac. If you can not handle domotica, you use Homeassistant!
User avatar
Thuis
Posts: 281
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

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

Post by Thuis »

Thanks but no thanks, figured it out, using a counter instead of a textdevice.

Close topic, thank you.
If you can not handle a computer, you buy a Mac. If you can not handle domotica, you use Homeassistant!
User avatar
user4563
Posts: 114
Joined: Tuesday 19 October 2021 17:24
Target OS: Linux
Domoticz version: 2025.2
Contact:

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

Post by user4563 »

Hi,

Can you please post the code to help others that may come across the same situation?
ODroid H4+ / Ubuntu server 24.04 LTS
Aeotec Z-Stick Gen5+
ZWave-JS-UI / Mosquitto MQTT
Domoticz for Android
Domoticz Scenes add-on in Kodi
User avatar
waltervl
Posts: 6678
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

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

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest