mattsaxon / HASS-SpeakercraftMediaPlayer

Speakercraft Platform for Home Assistant
4 stars 1 forks source link

Error after adding configuration.yaml #28

Closed BrentMcInnes closed 2 years ago

BrentMcInnes commented 2 years ago

So I have set aside the ESP32 since that seems to be overly complicated when my Pi4 and MZC are beside each other. I used a USB to DB9 to control jack on the MZC. I installed Matt’s SpeakercraftMediaPlayer using HACS - it looks like it installed correctly. I added the configuration.yaml and it save without errors. But I’m getting this error - any ideas why?:

2022-01-31 14:40:17 WARNING (MainThread) [homeassistant.config_entries] Config entry 'HP DeskJet 2600 series [350839]' for ipp integration not ready yet: Invalid response from API: Error occurred while communicating with IPP server.; Retrying in background 2022-01-31 14:40:17 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:40:17 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Fire Tablet 1 fb80b4cb-1b202abf' for fullykiosk integration not ready yet: None; Retrying in background 2022-01-31 14:40:24 WARNING (MainThread) [homeassistant.components.camera] Setup of camera platform environment_canada is taking over 10 seconds. 2022-01-31 14:40:51 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:41:04 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:41:27 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:42:10 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:43:34 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:44:57 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:46:20 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:47:43 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:49:03 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:50:23 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform fullykiosk.binary_sensor: Platform not found (cannot import name 'BinarySensorDeviceClass' from 'homeassistant.components.binary_sensor' (/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py)). 2022-01-31 14:50:24 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform fullykiosk.sensor: Platform not found (cannot import name 'SensorDeviceClass' from 'homeassistant.components.sensor' (/usr/src/homeassistant/homeassistant/components/sensor/init.py)). 2022-01-31 14:50:24 ERROR (MainThread) [homeassistant.setup] Setup failed for button: Integration not found. 2022-01-31 14:50:24 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform fullykiosk.number: Platform not found (cannot import name 'EntityCategory' from 'homeassistant.helpers.entity' (/usr/src/homeassistant/homeassistant/helpers/entity.py)). 2022-01-31 14:52:55 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error requesting 192.168.1.129 deviceInfo data: Server disconnected 2022-01-31 14:53:22 ERROR (MainThread) [homeassistant.components.hassio] The system cannot restart because the configuration is not valid: Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) 2022-01-31 14:53:22 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547314486816] The system cannot restart because the configuration is not valid: Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/components/hassio/init.py", line 562, in async_handle_core_service raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) 2022-01-31 14:54:55 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:57:25 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 14:58:43 WARNING (SyncWorker_3) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2022-01-31 14:58:55 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 15:01:13 WARNING (SyncWorker_1) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2022-01-31 15:03:28 ERROR (MainThread) [homeassistant.components.hassio] The system cannot restart because the configuration is not valid: Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) 2022-01-31 15:03:28 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547314486816] The system cannot restart because the configuration is not valid: Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/components/hassio/init.py", line 562, in async_handle_core_service raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) 2022-01-31 15:11:02 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 15:16:04 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 15:17:13 WARNING (SyncWorker_1) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2022-01-31 15:19:43 WARNING (SyncWorker_5) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2022-01-31 15:23:13 WARNING (SyncWorker_6) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2022-01-31 15:30:40 ERROR (MainThread) [custom_components.fullykiosk.coordinator] Error fetching 192.168.1.129 deviceInfo data: Cannot connect to host 192.168.1.129:2323 ssl:default [Connect call failed ('192.168.1.129', 2323)] 2022-01-31 15:39:43 WARNING (SyncWorker_3) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2022-01-31 15:40:43 WARNING (SyncWorker_0) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi.

mattsaxon commented 2 years ago

@BrentMcInnes , please post the relevant part of your configuration.yaml.

This is what the error suggest is the problem Component error: speakercraft_media - cannot import name 'Platform' from 'homeassistant.const'

BrentMcInnes commented 2 years ago

Here's the config yaml

media_player:
   Use the Python ADB implementation
  - platform: androidtv
    name: Theatre FIRE TV
    device_class: androidtv
    host: 192.168.1.41
    exclude_unnamed_apps: true
    apps:
      com.amazon.tv.launcher: "Fire TV"
      turn_on_command: "input keyevent 3"
    turn_off_command: "input keyevent 223"
    state_detection_rules:
      'com.amazon.tv.launcher':
        - 'standby'

speakercraft_media:
        zones: 
          1: "Dining Room"
          2: "Kitchen Speakers"
          3: "Deck"
          4: "Family Room"
          5: "Bedrooom"
          6: "Garage"
          7: " "
          8: " "
        serial_port: "/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0"
        sources:
          1: "DVD"
          2: "Alexa"
          3: "BellTV1"
          4: "BellTV2"
        default_volume: 20
        default_source: 5
        power_target: switch.speakercraft
sjeffrey101 commented 2 years ago

that seems to have messed up the formatting quite alot.... which is important in yaml.

maybe a screenshot would help. (edit: or attach the file)

Also have you updated the serial_port to your own, and have you got a switch.speakercraft in your system? Its not clear, but if you dont have a smart plug, then just delete that line.

mattsaxon commented 2 years ago

@sjeffrey101, I've put code comments around it to address the formatting.

mattsaxon commented 2 years ago

I wonder if this is line 8 of speakercraft_media

from homeassistant.const import CONF_HOST, CONF_NAME, Platform

This could be down to HA versions, but I note that this import is not required.

@BrentMcInnes can you try manually removing that line and seeing if it changes you issue?

BrentMcInnes commented 2 years ago

I was a couple versions old on HA - once I updated the core the Speakercraft MediaPlayer showed up - dumb mistake on my part. Thanks for the help!

sjeffrey101 commented 2 years ago

@BrentMcInnes nice one. so is it working for you now?

BrentMcInnes commented 2 years ago

Yup - seems to be good now. Just need to add some dashboard cards