I am new to programming and the particle system, pardon if my jargon is incorrect or if I am using incorrect wording (feel free to correct me) . I am attempting to create a light that changes based on the weather. I have seen a few similar projects and believe I am close to having this one working.
I have created a webhook that is using Dark Sky’s API. I have it pulling only one specific field and publishing an event based on that field. The event name is “summary”. Then I have subscribed to the event. My problem is that my command and set color do not seem to be talking/reading the event. Does anyone have an advice on how to make certain Pins turn on or off based on what the event is?
have you checked console.particle.io/integrations whether your webhook is correctly sent and the response received?
Can you share your webhook definition (make sure to obfuscate privat data)?
However, since we have established that the webhook works correctly, we can move on to the next steps
are you seeing the Serial.print() output of your myHandler()?
when that works, we have also established that the subscription works
finally (and that is the actual reason for your problem) you are not acting on the response you catch with myHandler(). You are merely printing the incoming data but don't use it to call your setColor() - webhooks don't call a Particle.function() even if they are called the same - so no surprise the colour doesn't change
Background:
A webhook provides a way to request data from a third party server via a slim interface offloading most work to the cloud but they are not meant to get active on their own.
But this might be what you expected when you named your Particle.function() the same as the event to trigger the webhook. Particle.function(), Particle.publish() and (for completeness) Particle.variable() are completely independent from eachother and one will never interact with the other unless you explicitly code it (either on your device or at some remote server).
The only direct interaction exists between Particle.publish() and Particle.subscribe() when both share a common event and webhooks can act as a (mere) relay between an outgoing and a related incoming event.
On the other hand you can keep the Particle.function() as you had it but inside your subscription handler just call colorOne(data).
This way you can have your webhook and a user callable function do the same thing.