MQTT door opener based on Sonoff

Hi Guys.

I’ve used a Sonoff SV to set up a door opener for my apartment door. And that works terrific. The only thing is, that I can’t get HA to recognise it as a door lock, but only as a light. The reason is, that the firmware (custom) on the Sonoff allows it to use emulated hue. and that is super fine, except for the fact that my system now thinks that it’s a light.

My question is, if someone here can help me figure out what to write in the payload and command topics etc.

I’ve attached a screenshot of the config on the Sonoff page as help.

Really appreciate it guys!

Thanks!

how did you define your sensor in HA?
If the only way to add it to HA is by hue emulation, you can then create a template cover or template switch based on that original sensor

This is screenshot from my HA config:

If you defined your lock as a lock, I don’t understand how HA recognises it as a light, unless you have discover enabled and you’re looking at a different entity…
if you click on <> in your menu, you should then be able to see if you have more than one lock and check the status of your lock.Frontdoor

I’m sorry I’m not familiar with locks yet so I might be missing something…

The problem is, that when I only have it as a lock, it won’t work. Doesn’t seem to connect to it.
So that’s why I re-enabled the Emulated Hue which gets auto discovered by HA. So the Light that is autodiscovered will be disabled as soon as I have it working with MQTT manually.

I think the problem is the Topics and ON/OFF statements

got it, then you indeed need to check your MQTT lock parameters. And check your case as HA is quite strict on case sensitive-ness.
Also set your log to debug, you’ll probably find something useful in it:

logger:
  default: debug