0

Button state refresh
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Button state refresh

by diego1971 on Fri Mar 15, 2019 7:03 am

With Arduino I created a thermostat that can be activated from the Internet with Adattrauit IO mqtt. If I turn on the radiators from my thermostat the ignition signal is sent to the Mqtt server. Then I open the app that I connected to the mqtt server and the power button is in the Off state instead of ON. The status changes only if the power is turned on with the app activated. I tried to configure the app in any way but the problem persists. I would like to ensure that the status of the button is sent when the app is opened. Can anyone help me please.
Many thanks.

Diego

diego1971
 
Posts: 2
Joined: Mon Mar 04, 2019 7:51 am

Re: Button state refresh

by brubell on Fri Mar 15, 2019 9:51 am

diego1971 wrote:With Arduino I created a thermostat that can be activated from the Internet with Adattrauit IO mqtt. If I turn on the radiators from my thermostat the ignition signal is sent to the Mqtt server. Then I open the app that I connected to the mqtt server and the power button is in the Off state instead of ON. The status changes only if the power is turned on with the app activated. I tried to configure the app in any way but the problem persists. I would like to ensure that the status of the button is sent when the app is opened. Can anyone help me please.
Many thanks.

Diego


You might want to try retrieving the last known value from the server, on first load of the app: https://learn.adafruit.com/welcome-to-a ... alue-16-10

brubell
 
Posts: 282
Joined: Fri Jul 17, 2015 10:33 pm

Re: Button state refresh

by diego1971 on Mon Mar 18, 2019 2:14 pm

Good evening, thanks for the reply. I had already read the link you sent me and applied it to my Arduino scketch. In my case it is an Arduino app named Mqtt dash, downloaded from Google play. I can't configure it so that opening it can receive the last status of my switch. I hope someone can help me solve my problem. Thank you

diego1971
 
Posts: 2
Joined: Mon Mar 04, 2019 7:51 am

Please be positive and constructive with your questions and comments.