J3n50m4t / Home-Assistant-DreamScreen-Service

Home Assistant Service for sending commands to a Wifi enabled DreamScreen
MIT License
31 stars 15 forks source link

Support for Dreamscreen solo #19

Closed AndreKSB closed 5 years ago

AndreKSB commented 5 years ago

I have a Dreamscreen Solo that I'm trying to link to Home Assistant. I end up getting the following error message: Unknown Device type: 7. I think this is simply because DS created a new type for the Solo next to the HD and 4K versions. In the message received from the Solo one can even conclude that the HDMI-inputs are 'supported' although the Solo only has 1 input and no outputs. I went through the python code and I cannot figure what to change in the code itself to get my Solo working with your great work.

I hope this is a simple fix and you can guide me to the right lines in the python code.

Andre Klap

2019-06-21 15:07:31 INFO (MainThread) [homeassistant.setup] Setting up dreamscreen
2019-06-21 15:07:31 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=dreamscreen, service=set_mode>
2019-06-21 15:07:31 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=dreamscreen, service=set_hdmi_source>
2019-06-21 15:07:31 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=dreamscreen, service=set_brightness>
2019-06-21 15:07:31 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=dreamscreen, service=set_ambient_scene>
2019-06-21 15:07:31 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=dreamscreen, service=set_ambient_color>
2019-06-21 15:07:31 DEBUG (MainThread) [custom_components.dreamscreen] Discovery Timeout: 1
2019-06-21 15:07:31 DEBUG (MainThread) [custom_components.dreamscreen] Configured devices: 1
2019-06-21 15:07:31 DEBUG (MainThread) [custom_components.dreamscreen] Adding dreamscreen_solo - 192.168.0.169 [Timeout: 99]
2019-06-21 15:07:31 DEBUG (MainThread) [pydreamscreen.devices] Listening...
2019-06-21 15:07:31 DEBUG (MainThread) [pydreamscreen.devices] Received b'\xfc\x92\xff`\x01\nDreamScreen Solounassigned\x00\x00\x00\x00\x00\x00\x00\x00d\x0f\xff\xff\xff\xff\xff%\x1a\xff\xc4\xff\x0c\x18HH\x01\x07\x00\x00\x02\x01222\x00\x00\x00\x01\x04\x00\xcd \x00\x00\x00\x00\x00\x02\x00\x00HDMI 1          HDMI 2          HDMI 3          \x01\x01\x01\x1b\x00\x00\x00\x01\x06\x06\x02\x00\x00\x03\x01\x00\x00\x07g' from 192.168.0.169 [8888]
2019-06-21 15:07:31 DEBUG (MainThread) [pydreamscreen.devices] Processing state from 192.168.0.169 [8888]
2019-06-21 15:07:31 DEBUG (MainThread) [pydreamscreen.devices] Unknown device type: 7
2019-06-21 15:09:10 ERROR (MainThread) [pydreamscreen.devices] couldn't get_state of 192.168.0.169
2019-06-21 15:09:10 WARNING (MainThread) [custom_components.dreamscreen] Failed to add device [192.168.0.169] dreamscreen_solo. Try setting a 'timeout' in the device config.
2019-06-21 15:09:10 INFO (MainThread) [homeassistant.setup] Setup of domain dreamscreen took 99.2 seconds.
2019-06-21 15:09:10 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=dreamscreen>
J3n50m4t commented 5 years ago

I went through the python code and I cannot figure what to change in the code itself to get my Solo working with your great work.

First guess, you looked into the wrong repo. This is only the HA bridge and loads PyDreamscreen

I have no time right now. But here is the quickstart: Pydreamscreen throwing your error. Your Message contains 7 and the code doesn't handle it yet. See here https://github.com/GregoryDosh/pydreamscreen/blob/4e2c72e4d79fa8b0a4153cb6e5ea39cecc7d40cc/pydreamscreen/devices.py#L110

I'll check later.

AndreKSB commented 5 years ago

Hi Gregory,

Thanks for the tip. I got it working in the meantime !!

I was not aware of the pydreamscreen (I’m a newbie to home assistant and docker and python, but I have some background in C++, so I managed) 😊

Attached the updated files

init.py from the custom_components/dreamscreen folder in init.zip

Pydreamscreen/__initi.py & devices.py in PYDREAMSCREEN_SOLO.zip

init.zip

J3n50m4t commented 5 years ago

Hi,

I'm not Gregory :D Happy you got it. I would file a PR if you don't want to.. If @GregoryDosh doesn't want to maintain the tool i may have to, because i love it. But tahts another story.

Could you close the Issue, as its done please?

GregoryDosh commented 5 years ago

Sorry I've not been active with this. I've moved across country and been unable to get much coding done along with the fact that my Dreamscreen is still back in my previous house at the moment. @J3n50m4t thank you for your pull requests & help.

AndreKSB commented 5 years ago

Thanks J3n50m4t :)

J3n50m4t commented 5 years ago

I've "merged" your commit to both Repos.

Next time it would be nice if you create a PR.

HA Dreamscreen commit ID:235b1ee965d090d605511fa535c24db6e5bd8dca

pydreamscreen commit ID: e355c10b11107e3c56d0d68d6a23e52d2d71902b