cyberjunky / home-assistant-custom-components

My custom components for Home Assistant
MIT License
71 stars 19 forks source link

P2000 sensor lat.lon problems #18

Closed gerritjonker closed 5 years ago

gerritjonker commented 5 years ago

Ha version 0.86.4 When using the new P2000 sensor I get status unknown. When I switch to the map the log is filling with errors: ERROR (MainThread) [frontend.js.latest.201901211] http://ha:8123/frontend_latest/4f3fb0938fa64e54c4e9.chunk.js:4:18668 TypeError: null is not an object (evaluating 'latlng.lat') and the map is behaving weird.

cyberjunky commented 5 years ago

Hi Gerrit, Can you share your sensor config? You can change your lat/lon slightly if you want to keep them private.

gerritjonker commented 5 years ago

Sensor is called from a subdirectory /config/sensors and called from configuration.yaml. There is no difference when using the lat/lon from HA or from the sensor config.

cyberjunky commented 5 years ago

I have insert a default of 0.0 lat long in latest vresion, do you still get these errors?

gerritjonker commented 5 years ago

No errors anymore. Working fine now. Thanks for your update!

incmve commented 5 years ago

I have insert a default of 0.0 lat long in latest vresion, do you still get these errors?

That broke mine, now my location on the map is 0,0 and the custom latitude/latitude is ignored. When I change the sensor.py to:

        self.latitude = latitude
        self.longitude = longitude

Now it works again