Page 1 of 1

TasmotaMQTT: Community Brainstorming

PostPosted: Sun Mar 28, 2021 2:06 pm
by aaronlionsheep
It sounds like there is a desire to have a ShellyMQTT-like experience with Tasmota devices in Indigo. I feel that ShellyMQTT is reaching a mature state with the range of Shelly models supported and the features that the plugin provides.

If TasmotaMQTT were to be developed, I would intend to mimic the same development/plugin style as ShellyMQTT. This would be a plugin that requires the use of FlyingDiver's MQTTConnector to handle MQTT broker communication, and TasmotaMQTT would handle model-specific message communication.

With the amount of "supported devices" listed on the Tasmota firmware page, I would most likely take the approach of supporting a specific device when requested rather than trying to implement them all. It appears that Tasmota has good MQTT documentation, so I should be able to support almost any device without needing access to them (like I have done with most Shelly devices). Worst case is that someone with access to a device would need to supply some additional information and be willing to work with me on ensuring the device works as expected.

With all that being said, I would like to get some feedback before deciding to tackle this.

    1. What are some devices you have, or want to have, that should have initial supported?
    2. Are there any must-have features that should be carried over from ShellyMQTT?
    3. Are there any "please change how this works" from ShellyMQTT that should be reworked for TasmotaMQTT?
    4. What form of Tasmota support would be expected? Could support be limited to post-Tasmota installation (with some basic help/guides for getting Tasmota and MQTT configured)?

Feedback is welcomed so I can get a sense of what this plugin might look like and how big the desire is for another ShellyMQTT-like plugin.

Thanks,
Aaron

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Sun Mar 28, 2021 2:36 pm
by FlyingDiver
As you go through this process, if you need any different capabilities in the Connector, just let me know.

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Sun Mar 28, 2021 4:04 pm
by Colly
Great news Aaron,
I think your approach as outlined is fair due to the large amount of devices available. I've a UK plug on the way as referenced by Clive. I've also a 2 gang switch ordered. https://www.athom.tech/blank-1/smart-dimmer. ShellyMQTT works well for me and at this time I've no additional feature requests as such.

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Mon Mar 29, 2021 12:01 pm
by CliveS
Colly wrote:
Great news Aaron,
I think your approach as outlined is fair due to the large amount of devices available. I've a UK plug on the way as referenced by Clive. I've also a 2 gang switch ordered. https://www.athom.tech/blank-1/smart-dimmer. ShellyMQTT works well for me and at this time I've no additional feature requests as such.


I would love to fit those wall switches but have no neutral to the switch so have just recieved 1,3,and 4 button wireless wall switches, not Tasmota but plain Zigbee, but using Jon’s alpha of his Hubitat Elevation plugin they work flawlessly in Indigo.

The great thing about Hubitat is that it has drivers for almost everything and that is where Indigo is let down as we have to wait so long to get a new device included.

Hence why I would love to see a Tasmota or MQTT plugin to allow so many new devices added that allows drivers to be added almost from day 1.

I realise that Joe has built the Shims plugin but I find that confusing at times.

So my wish list would be a Shelly\Tasmota\MQTT all in one plugin but I know that would be impractical.

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Mon Mar 29, 2021 2:05 pm
by aaronlionsheep
I think it would be really great if any Tasmota Device could be supported in the plugin on Day 1 (or version 1.0). I have been reading the Tasmota Developer docs and I noticed that all Tasmota devices have their own "Template" or device definition. That is how so many devices are supported with a generic Tasmota firmware. It looks like this device definition is able to be extracted from a given device, so that has given me an idea.

Rather than creating individual Indigo definitions for each device, I could attempt :shock: to decode the Tasmota definition and determine that "device X has 2 inputs, one relay, and a DS18B20 temperature sensor". I will have to experiment with dynamically creating Indigo devices and the DeviceFactory/grouping api in Indigo.

Code: Select all
{"NAME":"Example Template","GPIO":[416,0,418,0,417,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45}


Each of these 16-bit GPIO values indicates some characteristic (a switch, relay, sensor, ...) on a GPIO pin, but just knowing what characteristics a device has should be enough for a plugin.

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Sat May 01, 2021 10:06 am
by CliveS
Aaron, did you decide if it was viable to use the Template and if a plugin was worth it?

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Sun May 02, 2021 4:20 pm
by aaronlionsheep
CliveS wrote:
Aaron, did you decide if it was viable to use the Template and if a plugin was worth it?


Hi Clive,

I have actually been playing around with Tasmota in order to get familiar with it again. I may have got sidetracked (slightly) as I started with a WeMos and a temperature probe. Then I purchased some bare ESP8266 modules and have them running on some breadboards with Tasmota. I may or may not also have custom designed PCB's set to be delivered this week :roll:

Some preliminary findings:

1. I give credit to Shelly for designing something that runs on this small CR123 batteries for an extended period of time. Right now it looks like my record is about 9 days with a device that reports once per minute on 3-AA batteries. Although, this was on a breadboard, so results might be better on a PCB (should some be delivered...)
2. I played around with the Tasmota templates because I have 4 sensors running and creating a template saved me the hassle of configuring the pins correctly each time. I'm still not confident with this as THE solution though.

I have 4 breadboard sensors running with the exact same template and base hardware configuration. They all use i2c sensors, so the template will only indicate that i2c is "supported" by my device. I have no way of determine WHAT is connected over the interface (or even how many things are connected). For example, I have BME280 sensors and SHT3X sensors that I can swap between each device. The BME280 reports air pressure, temperature and humidity and Tasmota correctly picks this up, but there is no way of knowing this from the template data.

With 4 devices reporting 3-4 data points each, that was a lot of shims devices to setup (I know I could have used the multi-state key feature, but apparently I overlooked that). So I definitely feel how having a Tasmota plugin would be helpful. Right now I'm leaning more towards how I designed the Shelly plugin. I can't possibly support each device out of the box, but I could add support for devices as they are requested. This would allow me, or any contributor, to make sure each device is fully supported rather than guessing with the templates.

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Mon May 03, 2021 7:17 am
by CliveS
Sounds like you are "enjoying" playing with Tasmota, would be great to have a reliable low cost Humidity, pressure and temp sensor.

So if you go for the "how I designed the Shelly plugin" approach what would you need to turn that into a template ?

If you need to test it I have several Tasmota UK plugs that I have given up on trying to get Shims to reliably indicate On/Off status so let me know if you need a beta tester.

Re: TasmotaMQTT: Community Brainstorming

PostPosted: Mon May 03, 2021 2:53 pm
by aaronlionsheep
CliveS wrote:
Sounds like you are "enjoying" playing with Tasmota, would be great to have a reliable low cost Humidity, pressure and temp sensor.

So if you go for the "how I designed the Shelly plugin" approach what would you need to turn that into a template ?

If you need to test it I have several Tasmota UK plugs that I have given up on trying to get Shims to reliably indicate On/Off status so let me know if you need a beta tester.


The "Shelly Approach" would be a plugin that utilizes MQTTConnector to satisfy all my MQTT needs, and then the plugin handles all of the Tasmota-specific logic. That includes the Tasmota device discovery, common MQTT message structure, and the like. There would be a single "Device Definition" python file for each supported Tasmota device which contains all the Indigo functions for updating Indigo device states, responding to triggers, and sending there on/off commands.

Right now the hold-up is for determining the method for representing these Tasmota device in Indigo. I'm not 100% pleased with my parent/child association from ShellyMQTT, and I want to keep experimenting with dynamically creating some Device Factory devices.


As for my sensor, the rough final size with batteries is looking to be 50mm (W) x 60mm (L) x ~40mm (H). A sensor reporting once every 5 minutes and then going into deep sleep looks like it can last for almost 45 days on 3xAA batteries. I am hoping the power consumption decreases once it moves off of breadboards. There is no reason that they couldn't be powered from a 5v power source though.