Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebridge not updating current state #5

Closed
Ogge66 opened this issue Jan 9, 2022 · 9 comments
Closed

Homebridge not updating current state #5

Ogge66 opened this issue Jan 9, 2022 · 9 comments

Comments

@Ogge66
Copy link

Ogge66 commented Jan 9, 2022

First of all, thank you for a great plugin. Very easy to add all of my devices, naming, index etc.

But something I haven’t figured out is how to sync the device statuses. Lets say I use the wall switch or have a timer set up in the tasmota web interface then it wont change the status in HomeKit. I can see in the logs that MQTT is sending from the tasmota device but nothing is received in homebridge.

Is this a known bug/limitation or am I just missing something obvious?

Thank you!

@AtomBaf
Copy link
Owner

AtomBaf commented Jan 9, 2022

Thanks for your feedback.
As you're clearly pointing out, this is a more like a limitation I haven't figure out. You can see for instance (here)[https://github.com/AtomBaf/homebridge-mqtt-tasmota/blob/master/src/switch.js#L19] that an assumption is made on the initial state of the system when the first connection is made.

However, I don't have in my own setup the typical thing you're describing: a timer. What exactly tasmota is publishing when a timer-based event is triggered ? If you can send the mqtt message log, I would modify the code to handle this message as well. It seems easy to applicate. I can do it on my own, but not sure if it would help if you have a different version/setup/device on your own tasmota.

Thx again for your help in understanding these things.

@AtomBaf AtomBaf closed this as completed Jan 9, 2022
@AtomBaf AtomBaf reopened this Jan 9, 2022
@AtomBaf
Copy link
Owner

AtomBaf commented Jan 9, 2022

FYI, I tested some timer on my own setup and the state of the tasmota switch is correctly reflected in homebridge/homekit after a timer event. Did I miss something about your query?

@Ogge66
Copy link
Author

Ogge66 commented Jan 9, 2022

Hi,

Thank you for the quick reply, much appreciated!
The main issue is that it doesn’t update when I use the physical wall switch. The timers I can just program in the home-app instead of in the tasmota web-interface

In the Homebridge-log it doesn't detect my action when I press the button which I can see in the Tasmota-console. Here I press off in the home-app and then I use the wall switch button (Sonoff T1 touch) to turn the lights back on. But in Homebridge it doesn't detect that action.

Homebridge log:
[1/9/2022, 6:57:35 PM] [Tvättstugan Belysning korridor] Set Power: false
[1/9/2022, 6:57:35 PM] [Tvättstugan Belysning korridor] Updated CurrentPower: OFF

Tasmota console log:
18:57:35 MQT: stat/tasmota_FF740F/RESULT = {"POWER":"OFF"}
18:57:35 MQT: stat/tasmota_FF740F/POWER = OFF
18:57:46 MQT: stat/tasmota_FF740F/RESULT = {"POWER":"ON"}
18:57:46 MQT: stat/tasmota_FF740F/POWER = ON

I need to log on to my Synology to find the logs for the timers I had earlier today to verify that it's acting the same or if I'm misstaken.

Thank you!

Please let me know if I can contribute to your support in any way.

@AtomBaf
Copy link
Owner

AtomBaf commented Jan 11, 2022

I maybe won't be very helpful, but as far as I can see, the code is explicitly listening to the stat/XXX/RESULT topic.

this.mqttResultTopic = config['resultTopic'] || 'stat/' + this.mqttTopic + '/RESULT'

Any message from this topic is then handled and parsed to update the state of the accessory.
if (message.hasOwnProperty('POWER' + this.index)) {

Maybe one hint: do you have in your accessory definition an index set? As you can see in the code, if this is true, then the parsing function will expect POWER1 instead of POWER to be published in the mqtt message by the tasmota device. I did some trials on effectively tasmota is publishing a POWER message and not POWER1 if the device is a simple switch. This could be the cause of your problem which I would solve easily.

Let me know your config, and if you can grap it, all the MQTT messages published during your test case.

@AtomBaf
Copy link
Owner

AtomBaf commented Jan 11, 2022

Finally got it and fixed it.
Thx for your patience and feedback.

@Ogge66
Copy link
Author

Ogge66 commented Jan 11, 2022 via email

@Ogge66
Copy link
Author

Ogge66 commented Jan 11, 2022 via email

@AtomBaf
Copy link
Owner

AtomBaf commented Jan 11, 2022

Thx Oscar, this is not necessary to donate, but if you'd like to, this is much appreciated.
Updated to version 0.4.6

@Ogge66
Copy link
Author

Ogge66 commented Jan 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants