[V4] Sonoff Tasmota

Are you using the image of Gladys announced at the beginning of this topic? These changes are not yet integrated into the official beta

Wait a little longer so that these changes are integrated after their reviews, or you take the special tasmota image :wink:

Of course!

Once your SSL configuration is done on the MQTT broker side, you just need to put your MQTT URL in Gladys starting with « mqtts:// » (with the « s »)

Hello @AlexTrovato,
I don’t think anyone has tested it yet, but you can add the Sonoff Mini to your list. Do you need additional data?
I should soon receive a 4CH Pro and a 4CH if you want.

Oh, yes, I do :slight_smile: I’ve had one connected for several months now, and I think the 4CH has also been tested.

My mistake, I was still on the listing of your first post! Sorry ^^

I can’t edit the first post (or I don’t see how to do it) but it would indeed be interesting to inform about the new state of the sonoff tasmota part.

For information, the first place I look each time is in the documentation. Do you think it would be appropriate to include it there? Or a dedicated page? The same would apply to Xiaomi, Philips Hue, and surely others to come.

Send me what you want to add @AlexTrovato to your post in a private message, I will add it as I have admin rights.

@AlexTrovato That reminds me, you do participate a lot in the community. I’ve given you moderator rights, so now you can edit too :slight_smile:

Hello everyone!!

I don’t know if others have already managed to get an interface with Sonoff devices with multiple relays and to use them via scenarios, but since I needed these two points for my use, if anyone is interested, I can describe the manipulation to be done if you wish. This is a direct DB manipulation at the moment where I duplicate in the t_device table the desired multi-relay device with an ID incremented by 1 and a modification of the selector and the external_id. Then, all that’s left is to modify the device_id in the t_device_feature table according to those newly created. I took the opportunity to modify the category of all the Sonoff devices I want to control in the scenes to light instead of switch. This being said, this last point is only useful until the integration of other controls than « light » in the Scenes.

View of Tasmota Devices - 1 relay 4CH:

GIF Sonoff_4CH functional after device and device_feature changes in DB:

Sonoff_4CH New device

GIF Sonoff_4CH functional after device and device_feature changes in DB:

Sonoff_4CH Light Scene

This has led me to several reflections for @AlexTrovato or for any other Tasmota DEV:

  1. The Sonoff 4CH and 4CH-PRO (which also works for the DUAL of course) are intended to be installed in or near the electrical panel. Since they integrate 4 relays, it can happen regularly that they are used for several rooms, I will take my example with one of my Sonoff 4CH:
    • R1 = Bathroom Lighting,
    • R2 = Bathroom Cupboard Lighting,
    • R3 = Toilet Lighting,
    • R4 = Toilet Lobby Lighting.
      Currently, all the switches are integrated into 1 single device. Therefore, there is no possibility to put them in separate rooms. Would it be possible to create distinct devices at the integration of a Sonoff with multiple Switches? This would also solve the problem of the names displayed on the dashboard. It would be enough to integrate them by keeping the current device_feature but when in the mqtt message we see:
MQTT Broker
tele/tasmota_Sonoff_4CH_1/STATE {
  "Time":"2020-05-23T10:38:55",
  "Uptime":"1T21:40:37",
  "UptimeSec":164437,
  "Heap":26,
  "SleepMode":"Dynamic",
  "Sleep":50,
  "LoadAvg":19,
  "MqttCount":2,
  "POWER1":"OFF",
  "POWER2":"OFF",
  "POWER3":"OFF",
  "POWER4":"ON",
  "Wifi":{
    "AP":1,
    "SSId":" ",
    "BSSId":" ",
    "Channel":6,
    "RSSI":42,
    "Signal":-79,
    "LinkCount":2,
    "Downtime":"0T00:00:40"
  }
}

We retrieve the POWER numbers to create the devices with an identical number added to the selector and external_id of the device.

  1. I noticed when checking point 1, that in addition to the STATE, Tasmota sends the position of the switches (which are the push buttons of the module) via:
tele/tasmota_Sonoff_4CH_1/SENSOR {
"Time":"2020-05-23T10:38:55",
  "Switch1":"ON",
  "Switch2":"OFF",
  "Switch3":"OFF",
  "Switch4":"ON"
}

Indeed, on all my Sonoff modules (except the Mini which already have this option), I have soldered additional wires to be able to connect my physical switches and/or push buttons. This also gives the possibility on the Sonoff 4CH Pro to keep 2 physical buttons thanks to its integrated two-way possibility. Then, it is enough to manage in the Tasmota http page to define if it is a switch or a PB. At the same time, I thought why not integrate these as well as additional devices that would only be state devices feature. Personal example: With 1 Sonoff 4CH PRO, I could control 4 relays + 1, 2, 3 or 4 independent switches that could themselves launch scenes. Same for 1 Sonoff Basic that would control 1 lighting and next to it 1 push button that when pressed, does not directly control lighting but 1 night scene for example, which would play a scenario turning off all the lights if it is after 9 PM and which does another action if another time. In short, this would allow at low cost to use these modules for more things than they are intended for. Of course, this implies distinguishing the switches from the relays in Gladys.

Hopefully, I have been helpful, best regards.

Hello @Terdious,

Technically, I haven’t looked into it, but it should be possible. However, it might make the use more complex. We could try to think about this topic with @pierre-gilles: multi-room devices.

I had thought about integrating them, but it also makes the device more complex in Gladys, with information that is not necessarily useful.
That said, I can reconsider my position.
However, we risk seeing a « lot » of new « read-only » features for a device appear.
I also think that all Tasmota devices have a switch (with or without a physical button), which overloads the device in Gladys. I hadn’t found a way to identify the « native » buttons from the « added » buttons (same with the LEDs).

I’ll note this point and look into it when I have the chance.

Hello @AlexTrovato,

Great, thanks for your feedback! Indeed, I agree with your answers, there is a debate to be had, especially with Pierre-Gilles, before doing anything.
I take this opportunity to ask for your opinion on the following post. I prepared a dev to add the modification of category/type on the features pages, originally for Tasmota, but which would ultimately be useful for all services I think. I reused the same approach as the list for scene triggers with built-in dictionary search.

I don’t see the use case, a device by definition is a physical peripheral, it cannot be in two rooms at the same time.

This would be for the device connected to the electrical panel, a 4-switch device that controls both the kitchen light and the bedroom light.

Got it!

In my opinion, it must be several devices, I think it would be really too heavy in terms of data model to make multi-room devices… it will complicate the code everywhere.

In fact, the issue is more complicated than that. The 4CH and 4CH-Pro are often used, for example, to control 2 roller shutters with 2 switches per shutter. 1 up + 1 down. In this case, it involves 2 devices with 2 features each. The issue here is to be able to let the user choose their usage.

The use cases are numerous. This is actually its interesting side.

Hello,
I just integrated Tasmota in HTTP.
I had to rebuild the Tasmota service largely.

For those interested, a docker image is available: https://hub.docker.com/repository/docker/atrovato/gladys-tasmota-http

I look forward to your feedback.
Thank you.

So, do we have feedback?

Hello everyone!

Sorry @AlexTrovato, I’m not here to answer that. I think you’ll have more testers with the official launch, we’re a bit short on users for now :slight_smile:

Someone mentioned to me via email that it would be great if Gladys was visible in the Tasmota documentation on this page: Smart Home Integrations - Tasmota. This would help attract a population that uses Tasmota! We should propose a small PR :slight_smile: