akx / hass-ruuvitag

Hass.io addon for Ruuvitag Weather Stations
MIT License
24 stars 7 forks source link

500 internal server error with hass API with some separators #28

Open Nurffe opened 4 years ago

Nurffe commented 4 years ago

hass-ruuvitag fails to communicate with homeassistant api if tag name contains - or . or probably some other separators too

Following configuration

  - id: beeefeeeecee
    name: ruuvi.indoor
    enabled: true
    temperature: true
    pressure: true
    humidity: true
    battery: true
    acceleration: false
    accelerationX: false
    accelerationY: false
    accelerationZ: false

Will lead too tag beeefeeeecee: failed 2 http://hassio/homeassistant/api/states/sensor.ruuvi.indoor_temperature: 500 Internal Server Error

He55u commented 3 years ago

I have the same problem:

tag fd09656737fe: failed 2 http://hassio/homeassistant/api/states/sensor.some-name_temperature: 500 Internal Server Error
Server got itself in trouble

I'm running hass-ruuvitag in env:

He55u commented 3 years ago

It looks like that hassio-ruuvitag is not able to set attributes correctly?

Found tag fd09656737fe
[
  {
    url: 'http://hassio/homeassistant/api/states/sensor.some-name_temperature',
    payload: { state: 21.62, attributes: [Object] }
  },
  {
    url: 'http://hassio/homeassistant/api/states/sensor.some-name_pressure',
    payload: { state: 1015.0400000000001, attributes: [Object] }
  },
  {
    url: 'http://hassio/homeassistant/api/states/sensor.some-name_humidity',
    payload: { state: 24.915, attributes: [Object] }
  },
  {
    url: 'http://hassio/homeassistant/api/states/sensor.some-name_battery',
    payload: { state: 3061, attributes: [Object] }
  }
]
He55u commented 3 years ago

I got now hassio-ruuvitag working after changing the name of a sensor from "some-name" to "olohuone". It seems that you should not use any special characters in the sensor name. Thanks Arni for help!