NorthernMan54 / homebridge-tasmota

Plugin for Tasmota devices leveraging Home Assistant auto discovery
Apache License 2.0
35 stars 9 forks source link

enhancement to using detached switch #41

Closed lcslouis closed 2 years ago

lcslouis commented 2 years ago

Is your feature request related to a problem? Please describe: I have a mini R2 with tasmoto firmware i have the switch in detacted mode so that Switch acts independently of the relay

Describe the solution you'd like: easy way to set device as 2 devices

Describe alternatives you've considered: Node Red with some kind of dummy switch, a wifi switch that has no relay

NorthernMan54 commented 2 years ago

Can you share your tasmota device config ?

lcslouis commented 2 years ago

hombridge-tasmota config { "name": "Tasmota", "mqttHost": "127.0.0.1", "cleanup": 24, "debug": true, "history": true, "historyInterval": 1, "filterAllow": [ "homeassistant/switch/", "homeassistant/sensor/", "tele/mini1/SENSOR" ], "effects": true, "override": { "293408_sensor": { "device_class": "motion", "name": "Switch" } }, "platform": "Tasmota" }

tasmota config dump output.json.txt

NorthernMan54 commented 2 years ago

I just need the config or template you used when configuring your device. I want to apply the same config to an esp8266 I have sitting here, and see what it looks like.

lcslouis commented 2 years ago

{"NAME":"Sonoff Mini R2","GPIO":[32,0,0,0,160,0,0,0,224,320,0,0,1,0],"FLAG":0,"BASE":1}

ran command SwitchMode 15

NorthernMan54 commented 2 years ago

So I spent a bit of time trying to figure this out, then I had an ah ha moment

If you add a virtual relay on an unused GPIO pin aka GPIO5 and wire it as Relay 2, and change the button to control Relay 2, you will have two switches in HomeKit, the first one would be the real relay, and the second would mimic the button state.

When you make the Tasmota config changes, first remove it from HomeKit with a setoption19 0 make your changes, then setoption19 1. This allows you to properly name the second switch under Configuration->Other->Friendly Name 2

Screen Shot 2021-12-23 at 2 39 59 PM