I know I am going to be ashamed of how incompetent I am once this is solved, but I have an issue that my cover is not showing up as an entity when I use your code above. The shelly1 is working fine in the app, and the reed switch is showing the status in the app.
Now, when I listen for the topic in the MQTT integration its showing up with the following code:
shellies/shelly-garage/input/0
Message 0 received on shellies/shelly-garage/input/0 at 6:55:
0
When I open the garage door the input changes to 1. Also, if I just try to add a binary sensor for the reed switch its simply not showing up as an entity.
Did you change the name of your shelly to shelly-garage? Did you set the button type to detached?
By default, the device’s MQTT ID is <shellymodel>-<deviceid> , for example shelly1-B929CC . The MQTT ID can be changed via the mqtt_id parameter in /settings.
Button Type: Detached Switch (Only the Shelly 1 can separate the switch from the relay.)
Get it working with MQTT first before you add it to HomeAssistant. I did my first testing with the Shelly on my bench. Use software such as MQTT Explorer to watch the topics and messages. Send a message to activate the relay and you will hear it click. Use a wire across the input and verify the input topic changes. Your sensor may be normally open or normally closed. Test it so you know if open is 0 or 1. Once it works “on the bench”, then add it to HomeAssistant.
I used this and it works great in Home Assistant. Thanks!
Is anyone using it with HomeKit? I’ve found that the config here mostly work, but Siri will issue a “cover close” command even if the door is already closed. This of course results in the door opening. Not what I want. I assume that means some additional logic needs to be added somewhere in HA (since HomeKit is super inflexible). Something like “close_action: <if door is closed ; do nothing ; else ; close the door >”
Yup, I had the same exact issue. The workaround is to create a script that checks the status of the door before triggering an action. Mine checks to see if the door is opened or closed and if it’s already closed it does nothing.
Got two question for you all. So i got the Shelly1 in yesterday and was messing around with it. I think mine is broken. Issue #1: First the shelly app shows it needs to be updated. Its got the most up to date firmware, but keeps saying it needs to be updated. When I click update it then says you have the most up to date firmware. Issue #2: I see the sensor on the shelly app, but when I bring it back into home assistant i only see 1 entity (which is the button). Any help would be greatly appreciated.
Not all methods of Shelly 1 access will present both the switch and sensor. The Home Assistant Shelly app does not seemto allow access to both the switch and sensor. I used MQTT. I recently found someone else who uses ESPHome. Either will work.
MQTT requires a broker (server). Clients connect and send or receive messages from queues. The MQTT broker can run on the same machine running Home Assistant or a separate machine. I use mosquitto which is available for any Linux server and many other platforms as well.
As I said earlier in this thread, test MQTT and your device without Home Assistant to verify the functions. Use software such as MQTT Explorer to watch the topics and messages. Get it working “on the bench”.
Ok, I have a similar issue as Mac. I have Mosquitto as my broker and I used MQTT Explorer to see input 0 work fine “on the bench”. Now how do get the Shelly integration to add this as an entity?
Did you have to modify the python script? I tried this method too, but it did not seem to work . I am not that familiar with python and expected that to be the problem.
Your next step is to use Home Assistant instructions to customize how it will control your garage door. For example the position_topic: is where you set input 0.
I am missing something simple. I have run bieniu’s shellies discovery script and I do see the topics created in MQTT Explorer. Issue is still that the HA entities are not created. I’ve restarted HA twice per the instructions.
I have been attempting this project, I have everything working as expected in home assistant and today went to install the Shelly and Reed switch on the garage door. I have the I port contracted to the Red+ port on the opener, the the O on the white - port. When I trip the relay either in HA or in the Shelly web interface, I hear the click, and the down arrow light will flash a few times on the garage opener.
You all see anything obvious in this setup I may be missing?
Your garage door opener may not work with a simple switch. If the controller at the end of the wiring has a learn button, it probably sends some required code sequence. Test by shorting the wires into the controller ports. If that doesn’t open the door, you need more than closing the circuit.