jasonsnell / PurpleAir-AQI-Scriptable-Widget

Generate Scriptable app widget to query PurpleAir sensor and display local AQI.
The Unlicense
168 stars 38 forks source link

Widget doesn't display data from closest location #26

Closed 1MiloAC closed 3 years ago

1MiloAC commented 3 years ago

I'm not understanding how to make it so that I if I enter no id it fetches the closest one to me that way if I'm traveling it'll auto update please help!!

I am also trying to patch this into Weather Cal but I am getting no luck it just keeps giving me rendering errors

jasonsnell commented 3 years ago

Can't help you with WeatherCal. If you don't put anything into the back of the widget, it should use location services to find the location nearest you.

If you're not in the US I don't know if it will work at all, not sure PurpleAir works outside the US.

1MiloAC commented 3 years ago

I am In the US but when ever I leave it blank it gives the following error: "Please specify a location for this widget"

Would it be possible for you to send me a tutorial?

jasonsnell commented 3 years ago

Have you allowed Location Services for the Scriptable app? It's also possible that there are no PurpleAir sensors nearby - you can check that by looking at the PurpleAir map.

1MiloAC commented 3 years ago

Yes it has location permissions And there is a sensor about 10m from me still doesn't work

I think one of the problems is that the fallback sensor id is: "undefined"

jasonsnell commented 3 years ago

Please run the script inside Scriptable and tell me what happens, and ideally paste in the contents of the log after it runs.

1MiloAC commented 3 years ago

Ok here is the log

This is a non edited version I deleted all the others and re downloaded it

2021-03-19 13:36:43: Could not fetch location: TypeError: undefined is not an object (evaluating 'results.filter') 2021-03-19 13:36:43: Could not render widget: Please specify a location for this widget.

jasonsnell commented 3 years ago

I'm sorry, something is failing in the attempt to sense a location. I can't reproduce it here and have not seen any other reports of this, which suggests that it's something to do with your system, the Scriptable app, or your location. Sorry I can't be of more help.

1MiloAC commented 3 years ago

Ok thx for your time I double checked and it turns out that there are very few antennas for purple near me once again thx