Closed Gifford47 closed 3 years ago
Please, could you be so kind on completing the troubleshooting template in order to have more information so as to properly help you?
Remember to read the Contributing Guideline and Policy. Thanks.
See Docs for more information. See Chat for more user experience. See Community for forum. See Code of Conduct
The template is incomplete so I will be guessing. Are you using setoption19 1
? If so, that is MQTT DISCOVERY. For Home Assistant NATIVE Discovery (and the ability to use setoption114) you have to use setoption19 0
. Your entities will be automatically populated under INTEGRATIONS in Home Assistant.
sorry, i updated the template. yes, i am using setoption19 1. I need the option for openhab3, that the things will be created automatically. but like i described the switch topic is missed ...
Ok so you are using OpenHab and not Home Assistant!
setoption19 1 is MQTT DISCOVERY that can be used for OpenHab and others setoption19 0 is Home Assistant Discovery.
As the title said Home Assistant, I assume you were using Home Assistant. Ok, let me do some tests.
https://tasmota.github.io/docs/Home-Assistant/#supported-entities_1
To have switches discovered SwitchTopic must be set to a custom name and it will automatically start
to listen and publish using stat/%topic%/SWITCH<x> (binary sensor) or stat/%topic%/SWITCH<x>T (trigger) topics.
https://tasmota.github.io/docs/Home-Assistant/#supported-entities_1
To have switches discovered SwitchTopic must be set to a custom name and it will automatically start to listen and publish using stat/%topic%/SWITCH<x> (binary sensor) or stat/%topic%/SWITCH<x>T (trigger) topics.
This isn't working for me. I set a SwitchTopic door
, and did so19 (switch is SwitchMode1 15
), and still no binary sensor set in HA.
[edit] I am Using HomeAssistant. @ascillato and both so19 1
and so19 0
with native HA integration installed does NOT produce a Switch sensor entity in HA. I prefer to use so19 1
and wait for the tasmota integration to mature. its also easier to control which devices I setup in HA that way.
Switchmode 15 is not supported by the discovery since is an switchmode made just for MQTT messages and the discovery use its customized topic. As a test use another switchmode and please report.
Switchmode 15 is not supported by the discovery since is an switchmode made just for MQTT messages and the discovery use its customized topic. As a test use another switchmode and please report.
That worked, set to switchmode1 1
, however, setup a device named <tasmota_name>_switch1
Rather than using the SwitchTopic for the name.
Is there a way to name the switch and device type prior to enabling so19?
https://tasmota.github.io/docs/Home-Assistant/#supported-entities_1
To have switches discovered SwitchTopic must be set to a custom name and it will automatically start to listen and publish using stat/%topic%/SWITCH<x> (binary sensor) or stat/%topic%/SWITCH<x>T (trigger) topics.
thanks for the answer!
I have now set "switchtopic pir" and a switch channel is now automatically created in openhab. however, the D1 mini does not send a mqtt message as soon as the pir sensor value changes. no MQTT log appears in the tasmota log. I can't create a rule either, because I created the switch topic...
ok, now it works (i resetted the d1 mini and configured it new).
to use mqtt autodiscovery with switches in openhab you have to set the following:
"switchmode1 1" -> binary sensor (ON/OFF)
"switchtopic
I still have one question, though: by using switchtopic, i can no longer use a rule on the Switch#State trigger. however, i would like to "switch on" or "switch off" the switch (in my case the pir sensor) when it is not needed. how can i now use a rule to prevent the switch from sending its status every time?
There is a possible workaround but is a bit of a hit and miss:
on System#Boot do backlog switchtopic pir; delay 200; switchtopic 2 endon
And then use the switch JUST with a rule using ON SWITCH<x>#STATE=n
.
Pay attention to the delay value, since the discovery will be updated +/- 10 seconds after a full reboot. Also consider using a rule to manage the switches will introduce a little delay in action.
PROBLEM DESCRIPTION
The docs (HA Supported Entities) say that the auto discovery function also works for binary sensors, depending on switchmode and setoption114. However, I have connected a PIR to gpio5 on a Wemos D1 Mini and I do not get a homeassistant topic for automatic discovery.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Status 0
:TO REPRODUCE
You can configure a switch (160) and use it as binary sensor, using switchmode1 1. Detach switches from relays and send MQTT messages instead SetOption114 1. Also enable setoption19 1 .Restart and look into console to find homeassistant/* switch or binary_sensor auto discovery topic.
EXPECTED BEHAVIOUR
A auto discovery topic should be send to mqtt broker, like: _homeassistant/binarysensor/switch1/config = ...
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
a similar issue was created here: #10578
(Please, remember to close the issue when the problem has been addressed)