home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.15k stars 29.82k forks source link

Automation page shows no data. API resources not found 404 #8334

Closed larsbijl closed 7 years ago

larsbijl commented 7 years ago

Home Assistant release (hass --version): 0.48.0

Python release (python3 --version): Python 3.4.2

Component/platform: Raspberry pi 3

Description of problem: Using the automation's editors shows blank screen after selecting an automation.

Expected: View to be able to modify the selected automation

Problem-relevant automations.yaml entries and steps to reproduce:

- id: turn_on_house_in_the_morning
  alias: Turn on house in the morning
  hide_entity: True
  trigger:
    platform: time
    at: '05:00:00'
  action:
    - service: homeassistant.turn_on
      entity_id: switch.livingroom_dehumidifier
  1. Select Automations
  2. Select Turn on house in the morning
  3. Blank screen and error in chrome dev panel

Additional info:

in chrome, I see the following error message.

api/config/automation/config/turn_on_house_in_the_morning Failed to load resource: the server responded with a status of 404 (Not Found)

larsbijl commented 7 years ago

same thing happens when i try to hit the endpoint using curl

curl -X GET -H "x-ha-access: xxxx" -H "Content-Type: application/json" http://pi:8123/api/config
{"components": ["logbook", "octoprint", "ios", "switch.rpi_rf", "http", "rpi_gpio", "emulated_hue", "automation", "logger", "binary_sensor", "sun", "binary_sensor.rpi_gpio", "group", "binary_sensor.octoprint", "switch", "light", "sensor.haveibeenpwned", "mqtt", "media_player.plex", "discovery", "zeroconf", "notify.ios", "frontend", "camera.mjpeg", "sensor", "history", "api", "light.hue", "sensor.template", "conversation", "updater", "media_player", "websocket_api", "zone", "binary_sensor.mqtt", "tts", "sensor.dht", "sensor.yr", "device_tracker", "script", "notify", "sensor.ios", "camera", "sensor.darksky", "recorder", "input_boolean"], "version": "0.48.0"}
curl -X GET -H "x-ha-access: xxxx" -H "Content-Type: application/json" http://pi:8123/api/config/automation/config/turn_on_house_in_the_morning
404: Not Found
fabaff commented 7 years ago

Seems to work fine on dev.

$ curl -H "x-ha-access: xxxx" -H "Content-Type: application/json" http://localhost:8123/api/config/automation/config/check_sensor
{"action": {"data": {"message": "Sensor value greater than 10"}, "service": "persistent_notification.create"}, "alias": "Check sensor value and show notification", "id": "check_sensor", "trigger": {"above": 10, "entity_id": "sensor.random", "platform": "numeric_state"}}
fabaff commented 7 years ago

Possible duplicate of #7823.

larsbijl commented 7 years ago

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/config/automation.py#L14-L14 is never called in my setup which is causing the issue.

larsbijl commented 7 years ago

found it. I was missing config: in my configuration.yml

heinemml commented 7 years ago

Yupp, this issue did cost me multiple evenings to find. Maybe it would be a good idea for the editor to check for this entry and complain/give a hint if it's missing.