arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.16k stars 4.8k forks source link

Toggle naming #2875

Closed almostlunatic closed 6 years ago

almostlunatic commented 6 years ago

Make sure these boxes are checked [x] before submitting your issue - Thank you!

Hello, I use a Sonoff Basic for manipulating the blinds. For the other members of the family, I would like to rename the buttons Toggle 2, 3, 4 as Up, Down, Stop. I can't find the right place for it, can you help me?

Frogmore42 commented 6 years ago

Your request is not clear. If you have physical switches, you can label them however you wish. If you are expecting your family to use the system via their phones, you probably should have one of the home automation solutions or make a dashboard in NodeRED. I don't believe you can rename them for mqtt or the web interface, but neither of those are family friendly.

almostlunatic commented 6 years ago

Thank you! I was not accurate, that's true. I want to rename the labels of the blue buttons on the Tasmotas web page "Toggle 1" up to "Toggle 4" that is confusing for the others. When I'll return from travelling, I for sure will set up Domoticz or Node-RED, but for now a little change in the HTML code would be a solution.

reloxx13 commented 6 years ago

wont be so easy as you think. xdrv_02_webserver.ino around line 550

for (byte idx = 1; idx <= devices_present; idx++) {
        snprintf_P(stemp, sizeof(stemp), PSTR(" %d"), idx);
        snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("<td style='width:%d%'><button style=\"line-height:5.0rem\" onclick='la(\"?o=%d\");'>%s%s</button></td>"),
          100 / devices_present, idx, (devices_present < 5) ? D_BUTTON_TOGGLE : "", (devices_present > 1) ? stemp : "");
        page += mqtt_data;
      }
almostlunatic commented 6 years ago

Thanks, reloxx13! I don't have that file, only webserver.ino, but the code you refer exist there. I found it myself too an hour ago. :)

reloxx13 commented 6 years ago

you should upgrade your code than :p

Markkyboy commented 5 years ago

I also wanted to rename the 'Toggle' button. The line of code presented by reloxx13 is actually not the right place to make the edit, at least not in my case (sonoff basic module).

xdrv_01_webserver.ino at line: 314 - which originally looks like this;

const char HTTP_DEVICE_CONTROL[] PROGMEM = "<td style='width:%d%%'><button onclick='la(\"?o=%d\");'>%s%s</button></td>"

edited to look like this (look for 'On/Off');

const char HTTP_DEVICE_CONTROL[] PROGMEM = "<td style='width:%d%%'><button onclick='la(\"?o=%d\");'>On/Off</button></td>"

End result (with other changes);

screenshot_20190227_002

BigGeorgeTx commented 3 years ago

It may be that it was a feature added after this thread, or perhaps I misunderstand something, but it seems like the Tasmota WebButton On/Off would solve this problem. I came across this thread while search for an answer. The WebButton command did for me what I wanted to do (change the labels on buttons 1 to 3 for a 3 outlet smart plug).

meingraham commented 3 years ago

Yes, WebButton is a newer command that came along quite a long time after this issue.

BigGeorgeTx commented 3 years ago

I thought that might be the case. I wanted to leave a comment so if someone else stumbled across this thread, they would know where to look. Thanks for letting me know.