Tighter integration with Tasmota

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.
Post Reply
emontnemery
Posts: 75
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Tighter integration with Tasmota

Post by emontnemery » Tuesday 12 December 2017 19:31

I'm using a number of Tasmota flashed devices together with Domoticz. This works pretty well, but there are a couple of missing things:
  1. No error detection due to the use of "dummy device" in Domoticz
    This can (for example) be fixed by updating the existing Domoticz MQTT integration to also send actuator commands instead of just sending status updates or by a Tasmota plugin for Domoticz. Updating the existing Domoticz MQTT integration is pretty straight forward, and I have a very basic implementation working.
  2. Auto discovery, several manual steps are needed in both Domoticz and Tasmota when a new Tasmota device is added (create a dummy device of the right type, setup the Tasmota to listen to that idx, etc)
    For this a Tasmota plugin understanding the Tasmota MQTT commands would be necassry
So, I was thinking about either extend the existing Domoticz MQTT integration to also send actuator commands, or implement a Tasmota HW plugin.
It would be great to get some suggestions here from others who use Tasmota together with Domoticz as well as Domoticz developers before starting the work.

emontnemery
Posts: 75
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by emontnemery » Thursday 21 December 2017 21:06

Some progress has been made:
  • Basic MQTT support has been added to the Python plugin framework, but it's not quite ready for submitting yet, discussion ongoing with Dnpwwo about how to fit MQTT nicely into the plugin framework
  • A prototype Domoticz plugin which does
    • Basic auto discovery of Tasmota-flashed devices
    • Domoticz state synced with the state of the remote device

0n370uch
Posts: 22
Joined: Monday 08 January 2018 3:30
Target OS: Raspberry Pi
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch » Monday 15 January 2018 4:29

Hi, one step forward:

https://github.com/arendst/Sonoff-Tasmota/pull/1604

One problem: Domoticz send a battery 255 and rssi 12 with a dummy switch on/off command. Is there a solution to remove these parameters?

Greetings Fabi

emontnemery
Posts: 75
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by emontnemery » Friday 19 January 2018 22:27

In my view, the problem is really that dummy switches + built-in MQTT support is not a complete solution for controlling remote HW.
- The only command sent out by Domoticz is basically a status update command.
- It's not possible to send a command to Domoticz to inform about a status update.

I did actually implement a simple Tasmota plugin for Domoticz which is using the newly available MQTT support in the plugin framework.
Would you be interested in giving it a try?

0n370uch
Posts: 22
Joined: Monday 08 January 2018 3:30
Target OS: Raspberry Pi
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch » Friday 19 January 2018 22:33

Hi, yeah sounds very interesting. :-)

Greetings Fabi

emontnemery
Posts: 75
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by emontnemery » Sunday 21 January 2018 14:30

OK, I pushed my current working version here: https://github.com/emontnemery/domoticz_mqtt_discovery
This is work in progress, please let me know if it's working or not.

Features:
  • Switch and dimmer devices will be automatically found and added to Domoticz database
  • State in Domoticz in synchronized with device state unlike with "Dummy hardware"
  • Vcc reported by Tasmota in stat/TELE is stored in "BatteryLevel", but I don't think it's very useful.. Maybe would be better to store as text such that it shows in Data column?
  • RSSI reported by Tasmota in stat/TELE is stored in "SignalLevel", but does not show up in WebUI. I've not debugged this.
Prerequisites:
  • Domoticz must be from Jan19 or newer (must include PR #2071)
  • Sonoff devices must be flashed with 5.11.1c or newer (must include support for home-assistant style MQTT discovery)
  • Sonoff devices must have option 19 set to 1 (setoption19 1)
  • Sonoff devices must be connected to MQTT server, and must have individual topics (by default all devices topic will be set to sonoff, this will not work)
  • Sonoff fulltopic should be reasonable, for example "tasmota/%topic%/%prefix%/"
Instructions:

0n370uch
Posts: 22
Joined: Monday 08 January 2018 3:30
Target OS: Raspberry Pi
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch » Monday 22 January 2018 15:36

Oh wow... nice work. I will test it this week :-). First I wanna clone my sd card to easly go back if something runs wrong ...

Greetings Fabi

0n370uch
Posts: 22
Joined: Monday 08 January 2018 3:30
Target OS: Raspberry Pi
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch » Thursday 25 January 2018 17:24

Short update: I upgraded my devices to version 5.11.1e today. So the test with your Sonoff integration start soon. :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest