Keep push button pressed in Domoticz
Moderator: leecollings
Keep push button pressed in Domoticz
Hi guys,
I have a VEVOR diesel heater with a 4 button chinese remote control... When i want to switch the heater on or off i have te keep the button on that remote pressed for 3 seconds before the heater responds...
The remote control is 433 Mhz and i have learned the remote control buttons to push on/off buttons in Domoticz using RFXCOM ...
How do i keep the buttons pressed in domoticz UI or script ??
I have a VEVOR diesel heater with a 4 button chinese remote control... When i want to switch the heater on or off i have te keep the button on that remote pressed for 3 seconds before the heater responds...
The remote control is 433 Mhz and i have learned the remote control buttons to push on/off buttons in Domoticz using RFXCOM ...
How do i keep the buttons pressed in domoticz UI or script ??
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Keep push button pressed in Domoticz
In a dzvents script use the .switchOn().forSec(3) command.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 504
- Joined: Sunday 01 November 2015 22:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Twente
- Contact:
Re: Keep push button pressed in Domoticz
and put that in a loop.
Here's another to try:
Code: Select all
return {
active = true,
on = {
devices = { 'JouwSchakelaar' }
},
execute = function(domoticz, device)
if device.state == 'On' then
local startTime = os.time()
while os.time() - startTime < 3 do
domoticz.devices('JouwSchakelaar').switchOn()
end
domoticz.devices('JouwSchakelaar').switchOff()
end
end
}
Bugs bug me.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Keep push button pressed in Domoticz
Or use device setting off delay? But I am always confused on that setting. You better try it out.
Edit: should indeed work. From wiki
Edit: should indeed work. From wiki
The Off delay on switch device causes a device to switch Off with a delay of the set amount of seconds after the device switched to On
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 504
- Joined: Sunday 01 November 2015 22:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Twente
- Contact:
Re: Keep push button pressed in Domoticz
Don't try the loop, it'll end up into an endless loop.
Walters'solution domoticz.devices('YourSwitch').switchOn.forSec(3) is the one.
Walters'solution domoticz.devices('YourSwitch').switchOn.forSec(3) is the one.
Bugs bug me.
-
- Posts: 49
- Joined: Wednesday 03 May 2023 10:12
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Keep push button pressed in Domoticz
I actually think your approach is the correct one, though it requires additional thinking. The challenge here is not to switch on and then switch off after some amount of time, but to keep sending the "on" signal for 3 seconds.
Valuable information in this case is whether you actually need to keep the key on the remote pressed for three seconds or that it will also work if you press it three (or more) times in rapid succession. Note that if you add the repeated "on" signal to the actual linked switch that this will also eliminate the hold for 3 seconds on the original remote as Domoticz will trigger on the first signal sent and take over to complete the sequence. You may actually find that switching the device on with the original remote no longer functions because of interference between the two signals.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Keep push button pressed in Domoticz
For RF long press signal you better check this topic: viewtopic.php?t=41057
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Re: Keep push button pressed in Domoticz
U were right on both, the hold didn't work and i got an endless loop so i created a dummy on/off switch that sends the push on button repeatedly and and the push off repeatedly...PierreT wrote: ↑Saturday 30 November 2024 11:41I actually think your approach is the correct one, though it requires additional thinking. The challenge here is not to switch on and then switch off after some amount of time, but to keep sending the "on" signal for 3 seconds.
Valuable information in this case is whether you actually need to keep the key on the remote pressed for three seconds or that it will also work if you press it three (or more) times in rapid succession. Note that if you add the repeated "on" signal to the actual linked switch that this will also eliminate the hold for 3 seconds on the original remote as Domoticz will trigger on the first signal sent and take over to complete the sequence. You may actually find that switching the device on with the original remote no longer functions because of interference between the two signals.
The three seconds loop will however create >100 switchon commands (got errors on scripts too many lines and lasting too long), so i adjusted the scripts to send approx 40 rf commands ....
Works fine now...
With a rf temp sensor and a dummy setpoint i have working thermostate on the diesel heating and "SIRI" is controlling the temperature
Thanks to all for your valuable feedback !
-
- Posts: 504
- Joined: Sunday 01 November 2015 22:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Twente
- Contact:
Re: Keep push button pressed in Domoticz
@Korrel can you show us your script?
Plus I guess that just the 40 switchOn() commands will give you the same result.
Plus I guess that just the 40 switchOn() commands will give you the same result.
Bugs bug me.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Keep push button pressed in Domoticz
waltervl wrote: ↑Saturday 30 November 2024 15:58 For RF long press signal you better check this topic: viewtopic.php?t=41057
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Re: Keep push button pressed in Domoticz
The code :
Code: Select all
return {
on = {
devices = {
'Tuinhuisje - Verwarming'
}
},
execute = function(domoticz, device)
if device.state == 'On' then
local startTime = os.time()
while os.time() - startTime < 2 do
domoticz.devices('Tuinhuisje - Verwarming Vevor - Aan').switchOn()
end
end
if device.state == 'Off' then
local startTime = os.time()
while os.time() - startTime < 2 do
domoticz.devices('Tuinhuisje - Verwarming Vevor - Uit').switchOn()
end
end
end
}
The result...
Code: Select all
2024-12-03 15:47:57.838 Status: User: bas (IP: 192.168.1.76) initiated a switch command (12402/Tuinhuisje - Verwarming/On)
2024-12-03 15:47:57.897 Status: dzVents: Info: Handling events for: "Tuinhuisje - Verwarming", value: "On"
2024-12-03 15:47:57.897 Status: dzVents: Info: ------ Start internal script: Tuinhuisje - Verwarming Vevor: Device: "Tuinhuisje - Verwarming (Dummy)", Index: 12402
2024-12-03 15:47:58.994 RFXCOM: Temp + Humidity (Zwembadwater)
2024-12-03 15:47:59.096 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.172 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.247 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.322 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.397 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.472 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.547 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.623 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.698 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:47:59.004 Status: dzVents: Info: ------ Finished Tuinhuisje - Verwarming Vevor
2024-12-03 15:48:00.075 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.149 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.224 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.305 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.375 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.450 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.526 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.600 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.676 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.751 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.826 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.901 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:00.977 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.052 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.127 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.211 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.279 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.354 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.430 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.505 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.581 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.656 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.733 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.807 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.882 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:01.958 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.033 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.107 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.184 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.259 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.336 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.456 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.517 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.591 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.667 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.769 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.846 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.919 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:02.995 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.070 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.145 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.220 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.295 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.370 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.446 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.521 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.596 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.671 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.746 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.821 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.897 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:03.972 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.050 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.125 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.201 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.276 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.348 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.427 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.505 RFXCOM: Lighting 4 (Tuinhuisje - Verwarming Vevor - Aan)
2024-12-03 15:48:04.414 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
but still the heater is not always picking up the on command :S
Re: Keep push button pressed in Domoticz
waltervl wrote: ↑Sunday 01 December 2024 0:25waltervl wrote: ↑Saturday 30 November 2024 15:58 For RF long press signal you better check this topic: viewtopic.php?t=41057
I read it, which part of this topic is a key to the solution ?
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Keep push button pressed in Domoticz
The part were the rfxcom expert (and owner) b_weijenberg advises to use the RAW data. See also the topic he refered to viewtopic.php?t=27260
Sending 40 commands in 3 seconds is potentially not OK for Domoticz (depending on your hardware). It could miss some events now.
Sending 40 commands in 3 seconds is potentially not OK for Domoticz (depending on your hardware). It could miss some events now.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 1 guest