GeoffAtHome / lightwaverf-home-assistant-platform

Integration of LightwaveRF switches and lights with Home Assistant (HASS) as a platfrom
1 stars 1 forks source link

Errors when run in Lovelace #1

Open rossemerson opened 5 years ago

rossemerson commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

Hi Geoff

Many thanks for the response.

I still have the same issue. I’ve checked the IP address. It is correct and is a static address for both the LightwaveRF link and the HA server.

The linking here b information appears on the Lightwave app but the link light never appears as the blinking green light. I still immediately get the timeout error in the log.

The API documentation sheds no light.

I’m at a loss. I notice another user running on Linux has a similar issue. Could it be related to this as I am running on a windows 10 platform

Any thoughts are welcome. I’m no programmer and most of the documentation is either out of date or related to hass running on a RPi it seems.

KR Ross

Kind Regards

Ross


From: GeoffAtHome notifications@github.com Sent: Wednesday, April 3, 2019 8:59 a.m. To: GeoffAtHome/lightwaverf-home-assistant-platform Cc: rossemerson; Mention Subject: Re: [GeoffAtHome/lightwaverf-home-assistant-platform] Errors when run in Lovelace (#1)

@rossemersonhttps://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/GeoffAtHome/lightwaverf-home-assistant-platform/issues/1#issuecomment-479382133, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Au6qoDQ1gj2SedPkuG79vWKz9DZYeY21ks5vdF95gaJpZM4cX8b7.

GeoffAtHome commented 5 years ago

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 commented 5 years ago

Thanks for the help Geoff.

HA is working if a little buggy for me but I’m brand new to it. I had an old laptop so decided to repurpose it rather than go down the Raspberry Pi or Virtual server route.

If you could forward the debug instructions that would be most appreciated. I’ve no idea why it’s not working. I did notice that the subnet in the API was 255.255.255.255. I forwarded this in the config settings to no avail rather than passing the IP of the hub. My network uses 255.255.255.0 I think. Anyhow let’s debug and see what happens.

No rush on this. It will be next week before I can get around to this in any case.

Thanks so much

Ross

Kind Regards

Ross


From: GeoffAtHome notifications@github.com Sent: Friday, April 5, 2019 6:40 p.m. To: GeoffAtHome/lightwaverf-home-assistant-platform Cc: rossemerson; Mention Subject: Re: [GeoffAtHome/lightwaverf-home-assistant-platform] Errors when run in Lovelace (#1)

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/GeoffAtHome/lightwaverf-home-assistant-platform/issues/1#issuecomment-480361578, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Au6qoI5CqRCGEzf81TJvmiHqwA0nNcVWks5vd4p9gaJpZM4cX8b7.

GeoffAtHome commented 5 years ago

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 commented 5 years ago

@rossemerson Where are you seeing a subnet of 255.255.255.255?

rossemerson commented 5 years ago

[Image] [Image] Hi Geoff

I’m running straight Python, the latest version as downloaded directly from the python website. The .exe installer was used for the install and all seemed to work fine.

I have given my home assistant client a static IP address on my router. I can access the Lovelace UI directly using this IP with port 8123. My Lightwave link hub also has a static IP address so there shouldn’t be any issues there either.

I had downloaded the instructions for the Lightwave integration from the site and configured my rooms and devices accordingly in the .homeassistant/configuration.yaml file. See screenshot

Once restarted home assistant pulled in the necessary components. Hitting any configured light or switch is supposed to trigger the link to pair with the client. I get the correct message on the app to press the link button but the link never blinks to indicate it is in pairing mode. The LW broker timeout message occurs immediately on toggling any of the Lightwave entities.

I’m at a loss.

Kind Regards

Ross


From: GeoffAtHome notifications@github.com Sent: Saturday, April 6, 2019 10:15 a.m. To: GeoffAtHome/lightwaverf-home-assistant-platform Cc: rossemerson; Mention Subject: Re: [GeoffAtHome/lightwaverf-home-assistant-platform] Errors when run in Lovelace (#1)

@rossemersonhttps://github.com/rossemerson Where are you seeing a subnet of 255.255.255.255?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/GeoffAtHome/lightwaverf-home-assistant-platform/issues/1#issuecomment-480488698, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Au6qoMrrTjtMyacVAHX_vZM4XQC2RcAZks5veGWYgaJpZM4cX8b7.

GeoffAtHome commented 5 years ago

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 commented 5 years ago

Hi Geoff

I’ve followed your commands, created the folder, adjusted the variables and run the code to no avail. I can see the code run but nothing happens on the lightwave side of things. No response from the lightwave app, lights or link. If I create a fake IP address to ping then the code executes without finding anything tries again and fails.

Thanks for all your help but I am just taking up your time. I am finding home Assistant too glitchy for my needs so for now I’m think I’ll stick to Google Assistant. All my lights appear there (I have some Ikea and Hue bulbs also) and I can control them accordingly. The only drawback is that there is no feedback from a broker so I don’t see what state they are in.

Thanks again for your help. Must be something on my end perhaps and not the code.

Kind Regards

Ross

From: GeoffAtHome Sent: Sunday 7 April 2019 13:09 To: GeoffAtHome/lightwaverf-home-assistant-platform Cc: rossemerson; Mention Subject: Re: [GeoffAtHome/lightwaverf-home-assistant-platform] Errors when runin Lovelace (#1)

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 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

GeoffAtHome commented 5 years ago

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