homebridge-sonoff-basic-espeasy icon indicating copy to clipboard operation
homebridge-sonoff-basic-espeasy copied to clipboard

On/Of state issue

Open oleyek opened this issue 7 years ago • 8 comments

The status On/Off in Homebridge is not changing when I switch on/off pressing physical button or change state through http request.

oleyek avatar Jan 07 '18 14:01 oleyek

The state is only updated when you open the Home-App. It's not possible to receive state changes from a device without a platform plugin containing a server to push changes to. Correct me if I'm wrong.

pbksol avatar Jan 10 '18 20:01 pbksol

Yes, you're right. Maybe the better way to do this will be using MQTT like in plugin for homebridge for Tasmota firmware?

oleyek avatar Jan 10 '18 22:01 oleyek

I'm pretty sure it's impossible to changing when pressing physical button. If you know way, share with us.

erokoder avatar Jan 11 '18 08:01 erokoder

It's possible with MQTT, because when state is changed switch sending notification to MQTT broker.

oleyek avatar Jan 11 '18 09:01 oleyek

Could you explain what way sonoff with MQTT know that wall switch change status?

erokoder avatar Jan 12 '18 16:01 erokoder

It's nothing related to this project. But… You need an additional device, a "MQTT broker" and you have to configure it to communicate with each MQTT device. You can do a search on Google on how to configure this things. Spoiler: It's a bag of hurts. The way it works? The same as with Homebridge Platforms. MQTT devices report their state to their broker. This state is then pushed to Homebridge and HomeKit. You can configure MQTT with ESPeasy, there's no Tasmota firmware necessary. But that's a completely different story…

pbksol avatar Jan 12 '18 16:01 pbksol

I'm not sure you understand me. I have this scheme wiring: http://prntscr.com/i0qrfb

Test case: State OFF on HomeAPP.

  1. Turn on Lights with my HomeAPP on R1 relay, and Sonoff PRO swithc reley and Light ON. State ON on HomeAPP.
  2. When I pressing physical key "WALL SWITHC" Disconnect Electric Cricuit and turn off Light. State continue ON on HomeAPP.

How to change state, which device to purchase?

erokoder avatar Jan 15 '18 14:01 erokoder

I do understand. You have two own Homebridge Repos so I assume that you do know how the basics of homebridge work and what the differences between accessories and platforms are. That difference is the reason why the state does not change when you press the physical button. If you want to change that behaviour you need either a homebridge platform or some server infrastructure for the Sonoff to report (push) state changes to which then needs to be integrated into HomeKit/-Bridge. One option is MQTT or something similar – how to configure this is something to ask the MQTT-people, ESPeasy offers support for it by default. But there's no way to change the behaviour of this plugin (as long as it's an accessory) to detect the changes. The state of an accessory is only updated when HomeKit polls for it's state and there's no way for an accessory to initiate the update by itself.

pbksol avatar Jan 17 '18 13:01 pbksol