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.

Moderators: leecollings, remb0

Post Reply
emontnemery
Posts: 38
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Tighter integration with Tasmota

Post by emontnemery »

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: 38
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by emontnemery »

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: 50
Joined: Monday 08 January 2018 2:30
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch »

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: 38
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by emontnemery »

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: 50
Joined: Monday 08 January 2018 2:30
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch »

Hi, yeah sounds very interesting. :-)

Greetings Fabi
emontnemery
Posts: 38
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by emontnemery »

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: 50
Joined: Monday 08 January 2018 2:30
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch »

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: 50
Joined: Monday 08 January 2018 2:30
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Contact:

Re: Tighter integration with Tasmota

Post by 0n370uch »

Short update: I upgraded my devices to version 5.11.1e today. So the test with your Sonoff integration start soon. :-)
diogoc
Posts: 2
Joined: Monday 30 July 2018 12:20
Target OS: -
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by diogoc »

Autodiscovery with tasmota on RGBW devices is not working.
Domoticz detects only the rgb colors.
There are plans to fix that?
chiefmaster81
Posts: 1
Joined: Tuesday 23 June 2020 14:55
Target OS: -
Domoticz version:
Contact:

Re: Tighter integration with Tasmota

Post by chiefmaster81 »

Hi, better tasmota integration would be great. Not sure if this is the correct topic, but I'll try it here...

I am managing tasmota switches via domoticz dummies with http requests and this works great except that the current status of the switch is never sure as it is not monitored continuesly. a simple script could change that...

I am not good at programming, but in bash something like this works:

pi@smarthome:~ $ ./status.sh BULB.fritz.box
{"Hostname":"BULB"} : {"POWER":"OFF"}
pi@smarthome:~ $ cat status.sh

DEVICEIP=$1
STATUS=$(curl http://$DEVICEIP/cm?cmnd=Power 2>/dev/null )
DEVICE=$(curl http://$DEVICEIP/cm?cmnd=Hostname 2>/dev/null )

echo "$DEVICE : $STATUS"

Can't be that difficult to integrate thin into existing dummy as http poll ? Perhaps only the device power state...

Meanings ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest