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

Couldn't plain inputs be counted as devices_present? #4422

Closed onkelbeh closed 5 years ago

onkelbeh commented 5 years ago

Afaik you have to configure an output, even if it's only a dummy for every input line to be counted. This limits your input lines for example on a NodeMCU with an ESP12 to half the physical GPIO’s you have. Why can’t plain inputs be counted as devices, at least for the generic module?

As a workaround, i manually set devices_present after the count routines in GpioInit(), as an example on 6.3.0.12 i simply set devices_present = 8; in line 2541. This allows me to used nearly twice the amount of lines on an ESP8622-12, so i could connect 8 wall switches to a single Amica NodeMCU.

img_2832w

bildschirmfoto 2018-11-24 um 08 13 55 bildschirmfoto 2018-11-24 um 08 13 30

Some could say to use ESPEasy for your inputs, but many sensor implementations i use are managed way better and more reliable on tasmota (e.g IRremote, mqtt, mqtt/telemetry, DS18B20, MagicHome).

My wish would be either a change in the count routine, to count a Switch or a button like a relay, or a SetOption to override devices_present without the need to recompile.

ascillato commented 5 years ago

Hi, you don't need to add dummy relays. You can add just the inputs you need.

Please check the examples at rules in the wiki

ascillato commented 5 years ago

I use a setup very similar to the one you have posted and works fine without need to modify anything.

The only thing is that you have to define rules for the input switches in order to tell Tasmota what you want to do.

Settings up as you posted, is taken by Tasmota as a ladder switch by default. So all the switches will control that one relay only.

So, using Tasmota beyond that default, you need to use rules to tell Tasmota what fo you want to do.

You can make any behaviour you want for any of the switches like sending mqtt messages, powering relay of other devices, turning timers on or off, etc etc.

ascillato2 commented 5 years ago

If you need more help, please just ask here or in the Tasmota Chat. Thanks

Support Information

See Wiki for more information. See Chat for more user experience.