Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

How does command reach my LAN?

  • 15-12-2024 01:56AM
    #1
    Registered Users, Registered Users 2 Posts: 884 ✭✭✭


    Recently fitted one of these and it works a treat!

    https://www.amazon.co.uk/dp/B07PYWFKDY?ref=ppx_yo2ov_dt_b_fed_asin_title

    My question is though, how does the ON command reach the smart switch when I'm away from home? I expected that the HBN app would open a port on he router but when I check this doesn't appear to be the case.

    Any info appreciated.



Comments

  • Registered Users, Registered Users 2 Posts: 6,293 ✭✭✭CalamariFritti


    Possibly dynamic dns?



  • Registered Users, Registered Users 2 Posts: 11,611 ✭✭✭✭LambshankRedemption


    You press "on" on your mobile app. This instruction goes to the HBN cloud. I don't know for sure, but I assume, the HBN timer connects out to the HBN cloud periodically, maybe every 5 minutes and checks for any command requests. If it sees an "on" request, it turns on the timer.

    If it's just a simple HTTP or HTTPS request, there is no need for opening ports on your router.



  • Registered Users, Registered Users 2 Posts: 6,466 ✭✭✭emaherx


    Every 5 min would be useless for most applications involving switches. The IOT device creates and maintains a connection with the cloud service, it needs to stay connected if you want an almost instantaneous response from the app. Imagine you wanted to turn on lights you'd be pissed off if it took up to 5 min to respond. Some updates from devices like thermostats may be every 5 min or so but they would still maintain the connection in case you wanted to turn the heating up or down.

    But you are right no ports are needed to be opened on the router as the device initiated and maintains the connection.



  • Registered Users, Registered Users 2 Posts: 24,259 ✭✭✭✭ted1


    The way we did it for our systems , was we put the command in a folder. The field device polled this folder to look for an instruction.



  • Registered Users, Registered Users 2 Posts: 6,466 ✭✭✭emaherx


    What are your systems?

    Poling is fairly inefficient for switch states, the device mentioned in the first post is a Tuya device and the underlying protocol is MQTT.

    https://developer.tuya.com/en/docs/iot/MQTT-protocol?id=Kb65nphxrj8f1



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 226 ✭✭_ptashek_


    It uses what is generally called a publisher-subscriber connection model. Emaherx above gave an example of the MQTT protocol which uses that model.

    Your device subscribes to a topic or channel on a remote server (client initiated, permanent connection). So does your mobile app. When you take an action in the app, it publishes it to that channel. All subscribers of that channel will now receive it, and can act accordingly, and also publish their own response (e.g. state change of the target device).

    It's probably the most common way to do this in the IoT world. No faffing around with port forwarding, NAT and all that nonsense:)



Advertisement