basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.71k stars 127 forks source link

Extra keys error when using ```turn_on_lights``` in the ```change_switch_settings``` service #951

Open euinor opened 3 months ago

euinor commented 3 months ago

Home Assistant Adaptive Lighting Issue Template

Bug Reports

If you need help with using or configuring Adaptive Lighting, please open a Q&A discussion thread here instead.

Before submitting a bug report, please follow these troubleshooting steps:

Please confirm that you have completed the following steps:

Required information for bug reports:

Please include the following information in your issue.

Issues missing this information may not be addressed.

  1. Debug logs captured while the issue occurred. See here for instructions on enabling debug logging:
2024-03-13 12:14:16.455 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['turn_on_lights']
2024-03-13 12:14:16.457 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546222617152] Error handling message: extra keys not allowed @ data['turn_on_lights']. Got None (invalid_format) Caleb from 45.95.156.237 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36)
  1. Your Adaptive Lighting configuration: I can't find how to export my configuration in YAML format...

  2. (If using Zigbee2MQTT), provide your configuration files (remove all personal information before posting): N/A

  3. Describe the bug and how to reproduce it: Extra keys error when using turn_on_lights in the change_switch_settings service

  4. Steps to reproduce the behavior: In developer tools, call this service

    service: adaptive_lighting.change_switch_settings
    data:
    use_defaults: current
    entity_id: switch.adaptive_lighting_nursery
    turn_on_lights: true

    It results in this error

    Failed to call service adaptive_lighting.change_switch_settings. extra keys not allowed @ data['turn_on_lights']. Got None
th3w1zard1 commented 3 months ago

After reading your post I'm finding it hard to find the problem. Could you enable debug logging and post those here if you don't mind?

xenokira commented 2 months ago

I'm running into the same problem. Below are the service call and related log entries. Just installed v1.21.0 and confirmed the issue persists.

service call:

service: adaptive_lighting.change_switch_settings
data:
  use_defaults: configuration
  entity_id: switch.adaptive_lighting_main_office_lights_lamps
  prefer_rgb_color: false
  only_once: false
  separate_turn_on_commands: false
  send_split_delay: false
  sleep_rgb_or_color_temp: rgb_color
  sleep_rgb_color:
    - 255
    - 0
    - 0
  take_over_control: false
  detect_non_ha_changes: false
  autoreset_control_seconds: "0"
  turn_on_lights: true

related logs:

2024-04-08 10:20:02.525 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['turn_on_lights']
2024-04-08 10:20:02.525 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140023697519680] Error handling message: extra keys not allowed @ data['turn_on_lights']. Got None (invalid_format) <NAME> from <IPv4> (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0)