aex351 / home-assistant-neerslag-card

Display Buienalarm and/or Buienradar data in a graph for Home Assistant.
29 stars 3 forks source link

This entity does not have a unique ID #2

Closed mupsje closed 3 years ago

mupsje commented 3 years ago

I installed all.

and put this inside my sensors.yaml

Then I put the lines inside the cards. type: 'custom:neerslag-card' title: Neerslag entities:

Card remain Blank.

When I go to entities , I get a faild "does not have a unique ID"

image

please advice

aex351 commented 3 years ago

The card might remain blank until the sensor has fetched the data. These custom sensors are not set-up with a unique id. The message of the screenshot is correct and as expected: https://www.home-assistant.io/faq/unique_id.

This however is not an error, but just a limitation of the integration you use

In Developer Tools you can see if the sensors contain data: http://homeassistant:8123/developer-tools/state. Look for the buienalarm_regen_data and buienradar_regen_data entity. Both should contain data based upon your configuration.

mupsje commented 3 years ago

Hi,

I get data but still a blank card on front.......

image

image

image

aex351 commented 3 years ago

There seems to be an issue with rendering the graph when sensor.buienalarm_regen_data does not contain "rain" data.

In this particular case your issue can be resolved by configuring sensor.buienalarm_regen_data correctly. As the error message reads: "not in coverage". Which basically means, your longitude and/or latitude are wrong or Buienalarm is not available where you live.

The actual fix for this issue is improving the error handling for when sensor.buienalarm_regen_data is not providing "rain" data, as now the graph for sensor.buienradar_regen_data is also not getting displayed.

ersitan commented 3 years ago

@mupsje,

  • platform: command_line command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat=<50.967>&lon=<5.827>&region=nl&unit=mm%2Fu&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{"data":'+dataRequest+'}'; print(data);" name: Buienalarm_Regen_Data

do not write your lat and lon values within "<>", so it should be like "lat=50.967&lon=5.827"

I had the same problem and above solution worked for me. I hope it helps.

aex351 commented 3 years ago

That is correct and would explain why no actual rain data is fetched.

mupsje commented 3 years ago

Yesssssssssss..

@ersitan Thank you very much! @aex351 maybe a good think to ad in the description.

Greets!