Weather Station in Transist

I hope we are all doing well.

I have an innovative idea, which I want to propose to a client.

I want to design a tracking system that can monitor in real time, the weather conditions of the fleet plus the location.

I am certain I can use the GPS block for location tracker. This innovation involves integration.
The conventional weather station I built has a fixed coordinate, how do I make the coordinate change in real time with the fleet am tracking while reporting the environmental conditions around it?

Any help here?

Hi @Sunday_Ajiroghene,

There is not currently a way to display radar on a GPS Block. However, to make a coordinate change in real time with the movement of a fleet, you will need to report the GPS location of the moving device. You can then update the state of the GPS device with new coordinates and use the device attribute in the GPS Block. Whenever the device moves, it should report GPS and then update the state in Losant. If you need a way to collect weather data about a certain GPS point, you could use the Dark Sky API; a walkthrough can be found here. If you are looking for a live radar map, I would recommend checking out the External Website Block.

Thanks!
Julia

1 Like

@JuliaKempf truth, I have previously used the dark sky api for weather station on losant and it’s currently running on my sandbox dashboard.

This time, I want to repeat same project using a coordinates that change as the fleets changes position.

My challenge to us which I haven’t been able to figure out is, how can I update the coordinates automatically relative to the fleets movement.

Example

Fleet is in Los Angeles, on the instant my weather station update itself reporting the weather conditions, 30 minutes later, same fleet is In California (assuming both locations are close ), Automatically, the weather conditions of California is reported.

Notice, the coordinates just updates itself, while the workflow and setting for the weather stations remain.

Is my challenge clear enough?

Hi @Sunday_Ajiroghene,

Thanks for your explanation, I think I better understand your use case. Updating the weather for new coordinates would be done in the workflow that fetches data from the Dark Sky API. So, in your workflow that updates weather conditions, you could trigger it with a Device: State Trigger Node. Then, data will come into your weather workflow when the device state is updated. When the workflow is triggered, the payload will include all of the data that was reported with the device state, which would include the GPS location of the device. Then, in your HTTP Node, you would point to the location on the payload that the GPS location is stored, and use it as a variable at the end of the URL:

Let me know if this unclear, or if you have any further questions!

Thanks,
Julia

1 Like

@JuliaKempf many thanks for the explanation.

It was getting clearer until I got to this point as below:

“you could trigger it with a [Device: State Trigger Node]. Then, data will come into your weather workflow when the device state is updated. When the workflow is triggered, the payload will include all of the data that was reported with the device state, which would include the GPS location of the device. Then, in your HTTP Node, you would point to the location on the payload that the GPS location is stored, and use it as a variable at the end of the URL:”

I am sure once the api is inserted into the http block, this begins to fetch the weather conditions of the coordinate it points to.

But how to make the coordinates dynamic using a variable that changes is what I have not been able to understand, such that I use a variable instead of a fixed value and point to the variable, as the variable changes, cordinates get updated and the weather conditions get updated as well.

I would be glad if you could use simple example real time to illustrate or rather still show me the code.

Your feedback would be appreciated.

Regards,

Ajiroghene

Hi @Sunday_Ajiroghene,

I can walk you through making your weather map dynamic with a moving GPS point. I have a GPS device that reports a GPS location every 10 seconds. This is updating the GPS Device’s state:

I want to get the weather of the location my GPS Device is in, so over in my weather workflow, I add a Device: State node as it will trigger my workflow every time my GPS Device’s state is updated:

Each time I get a state report for my device, the data from that state report becomes available in my workflow:

Thus, my last state value is available on the payload at {{data.gps}}, and I can use that payload location to get the weather for the changing GPS point:

Now, each time my device’s location updates, I get the weather information for that location!

Let me know how else I can help,
Julia

1 Like

Many thanks @JuliaKempf this is helpful.
I will follow this meticulously and would update you of the success story.

Regards,

Sunny

1 Like