Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when run in Lovelace #1

Open
rossemerson opened this issue Apr 2, 2019 · 10 comments
Open

Errors when run in Lovelace #1

rossemerson opened this issue Apr 2, 2019 · 10 comments

Comments

@rossemerson
Copy link

I am having no luck with this integration. My Lightwave hub (Link first gen) is not recognised by Home Assistant when an entity is triggered. I get the following error if an entity is set or unset:

2019-04-02 13:26:14 ERROR (Thread-31) [lightwave.lightwave] LW broker timeout!
2019-04-02 13:26:30 ERROR (Thread-32) [lightwave.lightwave] LW broker timeout!
2019-04-02 13:27:00 ERROR (Thread-33) [lightwave.lightwave] LW broker timeout!
2019-04-02 13:27:20 ERROR (Thread-34) [lightwave.lightwave] LW broker timeout!
2019-04-02 13:28:42 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.2311963534336] Connection closed by client

I am running Home Assistant v0.90.2 with the Lovelave UI on a windows x64 machine. Any thoughts?

arch AMD64
dev false
docker false
hassio false
os_name Windows
os_version 10
python_version 3.7.3
version 0.90.2
virtualenv false
@GeoffAtHome
Copy link
Owner

@rossemerson The cause of this error is normally because the lightwave hub is not reachable from Home Assistant. This could be on a different subnet or the wrong IP address.

If you are using this version and not the one built into Home Assistant another cause could be that the Home Assistant is not registered on the hub. The Home Assistant version captures this error as "Not Registered".

You can always run the test code locally on any machine that supports Python and debug to see more details but my expectation is the IP address is wrong.

@rossemerson
Copy link
Author

rossemerson commented Apr 5, 2019 via email

@GeoffAtHome
Copy link
Owner

Hi Ross,

Running on Windows 10 should not be a problem. I use Windows 10 as my development platform and python is portable across different platforms. I.e. a python program will run on Windows, Mac or Linux - anywhere you can run python.

If you can download and install python it is relatively easier to setup a debug session in python to see what is going on. Much quicker that have to restart Home Assistant. If you are up for giving this a go I can provide you with the necessary instructions and what you need to do.

Cheers,
Geoff

@rossemerson
Copy link
Author

rossemerson commented Apr 5, 2019 via email

@GeoffAtHome
Copy link
Owner

Hi Ross,

So what are you running? Straight python or Docker? Your subnet mask looks wrong? How are you setting up your IP address? Reserved based on a MAC address or all static?

If you are running straight python your will have python already installed. If not you can download it from here: https://www.python.org/downloads/windows/ - you want the latest 3.x version (3.7.3).

This will install python and a tool call idle. Something like this will help you: http://www.pitt.edu/~naraehan/python3/getting_started_win_first_try.html

Next is to down load the test script for LightWave and run it with the debugger. In the script you will need to adjust the IP address and the device setting. The important thing is it will provide more information. I'll get this over to you shortly.

But hold on.... you are running 0.90.2 - the instructions on this page are out of date as LightWave is now built into HA. You do not need to have a custom component. You should delete anything you have downloaded from here and update your configuration files with the instructions here: https://www.home-assistant.io/components/lightwave/

Sorry - I should have noticed that when you first asked.

If it is the version in HA that is not working then we can continue with the debugging.

Cheers,
Geoff

@GeoffAtHome
Copy link
Owner

@rossemerson Where are you seeing a subnet of 255.255.255.255?

@rossemerson
Copy link
Author

rossemerson commented Apr 6, 2019 via email

@GeoffAtHome
Copy link
Owner

Hi Ross,

Did you install Lightwaverf-home-assistant from here or via the HA site?

One reason for this issue is that two many devices have been registered with the hub. This is unlikely but possible. I had this happen to me.

Fortunately it is possible to resolve this issue but it does have the side-effect of un-registering all devices.

Download the contents from here: https://github.com/GeoffAtHome/lightwave/tree/master/lightwave to a new directory, for example, c:\test-lightwave

In the c:\test-lightwave directory create a file test.py and paste this content into the file:

import asyncio
import time
from lightwave.lightwave import LWLink

async def main():
    lwLink = LWLink('192.168.15.226')

    # Unregister all devices with hub
    link.deregister_all()

    print("Off")
    ### R1D3 is room 1 device 3
    lwLink.turn_off('R1D3', "Wall Lights")

    time.sleep(5)
    print("On")
    lwLink.turn_on_light('R1D3', "Wall Lights")

    time.sleep(5)
    print("Off")
    lwLink.turn_off('R1D3', "Wall Lights")

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Adjust the IP address and 'R#D#' as appropriate. Remove or add as many as you want to test.

When this code is executed it will deregister all devices with the hub and then switch a device on, then off. When the device is being turn on or off the hub should prompt you to press a button on the hub.

Let me know how you get on.

Cheers,
Geoff

@rossemerson
Copy link
Author

rossemerson commented Apr 8, 2019 via email

@GeoffAtHome
Copy link
Owner

Hi Ross,

Sorry this appears not to be working. Are you sure that nothing happens on the hub? Unless the hub is paired with the Mac address of your PC communications will always timeout. On the hub I have, which is fairly old, it displays a message prompting a button to be pressed. Nothing needs to be done with the app - it is all done on the hub.

Cheers,
Geoff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants