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

Add lightwave components for switches and lights #18026

Merged
merged 25 commits into from Dec 2, 2018

Conversation

@GeoffAtHome
Copy link
Contributor

GeoffAtHome commented Oct 30, 2018

lightwaverf-home-assistant-platform

Integration of LightwaveRF switches and lights with Home Assistant (HASS) as a platfrom

Docs PR:
home-assistant/home-assistant.io#7600

It's very crude, but does work. It's been working for me for several years with the 1st generation of LightWave kit. I have not tested this with the newer (2nd gen) Lightwave products.

Caveat

This code may show your devices in the Home Assistant UI, but it may not be able to control the lights for you. The code speaks directly to your Lightwave WiFi Link. Obviously, if you don't have a WiFi Link, then this isn't going to work for you.

Adding LightwaveRF to your configuration file

To use the Lightwave switches and lights your file must be updated.

lightwave:
  host: 192.168.1.2
  lights:
    R1D3:
      name: Wall lights
    R1D4:
      name: Ceiling lights
  switches:
    R1D2:
      name: Tree socket
    R2D1:
      name: Radio socket
    R2D2:
      name: Light socket
    R2D3:
      name: Phone socket
    R2D4:
      name: Torch socket

Where 192.168.1.2 is the ip address of your Lightwave hub.

Add switches if you have switches and lights if you have lights. At least one of these needs to be present.
Each switch or light requires an id and name. The id takes the form R#D# where R#is the room number andD#` is the device number.

The first use of a switch or light will try to register with the WiFi Link hub. If the hub has not been registered a message on your WiFi Link asking you to pair the device. You have 12 seconds to push the button on the WiFi Link to accept this. Once done, you should be able to control your lights via Home Asssistant.
This only needs to be done once only if the hub has not been registered.

Acknowledgement

Thanks to Chirag Desai for paving the way to getting this component done.

Show resolved Hide resolved homeassistant/components/switch/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/switch/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/switch/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/switch/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/switch/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Geoff Soord Geoff Soord
Show resolved Hide resolved homeassistant/components/switch/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated

GeoffAtHome added some commits Oct 31, 2018

@fabaff
Copy link
Member

fabaff left a comment

Just a couple of comments to get started with the review.

Show resolved Hide resolved homeassistant/components/light/lightwave.py
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/light/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
@fabaff

This comment has been minimized.

Copy link
Member

fabaff commented Nov 12, 2018

Also, you need to address the points from the PR template (which you removed).

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Nov 13, 2018

@fabaff @Danielhiversen Is there anything I need to do to move this on? Please advise.

@frenck

This comment has been minimized.

Copy link
Member

frenck commented Nov 19, 2018

Could not find a related PR on our documentation repository. Adding docs-missing label.

@frenck frenck added the docs-missing label Nov 19, 2018

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Nov 20, 2018

@frenck so where do I add the documentation. I looked here https://developers.home-assistant.io/docs/en/documentation_index.html and found this https://github.com/home-assistant/home-assistant.io. The documentation here does match my expectations. Am I looking in the wrong place?

@frenck

This comment has been minimized.

Copy link
Member

frenck commented Nov 21, 2018

@GeoffAtHome
image

You need to create component documentation and open a PR for it on our documentation project. Which indeed this is the repository: https://github.com/home-assistant/home-assistant.io

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Nov 21, 2018

@frenck thanks for confirming. Hope to add the documentation by the weekend.

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Nov 22, 2018

@frenck documentation added with this PR home-assistant/home-assistant.io#7600. Is this correct?

GeoffAtHome added some commits Dec 1, 2018

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Dec 1, 2018

@MartinHjelmare What else needs to be done?

@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Looks good!

Show resolved Hide resolved homeassistant/components/lightwave.py Outdated
@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Great! Can be merged when build passes.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 2, 2018

Please also update the PR description with the new config schema.

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Dec 2, 2018

@MartinHjelmare PR for description updated. Thank you for your help, support and perseverance.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 2, 2018

Did you update the description in this PR? It still looks like we want users to set up platforms in the config. Only the component should be necessary.

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Dec 2, 2018

I did update platform, switch and light. Looking at the hive components as a pattern. Should I remove switch and light?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 2, 2018

We will no longer use the platform config sections since we set up the platforms via discovery from the lightwave component.

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Dec 2, 2018

Should I remove "light" and "switch" documentation or to be like hive simplify the light and switch document by removing details about configuration?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 2, 2018

This is all we need to set up this integration:

lightwave:
  host: 192.168.1.2
  lights:
    R1D3:
      name: Wall lights
    R1D4:
      name: Ceiling lights
  switches:
    R1D2:
      name: Tree socket
    R2D1:
      name: Radio socket
    R2D2:
      name: Light socket
    R2D3:
      name: Phone socket
    R2D4:
      name: Torch socket

Remove the examples that have platform:

light:
  - platform: ...
@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Dec 2, 2018

@MartinHjelmare Updated documentation. Reference to the configuration have now been removed from light.lightwave.markdown and switch.lightwave.markdown

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 2, 2018

I have only been talking about the description in this PR at the top. It's still not updated.

@GeoffAtHome

This comment has been minimized.

Copy link
Contributor

GeoffAtHome commented Dec 2, 2018

Oh - I thought you were referring to the documentation. I have now updated the description.

@MartinHjelmare MartinHjelmare merged commit eb584a2 into home-assistant:dev Dec 2, 2018

5 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.1%) to 92.912%
Details

@wafflebot wafflebot bot removed the in progress label Dec 2, 2018

mxworm added a commit to mxworm/home-assistant that referenced this pull request Dec 2, 2018

Merge branch 'dev' of https://github.com/home-assistant/home-assistant
…into dev

* 'dev' of https://github.com/home-assistant/home-assistant: (35 commits)
  Add lightwave components for switches and lights (home-assistant#18026)
  Remove commented out code (home-assistant#18925)
  No more opt-out auth (home-assistant#18854)
  Reconfigure MQTT switch component if discovery info is changed (home-assistant#18179)
  Reconfigure MQTT light component if discovery info is changed (home-assistant#18176)
  Set sensor to unavailable if battery is dead. (home-assistant#18802)
  Fix hdmi_cec entity race (home-assistant#18753)
  Show ANSI color codes in logs in Hass.io (home-assistant#18834)
  bugfix: ensure the `google_assistant` component respects `allow_unlock` (home-assistant#18874)
  Fibaro ubs (home-assistant#18889)
  Restore states when removing/adding entities (home-assistant#18890)
  Optionally do not log template rendering errors (home-assistant#18724)
  Small refactoring of MQTT climate (home-assistant#18814)
  Small refactoring of MQTT alarm (home-assistant#18813)
  Small refactoring of MQTT cover (home-assistant#18850)
  Upgrade keyring to 17.0.0 (home-assistant#18901)
  Upgrade pillow to 5.3.0
  Upgrade ruamel.yaml to 0.15.80
  Upgrade restrictedpython to 4.0b7
  Fix change
  ...

@balloob balloob referenced this pull request Dec 12, 2018

Merged

0.84 #19215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment