Should I use Particle.variable() or Particle.publish()?

Hi @ArtiSchmidt

Please see this early tutorial I wrote:

It shows how to refresh a variable value shown on a page at any reasonable interval you select (1 second in the tutorial is about as fast as possible).

I would say the variables and publish streams are about the same but variables seem easier to me to recover from bad things along the way. Some things are just naturally better with "push" and some with "pull" so you will have to decide.

I wanted to correct this statement since it is not true today. Publish data disappears as soon as it is published from the cloud to any listeners today. In this way the Particle cloud is just a transport, moving published data from your device to your application in a safe and effective way. If the 60 seconds refers to the TTL value, that is ignored today.

A webhook is a way to integrate another web-based service with published data, but is not required. Webhooks are extremely useful for gluing together flows that can do amazing things, so if your goal was to save your data to a Google spreadsheet, I would recommend a webhook for sure (of IFTTT), but for display on your own site they are not required.

4 Likes