10
submitted 2 months ago* (last edited 2 months ago) by Nimrod@lemm.ee to c/homeassistant@lemmy.world

I have a Shelly dimmer 2 behind one of the switches in my kitchen running Tasmota. There are two switch inputs on the Dimmer module, so I have it behind a 2 gang wall box with two physical switches. Each switch is connected to one of the switch inputs of the Shelly.

I've set the switches to be independent of each other, so I can potentially use the different switches for different triggers. Switch one is configured as a push button switch and dims my kitchen lights. Switch two does nothing. I desire to have switch2 trigger my dining room lights, so after some digging I discovered that I can use MQTT to make Home Assistant do stuff! Perfect.

But not perfect. I set up an automation to listen for this devices' MQTT topic "tele/lights_kitchen/SENSOR" and when the switch is flipped either up or down, my mosquitto broker hears that topic, and it just toggles my lights! I thought I had it all figured out. But what I didn't notice at first, is that the Shelly Dimmer pings out an MQTT status every so often, even if no switches are flipped. So my dining room lights have been going on and off all afternoon!

There is some data in the payload of the MQTT that I think should be able to fix my issue, but I'm having trouble conceptualizing how.

The payload contains a key:value pair {"Switch2":"ON"} or "OFF". So I'm hoping I can use a change in that value as a toggle. Because it's operating as a 3 way switch, I don't care if the actual value is ON or OFF, I just want to know if it's changed. Do I need some sort of helper that keeps track? This seems like something MQTT would be good at, but I can't find a good example to steal the right config from. I thought maybe I could use two triggers, one for each state, but that makes a huge complicated set of logic that needs to be added, and I really feel like there should be a more elegant way to handle this.

Any assistance?

you are viewing a single comment's thread
view the rest of the comments
[-] Nimrod@lemm.ee 1 points 2 months ago* (last edited 2 months ago)

Edit: I remember why - I wanted to use a single button dimming option, and as far as I can tell, there wasn't that option in Shelly natively. There isn't really a "native" version of this in Tasmota, but someone had already laid out the method to do such a thing with rules and whatnot within the Tasmota console. But after tinkering with it all this morning, I think I busted it beyond repair, so I might give the native Shelly a try!

Mostly because I'm lazy. This device was set up before Shelly made it so easy to run offline versions of the native firmware. And I've got a handful of devices already running Tasmota, so I'm just resistant to change.

this post was submitted on 29 Aug 2024
10 points (100.0% liked)

homeassistant

11921 readers
39 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS