4refr0nt / iot-manager-demo

Demo sketches for IoT Manager https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager
MIT License
66 stars 31 forks source link

Changing toggle status #4

Closed furang closed 4 years ago

furang commented 7 years ago

Hello. Not sure if this is a bug. But anyway.

Is there any way to change toggle switch status not from application. Now i try to explain what i mean. For example i have few devices. When i toggle a switch in one of my devices how can i do that changes happen on the other. I mean how can i do that switch changes on the other device. I looked thorough code examples and could not find answer. Is that already implemented? Where should i look? If it's not implemented yet will you implement this in future?

Thanks for your great work!

4refr0nt commented 7 years ago

Try using 2 (or more) smartphones with IoT Manager and 1 IoT device. From first mobile device we send control message to IoT device. IoT device change state and send confirmation - status message to broker. First mobile device receive status message and change toggle widget state (left icon). Second mobile device (and any other) receive status message too from broker and change toggle status to real state too. If IoT device can't change state, then send status message with old state to broker. All mobile devices change toggle status to real state too (left icon and toggle control return to previous state)

You must send status message to broker after every changing state of any sensors on IoT devices.

For more info see http://iotmanager.ru/exchange/