Code Monkey home page Code Monkey logo

Comments (15)

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024 1

Sorry, I phrased that question poorly. For example, if the press mode with a timer for 3 seconds is set in the app, then I send an on command on HomeKit, will the plugin/HomeKit know to show that the SwitchBot is off after the 3 seconds are over?

You can set the press timer, but I think the status is the same that in-press state and post-press state of the SwitchBot.

Does that mean that it will show as on in the Home app, even though the timer has turned it off?

I guess I will find out soon when my delivery arrives!

from homebridge-switchbot-for-mac.

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024

Would using the same MAC address for on and off on the current setup work?

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

If you want to use it with a single device, you can have the same address specified for on and off, but just specify the MAC address directly as shown below and it will work.
(Internally, it works by specifying the same MAC address for on and off.

https://github.com/zizi4n5/homebridge-switchbot-for-mac#control-one-switchbot

from homebridge-switchbot-for-mac.

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024

Thanks for your response. That makes sense. I have not not received my switchbot yet, it is arriving later today, but I wanted to understand the functionality of this plugin, but was confused by the reference to two devices in the Properties section on the readme.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

Thanks for your comment.
I feel it's hard to explain one device and two devices, so I'll add an image, etc. and improve it.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

Would it be possible to have single device on and off as shown in the screenshot, with a normal mode, and an add on mode. This would be useful for light switches.

There is no option to change the mode in the plugin.
So the SwitchBot device will work in the mode that is set SwitchBot app.
Try changing the mode of your device in the SwitchBot app.
https://www.switch-bot.com/bot

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

Press-hold Time can be set in the SwitchBot app too.

IMG_9485

from homebridge-switchbot-for-mac.

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024

That's good to know. I was unaware that it listens to the in app settings. My experience with other hardware such as the Broadlink RM is quite the opposite. The plugin usually has to set these things.

Would HomeKit know if the switchbot is on or off using that setting in the app?

I am currently looking at the code an attempting to convert it from a switch accessory to a lock accessory. I am hoping it will be simple enough.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

Would HomeKit know if the switchbot is on or off using that setting in the app?

HomeKit cannot know what settings you have in the app, but if you change the settings in the SwitchBot app, the SwitchBot device will reflect the changes.

Then, the SwitchBot device will behave according to the device's settings when HomeKit sends on or off.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

This plugin uses the node-switchbot's turnOn/turnOff methods. This method works according to the settings of the SwitchBot device.
https://github.com/futomi/node-switchbot#turnon-method

Then there's also the press/down/up methods, so it looks like I could add a set mode option to the plugin.
However, I'm not sure if this is a limitation of node-switchbot or the SwitchBot API, but node-switchbot does not support press timers.

from homebridge-switchbot-for-mac.

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024

Sorry, I phrased that question poorly. For example, if the press mode with a timer for 3 seconds is set in the app, then I send an on command on HomeKit, will the plugin/HomeKit know to show that the SwitchBot is off after the 3 seconds are over?

And as general point, can the plugin determine the state of the SwitchBot through the API?

from homebridge-switchbot-for-mac.

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024

Then there's also the press/down/up methods, so it looks like I could add a set mode option to the plugin.
However, I'm not sure if this is a limitation of node-switchbot or the SwitchBot API, but node-switchbot does not support press timers.

That's good to know. If I have the time, and once I get head around why it is still showing as a switch accessory after I changed all the relevant references to a lock accessory, I might look at implementing this so that the settings are not split between the app and the plugin.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

Sorry, I phrased that question poorly. For example, if the press mode with a timer for 3 seconds is set in the app, then I send an on command on HomeKit, will the plugin/HomeKit know to show that the SwitchBot is off after the 3 seconds are over?

You can set the press timer, but I think the status is the same that in-press state and post-press state of the SwitchBot.

And as general point, can the plugin determine the state of the SwitchBot through the API?

In the case of node-switchbot, the state of the SwitchBot is You can get it as Advertisement Data.
However, I don't know how to use it in detail because I don't use it.
https://github.com/futomi/node-switchbot#advertisement-data

from homebridge-switchbot-for-mac.

benjaminbogdanovic avatar benjaminbogdanovic commented on July 19, 2024

I have received my SwitchBot and it behaves as discussed. Would a timeout/timer for the state that is shown in HomeKit (on or off) be difficult to implement, so it can be matched with the timer in the app?

I have achieved this by using the ping feature, but setting an IP that will always be unreachable.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

There will be some unnecessary pings, but I think it's a no problem that way.

from homebridge-switchbot-for-mac.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.