diff --git a/Home-Assistant.md b/Home-Assistant.md index b3ed0c1c..ae8a9478 100644 --- a/Home-Assistant.md +++ b/Home-Assistant.md @@ -57,9 +57,28 @@ Automatic discovery is currently supported for: - In Tasmota console type the following command: `SetOption30 1` - Use Hass [light.switch](https://www.home-assistant.io/components/light.switch/) component - Sensor - Announced as Home Assistant `sensor` -- Button - Announced as Home Assistant `binary sensor` +- Button - Announced as Home Assistant `binary sensor` + - As normal behavior a button will automatically turn off after `one second` - Switch - Announced as Home Assistant `binary sensor` +Starting from release 6.7.1 to have `buttons` and `switches` discovered `switchtopic` or `buttontopic` must be set to default value `0` and they will listen to `sonoff/stat/RESULT` topic. +```yaml +MQT: sonoff/stat/RESULT = {"BUTTON1":"TOGGLE"} +MQT: sonoff/stat/RESULT = {"POWER":"ON"} +MQT: sonoff/stat/POWER = ON +``` +This option leave to the user the ability to get a more granular control over entities, for example with a simple rule: +```yaml +Rule1 ON Button1#STATE DO Var1 %value% ENDON +``` +With the rule enabled , on button press the result will be +```yaml +RUL: BUTTON1#STATE performs "var1 2" +MQT: sonoff/stat/RESULT = {"Var1":"2"} +MQT: sonoff/stat/RESULT = {"BUTTON1":"TOGGLE"} +``` +and the relay will NOT be switched. + For other type of devices, e.g iFan02, example entries for configuration.yaml is available in [[Home Assistant - Manual Config|Home-Assistant-‐-Manual-Config]] On each Tasmota device which should be automatically discovered by Hass, enter the following commands in the web console:\ @@ -76,18 +95,23 @@ You cannot use custom defined topics while `Setoption19` is on since it will alw ## Setup Tasmota devices through Home Assistant All automatically discovered entities will show up under:\ Configuration -> Integrations -> Configured -> MQTT\ -The entities are grouped by hardware, example for a Sonoff T1 2CH: +The entities are grouped by hardware, example for a Sonoff Basic: -![image](https://user-images.githubusercontent.com/14281572/50019947-bf27b400-ffd4-11e8-98b5-4bd5ef848cf1.png) +![image](https://user-images.githubusercontent.com/7702766/67961116-082b2b80-fbda-11e9-8552-ce2bd85d2a3f.png) By clicking on one of the entities, and then on the cog wheel, name in Hass and `entity_id` can be customized: ![image](https://user-images.githubusercontent.com/14281572/50020005-f4cc9d00-ffd4-11e8-9881-b04ed6e85468.png) + ![image](https://user-images.githubusercontent.com/14281572/50020040-09109a00-ffd5-11e8-8026-74293753783a.png) Note1: Lights currently show up under "Entities without devices", this will be fixed in Hass 0.85 [#19013](https://github.com/home-assistant/home-assistant/pull/19013)\ Note2: After changing `entity_id` Hass must be restarted, this will be fixed in Hass 0.85 [#19414](https://github.com/home-assistant/home-assistant/pull/19414) +For every device discovered with `setoption19` an informative sensor will be created automatically: + +![image](https://user-images.githubusercontent.com/7702766/67961156-124d2a00-fbda-11e9-8f41-19b3e98867b2.png) + ## Tips ### Tip: Sync power state