Feature request - Toggle command for domoticz
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 11
- Joined: 21 Jan 2016, 22:28
Feature request - Toggle command for domoticz
Is there someone who can add the Toggle function (for example as checkbox for sensors and switches?) It is possible to use this option (describe on) http://www.esp8266.nu/forum/viewtopic.php?f=2&t=36 but this is very slow.If you can use this directly from the ESP from every input it is much faster than the option described on the previous topic (when you add it can you do it also for the supported input chips).
Re: Feature request - Toggle command for domoticz
If you mean Toggle for Domoticz try this but Im not sure, i did not make test, but you can try and share result.
in folder ESPEasy_R78\Source\ESPEasy file _C001.ino find:
and change to:
next in folder ESPEasy_R78\Source\ESPEasy file _C002.ino find:
change to:
If im not wrong , instead ON and OFF you will have Toggle
in folder ESPEasy_R78\Source\ESPEasy file _C001.ino find:
Code: Select all
case SENSOR_TYPE_SWITCH:
url = F("/json.htm?type=command¶m=switchlight&idx=");
url += event->idx;
url += F("&switchcmd=");
if (UserVar[event->BaseVarIndex] == 0)
url += "Off";
else
url += "On";
break;
Code: Select all
case SENSOR_TYPE_SWITCH:
url = F("/json.htm?type=command¶m=switchlight&idx=");
url += event->idx;
url += F("&switchcmd=");
if (UserVar[event->BaseVarIndex] == 0)
url += "Toggle";
else
url += "Toggle";
break;
Code: Select all
case SENSOR_TYPE_SWITCH:
root["command"] = "switchlight";
if (UserVar[event->BaseVarIndex] == 0)
root["switchcmd"] = "Off";
else
root["switchcmd"] = "On";
break;
Code: Select all
case SENSOR_TYPE_SWITCH:
root["command"] = "switchlight";
if (UserVar[event->BaseVarIndex] == 0)
root["switchcmd"] = "Toggle";
else
root["switchcmd"] = "Toggle";
break;
Who is online
Users browsing this forum: No registered users and 1 guest