Timer widget will not sync - formerly: Some help with (reading vPin state if device was offline at state change)

Run my thoughtfully included code :wink:

And, hey, if I totally goofed on something with it… please show me… I learn best after a good beatdown :stuck_out_tongue:

Ok. Let me check.

1 Like

@Gunner by the way - do you use the newly created timer?

Huh? I used the only Timer Widget I am currently aware of. The one with the Start Stop option.

image

@Dmitriy I am using your server and 2.17.2 (not latest Android), added a Timer today and sync returns nothing. No tags etc just a straight Timer.

@rotarucosminleonard @Gunner @Costas thank you guys for the report. Bug is found and fixed. Was introduced due to back compatibility fix. And thus tests were wrong too :smile:. We will try to release it ASAP.

3 Likes

I now see new field of “value”

{“type”:“TIMER”,“id”:126677,“x”:0,“y”:0,“color”:600084223,“width”:3,“height”:1,“tabId”:0,“isDefaultColor”:true,“deviceId”:0,“pinType”:“VIRTUAL”,“pin”:1,“pwmMode”:false,“rangeMappingOn”:false,“min”:0,“max”:1,“value”:“0”,“startTime”:36780,“startValue”:“1”,“stopTime”:36900,“stopValue”:“0”},

@Dmitriy you have fixed your server already?

@Costas nope. value field was from the start and it was used for sync. However, at some point, we removed old code for back compatibility and there left old code that was expecting old format of value field :wink:.

Strange that “value” wasn’t in the json a couple of hours ago.

Does “value” only appear if start time has been reached as my earlier test was set for a 10PM start whereas now it’s set at 12:13 start (10 minutes ago).

Yes.

1 Like

Thank you @Dmitriy… I am sure “someone” will be happy :wink:

@rotarucosminleonard hope you are following the thread and understand the implications of the bug fix.

sync will only be available if start time has been reached.
sync will give you the status that your “relay” (or other component) should be in if the MCU was online at the ON / OFF trigger time.
So you will need a Blynk Timer loop (nothing to do with Blynk Timer widget) to check at intervals for the sync state compared with the actual MCU pin state following any disconnects etc.

Edit: thinking about it the sync itself should be able to update the MCU pin status following a disconnect.