Opensensemap not working? how to configure?

Hi,

trying the opensensemap integration I like to give the resulting sensors a name according to the station I use:

air_quality:
# Geertruidenberg https://opensensemap.org/explore/58e257ccf7b1c10011d9f5ef
  - platform: opensensemap
    name: Geertruidenberg
    station_id: 58e257ccf7b1c10011d9f5ef
# Tilburg de baanen de steeghen https://opensensemap.org/explore/5c39dee7c4c2f30019cc530a
  - platform: opensensemap
    name: Tilburg
    station_id: 5c39dee7c4c2f30019cc530a

however, these names are not used in the system at all, and in fact no evidence of a working sensor is found…

how should I configure this correctly, or is the integration not working at all?
thanks for having a look

thesis in the startup log :slight_smile:

2019-07-26 15:09:30 ERROR (MainThread) [opensensemap_api] Can not load data from openSenseMap API
2019-07-26 15:09:30 ERROR (MainThread) [homeassistant.components.opensensemap.air_quality] Unable to fetch data: 
2019-07-26 15:09:30 ERROR (MainThread) [homeassistant.components.opensensemap.air_quality] Station 58e257ccf7b1c10011d9f5ef is not available
2019-07-26 15:09:30 ERROR (MainThread) [opensensemap_api] Can not load data from openSenseMap API
2019-07-26 15:09:30 ERROR (MainThread) [homeassistant.components.opensensemap.air_quality] Unable to fetch data: 
2019-07-26 15:09:30 ERROR (MainThread) [homeassistant.components.opensensemap.air_quality] Station 5c39dee7c4c2f30019cc530a is not available

though they are valid id’s according to the url’s I provided

it seems this is a known phenomenon and there has been a related change recently. https://github.com/home-assistant/home-assistant/pull/25182

Does it work after some time?

It works for me using your station id.

don’t think so, at least, there’s nothing pointing in that direction… could you show me what to look for, a sensor, a marker on the map, or something else?

thats good to hear, hope you can show me what you get in the frontend

a cryptic answer to say the least…
maybe a typo?

Sorry I misread, thought you ask how I get it into the frontend!

I named mine test (I know, original huh?)

I see in states

entity is air_quality.test 

State is 6.13 

Attributes are
attribution: Data provided by openSenseMap 
particulate_matter_10: 6.73 
particulate_matter_2_5: 6.13 
friendly_name: test

However if the api was unreachable it doesn’t appear at all.

I would try applying the commit in the pull request.

ok thanks.
its all a bit confusing, because under air_quality I get the sensors made by AirVisual, albeit being named:
- sensor.u_s_air_pollution_level
- sensor.u_s_air_quality_index
- sensor.u_s_main_pollutant …

while they are located around the same long/lat and only use the us metrics…

somehow HA integrations don’t use the same naming convention, which is rather tedious, and unclear.
Luftdaten which I also have in the test setup, doesnt allow for naming, so im stuck with silly sensors like:
- sensor.luftdaten_28692_p1
- sensor.luftdaten_28692_p2
made by

luftdaten:
# https://deutschland.maps.luftdaten.info/#10/51.5535/4.5405
# https://www.home-assistant.io/components/luftdaten/
  sensor_id: 28692
  show_on_map: true
  sensors:
    monitored_conditions:
      - P1
      - P2
      - temperature
      - humidity
      - pressure

no idea yet how to have more sensors for multiple stations set up in Luftdaten yet…
but that is for another topic…

well, hope this will evolve over the next few iterations.

Will certainly give the commit a look, and see if I can apply that fttb.

I have been looking at the source, and many of the air quality sensors in HA certainly are in the sensor.x domain. The ones that are in the air_quality.x domain are:

ampio, norway_air, opensensemap, nilu and dyson.

getting back to this because I finally get some entities, after updating to HA 97.2.

errors are in the inspector though regarding the icons of the entities:

while the frontend shows:

21

the geo_location entities are quakes, and show:

59

wouldn’t know which icon they ought to show though. posted about that before: Unable to find icon for domain geo_location

I also have errors with me that the station does not exist and it was not possible to download the data or something like that.

air_quality:
  - platform: opensensemap
    station_id: 5dee128c2b3516001a81115d

despite the fact that when I go to https://opensemap.org/explore/5dee128c2b3516001a81115d, the data is displayed and I have logged on

Logger: homeassistant.components.opensensemap.air_quality
Source: components/opensensemap/air_quality.py:106
Integration: opensensemap (documentation, issues)
First occurred: 15:25:14 (1 occurrences)
Last logged: 15:25:14

Unable to fetch data:
Logger: homeassistant.components.opensensemap.air_quality
Source: components/opensensemap/air_quality.py:51
Integration: opensensemap (documentation, issues)
First occurred: 15:25:14 (1 occurrences)
Last logged: 15:25:14

Station 5dee128c2b3516001a81115d is not available
Logger: opensensemap_api
Source: /data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/opensensemap_api/__init__.py:60
First occurred: 15:25:14 (1 occurrences)
Last logged: 15:25:14

Can not load data from openSenseMap API

So where am I making a mistake that I don’t want to download my data?