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
73.92k stars 30.98k forks source link

Error with new group configuration interface on 0.39.3 #6396

Closed DubhAd closed 7 years ago

DubhAd commented 7 years ago

HA: 0.39.3 Python: 3.4.2 Raspberry Pi, Jessie (Debian 8.0)

With the new configuration interface, it displays my existing groups without issue. However, when attempting to change anything it spins, never completing. Checking the logs shows a typical error:

Mar 04 11:12:03 jarvis hass[29599]: 17-03-04 11:12:03 ERROR (MainThread) [aiohttp.server] Error handling request
Mar 04 11:12:03 jarvis hass[29599]: Traceback (most recent call last):
Mar 04 11:12:03 jarvis hass[29599]: File "/home/homeassistant/.homeassistant/deps/aiohttp/web_server.py", line 62, in handle_request
Mar 04 11:12:03 jarvis hass[29599]: resp = yield from self._handler(request)
Mar 04 11:12:03 jarvis hass[29599]: File "/home/homeassistant/.homeassistant/deps/aiohttp/web.py", line 270, in _handle
Mar 04 11:12:03 jarvis hass[29599]: resp = yield from handler(request)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 57, in ban_middleware_handler
Mar 04 11:12:03 jarvis hass[29599]: return (yield from handler(request))
Mar 04 11:12:03 jarvis hass[29599]: File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
Mar 04 11:12:03 jarvis hass[29599]: res = yield from res
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 417, in handle
Mar 04 11:12:03 jarvis hass[29599]: result = yield from result
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/config/__init__.py", line 110, in post
Mar 04 11:12:03 jarvis hass[29599]: yield from hass.loop.run_in_executor(None, _write, path, current)
Mar 04 11:12:03 jarvis hass[29599]: File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
Mar 04 11:12:03 jarvis hass[29599]: yield self  # This tells Task to wait for completion.
Mar 04 11:12:03 jarvis hass[29599]: File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
Mar 04 11:12:03 jarvis hass[29599]: value = future.result()
Mar 04 11:12:03 jarvis hass[29599]: File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
Mar 04 11:12:03 jarvis hass[29599]: raise self._exception
Mar 04 11:12:03 jarvis hass[29599]: File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
Mar 04 11:12:03 jarvis hass[29599]: result = self.fn(*self.args, **self.kwargs)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/config/__init__.py", line 134, in _write
Mar 04 11:12:03 jarvis hass[29599]: data = dump(data)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 75, in dump
Mar 04 11:12:03 jarvis hass[29599]: .replace(': null\n', ':\n')
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/__init__.py", line 216, in safe_dump
Mar 04 11:12:03 jarvis hass[29599]: return dump_all([data], stream, Dumper=SafeDumper, **kwds)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/__init__.py", line 188, in dump_all
Mar 04 11:12:03 jarvis hass[29599]: dumper.represent(data)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/representer.py", line 26, in represent
Mar 04 11:12:03 jarvis hass[29599]: node = self.represent_data(data)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/representer.py", line 47, in represent_data
Mar 04 11:12:03 jarvis hass[29599]: node = self.yaml_representers[data_types[0]](self, data)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 308, in <lambda>
Mar 04 11:12:03 jarvis hass[29599]: represent_odict(dumper, u'tag:yaml.org,2002:map', value))
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 290, in represent_odict
Mar 04 11:12:03 jarvis hass[29599]: node_value = dump.represent_data(item_value)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/representer.py", line 47, in represent_data
Mar 04 11:12:03 jarvis hass[29599]: node = self.yaml_representers[data_types[0]](self, data)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 308, in <lambda>
Mar 04 11:12:03 jarvis hass[29599]: represent_odict(dumper, u'tag:yaml.org,2002:map', value))
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 290, in represent_odict
Mar 04 11:12:03 jarvis hass[29599]: node_value = dump.represent_data(item_value)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/representer.py", line 57, in represent_data
Mar 04 11:12:03 jarvis hass[29599]: node = self.yaml_representers[None](self, data)
Mar 04 11:12:03 jarvis hass[29599]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/yaml/representer.py", line 229, in represent_undefined
Mar 04 11:12:03 jarvis hass[29599]: raise RepresenterError("cannot represent an object: %s" % data)
Mar 04 11:12:03 jarvis hass[29599]: yaml.representer.RepresenterError: cannot represent an object: ['sensor.average_load_1m', 'sensor.average_load_5m', 'sensor.average_load_15m', 'sensor.cpu_use', 'sensor.disk_use_', 'sensor.disk_use_datahomeassistant', 'sensor.last_boot', 'sensor.ram_free', 'sensor.ram_use', 'sensor.swap_free', 'sensor.swap_use']

If I have only a single group in groups.yaml, then it behaves as expected and updates the group. However as with most people, I don't have a single group.

The following groups.yaml is enough to trigger this problem:

my_system:
  name: System status
  entities:
    - sensor.average_load_1m
    - sensor.average_load_5m
    - sensor.average_load_15m
    - sensor.cpu_use
    - sensor.disk_use_
    - sensor.disk_use_datahomeassistant
    - sensor.last_boot
    - sensor.ram_free
    - sensor.ram_use
    - sensor.swap_free
    - sensor.swap_use
  view: false
tv:
  name: TVs
  entities:
    - media_player.samsung_tv_remote
    - media_player.living_room_tv
  view: false
migromao commented 7 years ago

Hi, I-m also having issues with new HA version , as when changed the groups trough config, it deleted all contents that I-ve inserted in groups.yaml. after a reboot all devices went to default frontend view. As I wasnt expecting this, I didnt had backup the groups.yaml contents :(

any suggestion for the groups configuration not losing everything sudenly ?

DubhAd commented 7 years ago

Problem still exists in 0.40

rpitera commented 7 years ago

Same here. Finally upgraded to .40 and set up config: Can't save any changes from config panel.

Get a similar error as OP. (See below)

Went through entire groups.yaml file and made sure it was 'super compliant'; checked spacing, gave everything a name (removed any naming done in customize), used entities for everything even though these were never an issue before.

Restarted and still getting same error. groups.yaml and error follows:

-groups.yaml-

#
#  Views
#
default_view:
  view: yes
  entities:
    - updater.updater
    - persistent_notification.invalid_config
    - group.laundry
    - group.forecast
    - group.avg_temps
    - group.perimiter
    - group.outdoor_lighting
    - group.motion_sensors
    - group.ecobee
    - group.presence
    - group.alarm_system
    - group.events
    - group.almanac
    - camera.robert
    - group.ring
    - group.traffic_info

cameras:
  name: Cameras
  view: yes
  entities:
    - group.interior_cams
    - group.exterior_cams
    - group.camera_presets

rooms:
  name: Rooms
  view: yes
  entities:
    - group.outside
    - group.livingroom
    - group.hallway
    - group.office
    - group.bedroom
    - group.diningroom
    - group.tearoom
    - group.upstairs
    - group.ecobee
    - group.nest_protect_downstairs
    - group.nest_protect_upstairs

pws:
  name: Weather Station
  view: yes
  entities:
    - group.wunderground
    - group.wxcameras
    - group.weather_statistics
    - group.forecast
    - group.aqi

media:
  name: Media Room
  view: yes
  entities:
    - group.mediaplayers
    - media_player.media_center
    - group.remote
    - group.plex_activity

system:
  name: System Status
  view: yes
  entities:
    - group.internet
    - group.wink_devices
    - group.ha_status
    - group.system_status
    - group.local_devices

automation:
  name: Automation
  view: yes
  entities:
    - group.scenes
    - group.inputs
    - group.all_automations
    - group.all_scripts
    - group.weather

zwave:
  name: ZWave
  view: yes
  entities:
    - group.aeotec_lr_sensor
    - group.aeotec_br_sensor
    - group.aeotec_smart_switch_1
    - group.aeotec_smart_switch_2
    - group.aeotec_smart_energy_switch
    - group.garage

#
# Groups
#
weather:
  name: weather
  entities:
    - sensor.yr_symbol 
    - sensor.dark_sky_icon
    - sensor.dark_sky_summary
    - sensor.dark_sky_condition
    - sensor.dark_sky_temperature
    - sensor.dark_sky_apparent_temperature
    - sensor.dark_sky_cloud_coverage
    - sensor.dark_sky_humidity
    - sensor.dark_sky_dew_point
    - sensor.dark_sky_precip
    - sensor.dark_sky_precip_type
    - sensor.dark_sky_precip_probability
    - sensor.dark_sky_precip_intensity
    - sensor.dark_sky_pressure
    - sensor.dark_sky_visibility
    - sensor.dark_sky_nearest_storm_distance
    - sensor.dark_sky_wind_bearing
    - sensor.dark_sky_wind_speed

forecast:
  name: forecast
  entities:
    - sensor.dark_sky_minutely_summary
    - sensor.dark_sky_hourly_summary
    - sensor.dark_sky_daily_summary

internet:
  name: internet
  entities:
    - sensor.speedtest_ping
    - sensor.speedtest_download
    - sensor.speedtest_upload
    - sensor.update_speedtest

outdoor_lighting:
  name: outdoor lighting
  entities:
    - light.front_door
    - light.side_door
    - light.garage
    - light.landscape

motion_sensors:
  name: motion sensors
  entities:
    - binary_sensor.aeotec_multisensor_6_sensor_7_0
    - binary_sensor.office_motion
    - binary_sensor.aeotec_multisensor_6_sensor_8_0
    - binary_sensor.tearoom_motion
    - binary_sensor.second_floor_motion

perimiter:
  name: perimiter
  entities:
    - lock.front_door
    - binary_sensor.vision_zg8101_garage_door_detector_sensor_12_0
    - binary_sensor.mailbox_opened
    - binary_sensor.front_door_opened
    - binary_sensor.kitchen_entry_opened
    - binary_sensor.side_door_opened
    - binary_sensor.tea_room_slider_opened
    - binary_sensor.dining_room_1_opened
    - binary_sensor.dining_room_2_opened

bedroom:
  name: bedroom
  entities:
    - binary_sensor.aeotec_multisensor_6_sensor_8_0
    - sensor.aeotec_multisensor_6_temperature_8_1
    - light.lightstrip1
    - light.bedroom_left
    - light.bedroom_right

tearoom:
  name: tea room
  entities:
    - binary_sensor.tearoom_motion
    - sensor.tearoom_temperature
    - light.tea_room_left
    - light.tea_room_right
    - switch.aeotec_smart_energy_switch_switch_9_0

diningroom:
  name: dining room
  entities:
    - light.dining_room
    - binary_sensor.tea_room_slider_opened
    - binary_sensor.dining_room_1_opened
    - binary_sensor.dining_room_2_opened

livingroom:
  name: living room
  entities:
    - binary_sensor.front_door_opened
    - binary_sensor.aeotec_multisensor_6_sensor_7_0
    - sensor.aeotec_multisensor_6_temperature_7_1
    - switch.outlet_1
    - switch.outlet_2
    - light.sconces
    - light.lightstrip2
    - light.lightstrip3
    - light.lightstrip4
    - light.tv_light_l
    - light.tv_light_r

hallway:
  name: hallway
  entities:
    - switch.top_light_load
    - binary_sensor.main_floor_occupancy

office:
  name: office
  entities:
    - binary_sensor.office_motion
    - sensor.office_temperature
    - switch.office

upstairs:
  name: second floor
  entities:
    - binary_sensor.second_floor_motion
    - sensor.upstairs_temperature
    - sensor.second_floor_temperature
    - binary_sensor.upstairs_occupancy

garage:
  name: garage
  entities:
    - binary_sensor.vision_zg8101_garage_door_detector_sensor_12_0
    - light.garage

mediaplayers:
  name: mediaplayers
  entities:
    - media_player.my_afts
    - media_player.my_afts_2
    - media_player.plex
    - media_player.cast_office
    - media_player.cast_living_room
    - media_player.cast_bath
    - media_player.cast_living_room_home
    - media_player.living_room_tv
    - media_player.cast_shield
    - media_player.plex_shield

camera_group:
  name: camera group
  entities:
    - camera.front_outside_house
    - camera.front_outside_house_alt
    - camera.front_of_house
    - camera.rear_of_house

wxcameras:
  name: wxcameras
  entities:
    - camera.goes_east_sat
    - camera.ny_metro_wx_radar
    - camera.ny_metro_precip

ha_status:
  name: ha status
  entities:
    - sensor.current_ha_version
    - sensor.installed_version

system_status:
  name: system status
  entities:
    - sensor.rp1_disk_use
    - sensor.rp1_disk_use_2
    - sensor.rp1_disk_free
    - sensor.rp1_ram_use
    - sensor.rp1_ram_use_2
    - sensor.rp1_ram_free
    - sensor.rp1_swap_use_percent
    - sensor.rp1_swap_use
    - sensor.rp1_swap_use_2
    - sensor.rp1_swap_free
    - sensor.rp1_cpu_load
    - sensor.rp1_thread
    - sensor.rp1_total
    - sensor.rp1_running
    - sensor.rp1_sleeping
    - sensor.since_last_boot
    - sensor.last_boot
    - sensor.cpu_use
    - sensor.memory_use_percent
    - sensor.ram_free

local_devices:
  name: local devices
  entities:
    - sensor.epsonprinter
    - sensor.brotherprinter
    - sensor.zen
    - sensor.satori
    - sensor.nirvana
    - sensor.acurite_wx
    - sensor.ex3700

presence:
  name: presence
  entities:
    - device_tracker.rpitera_rpitera
    - sensor.droid_battery
    - proximity.home
    - device_tracker.ford_fusion
    - sensor.fusion_fuel
    - binary_sensor.main_floor_occupancy
    - binary_sensor.upstairs_occupancy

wunderground:
  name: wunderground
  entities:
    - sensor.pws_alerts
    - sensor.pws_weather
    - sensor.pws_station_id
    - sensor.pws_observation_time
    - sensor.pws_location
    - sensor.pws_elevation
    - sensor.pws_temp_f
    - sensor.pws_feelslike_f
    - sensor.pws_dewpoint_f
    - sensor.heat_index_f
    - sensor.pws_uv
    - sensor.pws_solarradiation
    - sensor.pws_visibility_mi
    - sensor.pws_relative_humidity
    - sensor.pws_pressure_in
    - sensor.pws_pressure_mb
    - sensor.pws_pressure_trend
    - sensor.pws_wind_degrees
    - sensor.pws_wind_dir
    - sensor.pws_wind_string
    - sensor.pws_wind_mph
    - sensor.pws_wind_gust_mph
    - sensor.pws_precip_1hr_in
    - sensor.pws_precip_today_in
    - sensor.pws_precip_today_string

nest_protect_downstairs:
  name: nest protect main floor
  entities:
    - binary_sensor.downstairs_nest_protect_online
    - sensor.downstairs_nest_protect_battery_health
    - sensor.downstairs_nest_protect_co_status
    - sensor.downstairs_nest_protect_smoke_status

nest_protect_upstairs:
  name: nest protect second floor
  entities:
    - binary_sensor.upstairs_nest_protect_online
    - sensor.upstairs_nest_protect_battery_health
    - sensor.upstairs_nest_protect_co_status
    - sensor.upstairs_nest_protect_smoke_status

alarm_system:
  name: alarm system
  entities:
    - alarm_control_panel.ha_alarm

alarm_state:
  name: alarm state
  entities:
    - light.front_door
    - binary_sensor.bedroom_motion
    - binary_sensor.kitchen_entry_opened
    - binary_sensor.side_door_opened
    - light.side_door
    - binary_sensor.tea_room_slider_opened
    - binary_sensor.dining_room_1_opened
    - binary_sensor.dining_room_2_opened
    - binary_sensor.second_floor_motion

traffic_info:
  name: traffic info
  entities:
    - sensor.ewr_travel_time
    - sensor.bridgewater_area_travel_time
    - sensor.wilson_borough_travel_time
    - sensor.sandy_hook_travel_time
    - sensor.poconos_travel_time

scenes:
  name: scenes
  entities:
    - scene.tv_time
    - scene.sunset
    - scene.sunset_dimmed
    - scene.green_forest
    - scene.deep_blue
    - scene.landscape_colorloop

inputs:
  name: inputs
  entities:
    - input_boolean.sunup_switch
    - input_boolean.sundown_switch
    - input_boolean.mailbox_switch
    - sensor.washer_pwrup
    - input_boolean.washer_switch
    - sensor.dryer_pwrup
    - input_boolean.dryer_switch

remote:
  name: remote
  entities:
    - remote.living_room
    - sensor.current_activity
    - input_select.living_room_tv

aeotec_lr_sensor:
  name: living room
  entities:
    - binary_sensor.aeotec_multisensor_6_sensor_7_0
    - sensor.aeotec_multisensor_6_burglar_7_10
    - sensor.aeotec_multisensor_6_luminance_7_3
    - sensor.aeotec_multisensor_6_relative_humidity_7_5
    - sensor.aeotec_multisensor_6_temperature_7_1

aeotec_br_sensor:
  name: bedroom
  entities:
    - binary_sensor.aeotec_multisensor_6_sensor_8_0
    - sensor.aeotec_multisensor_6_burglar_8_10
    - sensor.aeotec_multisensor_6_luminance_8_3
    - sensor.aeotec_multisensor_6_relative_humidity_8_5
    - sensor.aeotec_multisensor_6_temperature_8_1

aeotec_smart_energy_switch:
  name: tea room fireplace
  entities:
    - switch.aeotec_smart_energy_switch_switch_9_0
    - sensor.aeotec_smart_energy_switch_voltage_9_15
    - sensor.aeotec_smart_energy_switch_power_9_4
    - sensor.aeotec_smart_energy_switch_previous_reading_9_1

aeotec_smart_switch_1:
  name: washer
  entities:
    - switch.aeotec_smart_switch_6_switch_10_0
    - sensor.aeotec_smart_switch_6_voltage_10_16
    - sensor.aeotec_smart_switch_6_current_10_20
    - sensor.aeotec_smart_switch_6_power_10_8
    - sensor.aeotec_smart_switch_6_previous_reading_10_1

aeotec_smart_switch_2:
  name: dryer
  entities:
    - switch.aeotec_smart_switch_6_switch_11_0
    - sensor.aeotec_smart_switch_6_voltage_11_16
    - sensor.aeotec_smart_switch_6_current_11_20
    - sensor.aeotec_smart_switch_6_power_11_8
    - sensor.aeotec_smart_switch_6_previous_reading_11_1

ecobee:
  name: ecobee
  entities:
    - sensor.operating_mode
    - climate.main_floor
    - sensor.main_floor_humidity
    - sensor.main_floor_occupancy
    - sensor.main_floor_temperature
    - sensor.upstairs_occupancy
    - sensor.upstairs_temperature

outside:
  name: outside
  entities:
    - light.front_door
    - light.side_door
    - light.garage
    - light.landscape
    - binary_sensor.vision_zg8101_garage_door_detector_sensor_12_0

br_lights:
  name: br lights
  entities:
    - light.bedroom_left
    - light.bedroom_right

weather_statistics:
  name: weather statistics
  entities:
    - binary_sensor.temperature_up
    - binary_sensor.temperature_down
    - binary_sensor.pressure_up
    - binary_sensor.pressure_down
    - binary_sensor.humidity_up
    - binary_sensor.humidity_down
    - binary_sensor.wind_speed_up
    - binary_sensor.wind_speed_down
    - binary_sensor.precip_up
    - binary_sensor.precip_down
    - sensor.temperature_stats_mean
    - sensor.pws_wind_string

avg_temps:
  name: environmental
  entities:
    - sensor.average_main_temp
    - sensor.average_upstairs_temp

plex_activity:
  name: plex activity status
  entities:
    - sensor.nirvana_2

events:
  name: events
  entities:
    - sensor.event_title
    - sensor.event_description
    - sensor.event_allday
    - sensor.event_start
    - sensor.event_end

laundry:
  name: laundry
  entities:
    - sensor.washer_pwrup
    - sensor.dryer_pwrup

interior_cams:
  name: interior cams
  entities:
    - camera.interior_street_facing_controllable
    - camera.rear_facing_controllable
    - camera.interior_bedroom_fixed

exterior_cams:
  name: exterior cams
  entities:
    - camera.outside_front_left_fixed
    - camera.outside_front_right_fixed

wink_devices:
  name: wink devices
  entities:
    - binary_sensor.main_hub
    - binary_sensor.wink_relay
    - binary_sensor.philips_hue

almanac:
  name: almanac
  entities:
    - sun.sun
    - sensor.nextsunrise
    - sensor.nextsunset
    - sensor.moon
    - sensor.dayofyear
    - sensor.weekofyear

aqi:
  name: air quality index
  entities:  
    - sensor.waqi_rahway_pm_newjersey

camera_presets:
  name: camera presets
  entities:
    - script.f_ir_off
    - input_select.camera1
    - input_select.camera2

ring:
  name: ring doorbell
  entities:
    - binary_sensor.front_door_button_pressed
    - binary_sensor.front_door_motion
    - sensor.ring_first_floor_volume
    - sensor.ring_front_door_last_activity
    - sensor.ring_front_door_motion_sensor
    - sensor.ring_front_door_volume
    - sensor.ring_front_door_battery

#wink_status:
#  name: Wink System Status
#  entities:
#    - sensor.wink_core_api
#    - sensor.wink_hub_api
#    - sensor.winkcom
#   - sensor.tcp_integration
#    - sensor.echo_integration

error on save attempt:

17-03-14 13:55:37 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/hass/deps/aiohttp/web_server.py", line 62, in handle_request
    resp = yield from self._handler(request)
  File "/home/hass/deps/aiohttp/web.py", line 270, in _handle
    resp = yield from handler(request)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 417, in handle
    result = yield from result
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/config/__init__.py", line 110, in post
    yield from hass.loop.run_in_executor(None, _write, path, current)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/config/__init__.py", line 134, in _write
    data = dump(data)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 75, in dump
    .replace(': null\n', ':\n')
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/__init__.py", line 216, in safe_dump
    return dump_all([data], stream, Dumper=SafeDumper, **kwds)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/__init__.py", line 188, in dump_all
    dumper.represent(data)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/representer.py", line 26, in represent
    node = self.represent_data(data)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/representer.py", line 47, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 308, in <lambda>
    represent_odict(dumper, u'tag:yaml.org,2002:map', value))
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 290, in represent_odict
    node_value = dump.represent_data(item_value)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/representer.py", line 47, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 308, in <lambda>
    represent_odict(dumper, u'tag:yaml.org,2002:map', value))
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/yaml.py", line 290, in represent_odict
    node_value = dump.represent_data(item_value)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/representer.py", line 57, in represent_data
    node = self.yaml_representers[None](self, data)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/yaml/representer.py", line 229, in represent_undefined
    raise RepresenterError("cannot represent an object: %s" % data)
yaml.representer.RepresenterError: cannot represent an object: ['updater.updater', 'persistent_notification.invalid_config', 'group.laundry', 'group.forecast', 'group.avg_temps', 'group.perimiter', 'group.outdoor_lighting', 'group.motion_sensors', 'group.ecobee', 'group.presence', 'group.alarm_system', 'group.events', 'group.almanac', 'camera.robert', 'group.ring', 'group.traffic_info']
rpitera commented 7 years ago

This is still an issue in 0.40.1. I have a feeling it may be due to a a fundamental lack of knowledge on how it is supposed to work with users who were already using includes prior, but there has been no explanation nor is there one in the documentation.

officiallybob commented 7 years ago

Just here to state that I am experiencing the same problem with saving a group view.

acockburn commented 7 years ago

Me too - the error:

Mar 16 16:16:36 Pegasus hass[24681]: 17-03-16 16:16:36 ERROR (MainThread) [aiohttp.server] Error handling request
Mar 16 16:16:36 Pegasus hass[24681]: Traceback (most recent call last):
Mar 16 16:16:36 Pegasus hass[24681]:   File "/home/hass/deps/aiohttp/web_server.py", line 62, in handle_request
Mar 16 16:16:36 Pegasus hass[24681]:     resp = yield from self._handler(request)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/home/hass/deps/aiohttp/web.py", line 270, in _handle
Mar 16 16:16:36 Pegasus hass[24681]:     resp = yield from handler(request)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
Mar 16 16:16:36 Pegasus hass[24681]:     return (yield from handler(request))
Mar 16 16:16:36 Pegasus hass[24681]:   File "/usr/lib/python3.5/asyncio/coroutines.py", line 209, in coro
Mar 16 16:16:36 Pegasus hass[24681]:     res = yield from res
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 417, in handle
Mar 16 16:16:36 Pegasus hass[24681]:     result = yield from result
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/components/config/__init__.py", line 110, in post
Mar 16 16:16:36 Pegasus hass[24681]:     yield from hass.loop.run_in_executor(None, _write, path, current)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
Mar 16 16:16:36 Pegasus hass[24681]:     yield self  # This tells Task to wait for completion.
Mar 16 16:16:36 Pegasus hass[24681]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
Mar 16 16:16:36 Pegasus hass[24681]:     future.result()
Mar 16 16:16:36 Pegasus hass[24681]:   File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
Mar 16 16:16:36 Pegasus hass[24681]:     raise self._exception
Mar 16 16:16:36 Pegasus hass[24681]:   File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
Mar 16 16:16:36 Pegasus hass[24681]:     result = self.fn(*self.args, **self.kwargs)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/components/config/__init__.py", line 134, in _write
Mar 16 16:16:36 Pegasus hass[24681]:     data = dump(data)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/util/yaml.py", line 74, in dump
Mar 16 16:16:36 Pegasus hass[24681]:     return yaml.safe_dump(_dict, default_flow_style=False) \
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/__init__.py", line 216, in safe_dump
Mar 16 16:16:36 Pegasus hass[24681]:     return dump_all([data], stream, Dumper=SafeDumper, **kwds)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/__init__.py", line 188, in dump_all
Mar 16 16:16:36 Pegasus hass[24681]:     dumper.represent(data)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/representer.py", line 26, in represent
Mar 16 16:16:36 Pegasus hass[24681]:     node = self.represent_data(data)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/representer.py", line 47, in represent_data
Mar 16 16:16:36 Pegasus hass[24681]:     node = self.yaml_representers[data_types[0]](self, data)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/util/yaml.py", line 308, in <lambda>
Mar 16 16:16:36 Pegasus hass[24681]:     represent_odict(dumper, u'tag:yaml.org,2002:map', value))
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/util/yaml.py", line 290, in represent_odict
Mar 16 16:16:36 Pegasus hass[24681]:     node_value = dump.represent_data(item_value)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/representer.py", line 47, in represent_data
Mar 16 16:16:36 Pegasus hass[24681]:     node = self.yaml_representers[data_types[0]](self, data)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/util/yaml.py", line 308, in <lambda>
Mar 16 16:16:36 Pegasus hass[24681]:     represent_odict(dumper, u'tag:yaml.org,2002:map', value))
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/homeassistant/util/yaml.py", line 290, in represent_odict
Mar 16 16:16:36 Pegasus hass[24681]:     node_value = dump.represent_data(item_value)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/representer.py", line 57, in represent_data
Mar 16 16:16:36 Pegasus hass[24681]:     node = self.yaml_representers[None](self, data)
Mar 16 16:16:36 Pegasus hass[24681]:   File "/export/hass/hass_env/lib/python3.5/site-packages/yaml/representer.py", line 229, in represent_undefined
Mar 16 16:16:36 Pegasus hass[24681]:     raise RepresenterError("cannot represent an object: %s" % data)
Mar 16 16:16:36 Pegasus hass[24681]: yaml.representer.RepresenterError: cannot represent an object: ['sun.sun', 'sensor.yr_symbol', 'group.weather3', 'group.weather1', 'group.weather2']

in m y config:

group: !include group.yaml

My groups aredefined in group.yaml:

#
# Tabs
#

#test:
default_view:
  name: General
  view: yes
  entities:
    - script.test
    - group.main_scenes
    - group.info
    - group.status
    - updater.updater
    - sensor.yr_symbol
    - sensor.side_temp_corrected
    - device_tracker.dedb5e711a24415baaae5cf8e880d852
    - device_tracker.24dcbba223194e62b7965aa9012b1ad0
    - device_tracker.andrews_iphone
    - script.morning
    - script.day
    - script.evening
    - script.night

outside:
  name: Outside
  view: yes
  entities:
    - group.outside_porch_info
    - group.outside_side_info
    - group.outside_drive_info
    - group.outside_scenes
    - group.outside_lights

garage:
  name: Garage
  view: yes
  entities:
    - group.garage_information

basement:
  name: Basement
  view: yes
  entities:
    -  group.basement_information
    -  group.basement_media

downstairs:
  name: Downstairs
  view: yes
  entities:
    - group.downstairs_information
    - group.downstairs_scenes
    - group.downstairs_lights
    - group.downstairs_media

upstairs:
  name: Upstairs
  view: yes
  entities:
    - group.upstairs_information
    - group.upstairs_scenes
    - group.upstairs_lights

weather:
  name: Weather
  view: yes
  entities:
    - sun.sun
    - sensor.yr_symbol
    - group.weather1
    - group.weather2
    - group.weather3

heating_and_cooling:
  name: Heating and Cooling
  view: yes
  entities:
    - group.heat_control
    - group.basement_heat
    - group.downstairs_heat
    - group.upstairs_heat

ha_status:
  name: HA Controls
  view: yes
  entities:
    - group.home_assistant_status
    - group.ha_controls
    - group.ha_alarm
    - group.ha_batteries

#
# Groups
#

info:
  name: Information
  entities:
    - sensor.date__time
    - sensor.side_multisensor_luminance_25_3
    - sun.sun
    - sensor.dark_sky_temperature
    - sensor.dark_sky_apparent_temperature
    - sensor.dark_sky_summary
    - sensor.dark_sky_precip_probability
    - sensor.dark_sky_pressure
    - sensor.dark_sky_humidity
    - sensor.dark_sky_dew_point

status:
  name: Status
  control: hidden
  entities:
    - input_select.house_mode
    - sensor.presence_mode
    - switch.garage_door
    - binary_sensor.porch_multisensor_sensor_27_0
    - input_boolean.heating
    - input_boolean.cooling
    - sensor.thermostat_set
    - sensor.downstairs_thermometer
    - sensor.upstairs_thermometer
    - sensor.vacation_mode
    - sensor.guest_mode
    - sensor.upstairs_smoke
    - sensor.downstairs_smoke
    - sensor.basement_smoke

main_scenes:
  name: Scenes
  entities:
    - scene.house_bright
    - scene.house_off
    - scene.downstairs_on
    - scene.downstairs_on_transition
    - scene.downstairs_off
    - scene.downstairs_dim
    - scene.downstairs_bright
    - scene.wendys_lamp
    - scene.porch_on
    - scene.porch_off
    - scene.outside_bright
    - scene.outside_off
    - scene.upstairs_on
    - scene.upstairs_off

garage_information:
  name: Garage Information
  control: hidden
  entities:
    - switch.garage
    - binary_sensor.garage_sensor_36_0

porch_light:
  entities:
    - light.porch_1
    - light.porch_2

outside_lights:
  name: Outside Lights
  control: hidden
  entities:
    - light.porch_1
    - light.porch_2
    - light.drive
    - switch.front_path_switch_42_0
    - switch.outside_decorations_switch_23_0

outside_scenes:
  name: Outside Scenes
  entities:
    - scene.porch_off
    - scene.porch_on
    - scene.drive_off
    - scene.drive_on
    - scene.outside_bright
    - scene.outside_off

outside_porch_info:
  name: Porch
  entities:
    - binary_sensor.porch_multisensor_sensor_27_0
    - sensor.porch_multisensor_luminance_27_3
    - sensor.porch_multisensor_temperature_27_1
    - sensor.porch_multisensor_relative_humidity_27_5

outside_side_info:
  name: Side of House
  entities:
    - binary_sensor.side_multisensor_sensor_25_0
    - sensor.side_multisensor_luminance_25_3
    - sensor.side_temp_corrected
    - sensor.side_humidity_corrected

outside_drive_info:
  name: Drive
  entities:
    - binary_sensor.drive_sensor_39_0
    - sensor.drive_luminance_39_3
    - sensor.drive_temperature_39_1
    - sensor.drive_relative_humidity_39_5

downstairs_lights:
  name: Downstairs Lights
  control: hidden
  entities:
    - light.living_room_front
    - light.kitchen
    - light.living_room
    - light.wendys_lamp
    - light.andrews_lamp
    - light.downstairs_hall
    - light.jacks_lamp
    - light.den_lamp
    - switch.main_tree_switch_40_0
    - switch.animal_tree_switch_41_0

decorations:
  name: Decorations
  entities:
    - switch.main_tree_switch_40_0
    - switch.animal_tree_switch_41_0

downstairs_scenes:
  name: Downstairs Scenes
  entities:
    - scene.downstairs_off
    - scene.downstairs_on
    - scene.downstairs_on_transition
    - scene.downstairs_dim
    - scene.downstairs_bright
    - scene.wendys_lamp
    - scene.jacks_heat_lamp
    - scene.jacks_heat_lamp_off

downstairs_information:
  name: Information
  entities:
    - sensor.downstairs_smoke
    - binary_sensor.downstairs_sensor_26_0_0

downstairs_media:
  name: Downstairs Media
  entities:
    media_player.living_room

basement_information:
  name: Basement Information
  entities:
    - sensor.basement_smoke
    - binary_sensor.basement_sensor_35_0_0

basement_media:
  name: Basement Media
  entities:
    media_player.roku_63261w020748

office_light:
  entities:
    - light.office_1
    - light.office_2

upstairs_lights:
  name: Upstairs Lights
  control: hidden
  entities:
    - group.office_light
    - light.office_lamp
    - light.upstairs_hall
    - light.andrew_bedside
    - light.wendy_bedside

upstairs_scenes:
  name: Upstairs Scenes
  entities:
    - scene.office_on
    - scene.office_off
    - scene.office_bright
    - scene.office_dim
    - scene.upstairs_off
    - scene.upstairs_on
    - scene.upstairs_bright
    - scene.upstairs_dim

upstairs_information:
  name: Information
  entities:
    - sensor.upstairs_smoke
    - binary_sensor.upstairs_sensor_28_0

weather1:
  name: Current Forcecast
  entities:
    - sensor.dark_sky_minutely_summary
    - sensor.dark_sky_hourly_summary
    - sensor.dark_sky_daily_summary
    - sensor.dark_sky_icon
    - sensor.dark_sky_temperature
    - sensor.dark_sky_apparent_temperature
    - sensor.dark_sky_humidity

weather2:
  name: Outlook
  entities:
    - sensor.dark_sky_nearest_storm_distance
    - sensor.dark_sky_nearest_storm_bearing
    - sensor.dark_sky_precip_type
    - sensor.dark_sky_precip_intensity
    - sensor.dark_sky_precip_probability
    - sensor.dark_sky_dew_point

weather3:
  name: Specifics
  entities:
    - sensor.dark_sky_wind_speed
    - sensor.dark_sky_wind_bearing
    - sensor.dark_sky_cloud_cover
    - sensor.dark_sky_visibility
    - sensor.dark_sky_pressure
    - sensor.dark_sky_ozone

heat_control:
  name: Control
  control: hidden
  entities:
    - input_boolean.heating
    - input_boolean.cooling

basement_heat:
  name: Basement
  entities:
    - climate.basement_thermostat_heating_1_24_1
    - sensor.basement_thermostat_relative_humidity_24_5

downstairs_heat:
  name: Downstairs
  entities:
    - climate.downstairs_thermostat_heating_1_51_1
    - sensor.downstairs_thermostat_relative_humidity_51_5_3

upstairs_heat:
  name: Upstairs
  entities:
    - climate.upstairs_thermostat_heating_1_14_1
    - sensor.upstairs_thermostat_relative_humidity_14_5

Home Assistant Status:
    - script.restart_ha
    - weblink.reload
    - sensor.cpu_use
    - sensor.ram_free
    - sensor.disk_free_home
    - sensor.last_boot

ha_controls:
  name: Home Assistant Controls
  control: hidden
  entities:
    - input_select.house_mode
    - input_boolean.heating
    - input_boolean.vacation
    - input_boolean.guest
    - input_boolean.motion_notifications
    - configurator.philips_hue
    - script.andrew_home
    - script.wendy_home
    - script.andrew_away
    - script.wendy_away
    - input_slider.test
    - input_slider.rene

ha_alarm:
  name: Home Assistant Alarm
  entities:
    alarm_control_panel.ha_alarm

And I see this in groups.yaml which actually seems to be what the exception is referencing:

weather:
  entities:
  - sun.sun
  - sensor.yr_symbol
  - group.weather3
  - group.weather1
  - group.weather2
  name: Weather
  view: true

As rpitera said, it wasn;t clear to me if we could even use our existing groups, but it seems to work apart from this. Also, is groups.yaml a significant name?

Perhaps better docs could clarify this.

rpitera commented 7 years ago

If the format of groups has changed, can someone tell us the proper format? Seems to me this would be a breaking change.

rpitera commented 7 years ago

I thought maybe you were on to something with view: true as opposed to view: yes (which is how the docs currently show it) but there was no difference in the behavior or the text of the error message.

In my case, the error references the default_view contents, which is (after updating the views):

#
#  Views
#
default_view:
  view: true
  entities:
    - updater.updater
    - persistent_notification.invalid_config
    - group.laundry
    - group.forecast
    - group.avg_temps
    - group.perimiter
    - group.outdoor_lighting
    - group.motion_sensors
    - group.ecobee
    - group.presence
    - group.alarm_system
    - group.events
    - group.almanac
    - camera.robert
    - group.ring
    - group.traffic_info
dpritt commented 7 years ago

I love the fact that this product is evolving, but please can we have some clear documentation when there are fundamental changes to the configuration file structure. I have followed previous advice and have separate include files, but the on-line converter will not work with these, and I don't understand enough, being a relatively new to HASS, the 'old' structures enough to manually convert my customize.yaml to the new format. I have been trying for several days and given up, I don't have the time to devote to debugging this when a few clear instructions and examples would help a lot. Old documents need to be marked up as pre 0.39 structures if the don't work now, with new ones shown as 0.39 and later. I also broke my Z-wave trying to use the new format as this must format differently than the layouts shown in the existing documentation. I have reverted back to my old yaml files, which seem to work so far to get my home automated again.

DubhAd commented 7 years ago

@dpritt - this has nothing to do with customize.yaml, and the documentation, but with issues with the new groups configuration through the UI. I'd personally suggest too that documentation feedback is better placed in the forum, where you'll find a number of threads on the issue you can add your voice to.

dpritt commented 7 years ago

DubhAd, sorry but groups can be part of the customize.yaml if you wish, so it is relevant. My issue is there seems to be several different ways of doing the same thing now with HA, and the documentation is very confusing now. As a IT professional I would never allow releases to be done with out enough documentation to make it clear to users what they need to do to convert from an old data structure to a new structure. I am sure you old hands know what to do, but I have only been using HA a few months, so finding that what I have learnt so far is now being changed, but without documentation is not encouraging me. I am sure I am not alone in finding the documentation confusing when it refers to depreciated methods.

DubhAd commented 7 years ago

@dpritt - no, I get it. The documentation is far from great (though, given the rapid development, that's kind of to be expected). However, this is a bug report about the group configuration in the new UI. If you've got an issue with that, posting relevant data and log examples in this bug report will help the developers.

Posting feedback, or complaining about other issues, isn't going to help you, and just risks adding confusion to the bug report. That's why I suggested the forum, where you'll be more likely to get help, and have people listen to your feedback.

rpitera commented 7 years ago

Further testing update - Removed:

    - updater.updater
    - persistent_notification.invalid_config

From groups.yaml as the two items (which work fine, BTW) show up as unknowns in the GUI.

Doing so has moved my error message from referencing the default_view to referencing the next group down in the group list. It really seems like the accepted format must have changed but there is no information about it and no mention of it in the 'documentation' which really only serves to show pictures and descriptions of what config looks like.

Nothing in the PRs for 0.41 indicate anything has been done with this either. Could really use some guidance from the core here about whether this should really work is more of a placeholder for future release.

rpitera commented 7 years ago

Would be great if @balloob could look into this because as of 0.41 it is still broken and I think he's the only one who can tell us why.

rpitera commented 7 years ago

Still an issue in 0.42.2. Wish someone would at least look into this issue. Doesn't make sense to release feature in .39.x and still not even address the fact that it never worked.

rpitera commented 7 years ago

Throwing out another call to @balloob to ask you to look into this. A comment, some questions, anything at all regarding this issue?

balloob commented 7 years ago

I'm super busy, it's not on the top of my list. Help welcome.

rpitera commented 7 years ago

Let us know how we can help. What information can we gather or analyze?

rpitera commented 7 years ago

Thank you so much, @balloob!