Giter Club home page Giter Club logo

pylutron's People

Contributors

achatham avatar bdunks avatar cdheiser avatar dcode avatar dcramer avatar fabaff avatar jongilmore avatar joostlek avatar koreth avatar moonfall avatar rverstappen avatar sgrimm avatar shurhold avatar thecynic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylutron's Issues

Support for RA3

Hi all,

Absolutely love the work done in pylutron which gets used in HomeAssistant and others. Now that RadioRA3 is released, is anyone working on adding support?

I will have my hands on a RA3 processor shortly, is there anything I can do to help facilitate? I'm told its the same command set as HomeWorks QSX, but presumably has its own unique certificates to worry about.

How can I help?

'Button' object has no attribute 'keypad'

Using Home Assistant 0.87.1 which uses pylutron 0.2.0, I see this in my logs. After this message, Home Assistant stops being able to interact with my Lutron repeater.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 149, in run
    self._recv_cb(line.decode('ascii').rstrip())
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 382, in _recv
    handled = obj.handle_update(args)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 840, in handle_update
    return self._components[component].handle_update(action, params)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 701, in handle_update
    action, self.number, self.keypad.name))
AttributeError: 'Button' object has no attribute 'keypad'

Would this work with RF Dimming Module (lmj-5t-dv-b rf)

I'd like to know if pylutron would/will work with a dimming module lmj-5t-dv-b rf? I can't test it right now, but I'd used the modules to control some 0-10v drivers (a total of 16) and before buying them I'd like to know if it's going to work.

Thanks a lot for the good work btw, already using this integrated with Home Assistant and Lutron keypads

led / component number calculation

https://github.com/thecynic/pylutron/blob/master/pylutron/__init__.py#L282
When led_num is calculated from the component number, it assumes that the led number is 80 less than the component number. For the case of the MAIN_REPEATER device type, this is not true. Here's a snippet of the LED ComponentNumber from my XML:

                          </Preset>
                        </Presets>
                      </Action>
                    </Actions>
                    <Notes />
                  </Button>
                </Component>
                <Component ComponentNumber="101" ComponentType="LED">
                  <LED UUID="133" isReverseLogic="false" ProgrammingModelID="957" />
                </Component>
                <Component ComponentNumber="102" ComponentType="LED">
                  <LED UUID="134" isReverseLogic="false" ProgrammingModelID="9441" />
                </Component>

I think we need to do a check to see if we're looking at a MAIN_REPEATER device type, and if so, subtract 100 instead of 80. Thoughts?
CC @thecynic

Is Lutron training required/what level to use this package?

I have gone through the online training and have the Essentials SW. I designed a system for a new house last year and with all the COVID delays it is just getting to near the end of the project. I hopefully figured this out a while back but will I have any limitations with using this package (I'm using Home Assistant) since I don't have Essentials PC or Inclusive? I didn't even recall that there was a Essentials PC, I thought I was going to be able to hook up and download into the controller so now I'm paranoid...

Add support for HVAC controls

The Lutron system supports HVAC controls and we should add these into pylutron for consumption by other systems like Home Assistant.

Add Fade and delay times

I noticed in your code:

At some later date, we may want to also specify fade and delay times

I would love to see that! Being able to customize certain actions would be much appreciated.

Project seems to be unmaintained

Including @jon102034050 and @nickovs as interested parties.

This project appears to no longer be maintained. It's been over 6 months since the last commit, and it's been almost a year since the last version was released to PyPi.

Several contributors (including myself) have expressed interest in actively maintaining and contributing to this project, and would be preferred over forking the project. There are multiple outstanding pull requests queued up and several of us would like to make continued improvements to the Lutron integrations in home assistant which depends on this library.

Uncaught exception

I just upgraded from the last 2022.5 to 2022.6.1 and commented out some settings in configuration.yaml for two devices that are now configured in the UI. I also noticed that I hadn't put the Lutron username and password in my secrets.yaml file so I did that and restarted. At that point, I noticed that Lutron wasn't loading and when I looked in the logs I saw a repeating error: [pylutron] Uncaught exception.

I tried rolling back to 2022.5.x but this exception seemed to prevent it from completing. I hit the power button on the NUC (with Proxmox) and it eventually shutdown. I also power cycled the Lutron repeater. When I powered up the NUC, HA came up and ran with Lutron, however, it was at 2022.6.1 but the configuration.yaml had reverted. I tried changing the configuration.yaml file to use secrets again, restarted and the same thing happened. I used the VSCode addin to revert the use of secrets, power cycled again and it all came back.

2022-06-03 10_24_04-Log Viewer – Home Assistant

https://i.imgur.com/MvbEOC1.png

Command-sending fails to auto-connect.

The LutronConnection.send() method doesn't call _maybe_reconnect() and as a result if it is called and the connection has dropped an attribute error exception is raised because None has no write() method (see the stack trace below from Home Assistant). As it stands there can't just be a _maybe_reconnect() in the send method because it gets called from _do_login() but if might be good to move the existing code to a _send() method (which can be called from _do_login()) and then have the public send() method call _maybe_reconnect() before calling that code.

On a related note, at the moment _maybe_reconnect() only spots if the socket has already been marked as closed and the _connected flag reset. If the flag is set then it might be worth checking if the socket is actually still alive before trying to use it, to avoid the client code needing to manually retry failed requests. This can be done by calling recv() on the underlying socket passing the socket.MSG_DONTWAIT | socket.MSG_PEEK as the flags, to see if there is anything there. If this raises a BlockingIOError then the socket is alive, if it returns data then the socket is probably alive and if it returns an empty bytes object then the socket has been closed and you need to call _disconnect() and then reconnect.

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/core.py", line 1038, in _event_to_service_call
    await service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/light/__init__.py", line 362, in async_handle_light_service
    await light.async_turn_off(**params)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/light/lutron.py", line 74, in turn_off
    self._lutron_device.level = 0
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pylutron/__init__.py", line 485, in level
    Output.ACTION_ZONE_LEVEL, "%.2f" % new_level)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pylutron/__init__.py", line 324, in send
    self._conn.send(op + out_cmd)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pylutron/__init__.py", line 69, in send
    self._telnet.write(cmd.encode('ascii') + b'\r\n')
AttributeError: 'NoneType' object has no attribute 'write'

AttributeError: 'NoneType' object has no attribute 'write'

Apologies if this is repetitive information. I've made a couple of other posts elsewhere but am not sure that those have been seen.

RPi3, Hass.io. I'm encountering problems with pylutron since 0.85.1; last working version was 0.84.6.

This version of the error message was from 0.85.1:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 287, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/lutron.py", line 73, in turn_off
    self._lutron_device.level = 0
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 591, in level
    Output._ACTION_ZONE_LEVEL, "%.2f" % new_level)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 392, in send
    self._conn.send(op + out_cmd)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 91, in send
    self._send_locked(cmd)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 81, in _send_locked
    self._telnet.write(cmd.encode('ascii') + b'\r\n')
  File "/usr/local/lib/python3.6/telnetlib.py", line 290, in write
    self.sock.sendall(buffer)
TimeoutError: [Errno 110] Operation timed out

This version of the error message was from 0.87.1:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 289, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/lutron.py", line 73, in turn_off
    self._lutron_device.level = 0
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 591, in level
    Output._ACTION_ZONE_LEVEL, "%.2f" % new_level)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 392, in send
    self._conn.send(op + out_cmd)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 91, in send
    self._send_locked(cmd)
  File "/usr/local/lib/python3.6/site-packages/pylutron/__init__.py", line 81, in _send_locked
    self._telnet.write(cmd.encode('ascii') + b'\r\n')
AttributeError: 'NoneType' object has no attribute 'write'

I have not tried later versions than 0.87.1 but would be happy to do so and provide additional feedback.

add caseta report loader

From what I can tell - the Caseta smartbridge uses the same integration protocol, but does not serve the xml DB (it responds to telnet but not HTTP)

It will generate a json report like the following (you can tell I'm just starting to add devices)

It looks like there may be some different assumptions? maybe a single area? If there is a sample of the XML report, I'd be willing to take a look at this. Interested in your PR for the home-assistant project.

{
  "LIPIdList" : {
    "Devices" : [
      {
        "ID" : 1,
        "Name" : "Smart Bridge",
        "Buttons" : [
          {
            "Name" : "Arriving Home",
            "Number" : 1
          },
          {
            "Name" : "Leaving Home",
            "Number" : 2
          },
          {
            "Name" : "Dining Low",
            "Number" : 3
          },
          {
            "Name" : "Dining Mid",
            "Number" : 4
          },
          {
            "Name" : "Button 5",
            "Number" : 5
          },
          {
            "Name" : "Button 6",
            "Number" : 6
          },
          {
            "Name" : "Button 7",
            "Number" : 7
          },
          {
            "Name" : "Button 8",
            "Number" : 8
          },
          {
            "Name" : "Button 9",
            "Number" : 9
          },
          {
            "Name" : "Button 10",
            "Number" : 10
          },
          {
            "Name" : "Button 11",
            "Number" : 11
          },
          {
            "Name" : "Button 12",
            "Number" : 12
          },
          {
            "Name" : "Button 13",
            "Number" : 13
          },
          {
            "Name" : "Button 14",
            "Number" : 14
          },
          {
            "Name" : "Button 15",
            "Number" : 15
          },
          {
            "Name" : "Button 16",
            "Number" : 16
          },
          {
            "Name" : "Button 17",
            "Number" : 17
          },
          {
            "Name" : "Button 18",
            "Number" : 18
          },
          {
            "Name" : "Button 19",
            "Number" : 19
          },
          {
            "Name" : "Button 20",
            "Number" : 20
          },
          {
            "Name" : "Button 21",
            "Number" : 21
          },
          {
            "Name" : "Button 22",
            "Number" : 22
          },
          {
            "Name" : "Button 23",
            "Number" : 23
          },
          {
            "Name" : "Button 24",
            "Number" : 24
          },
          {
            "Name" : "Button 25",
            "Number" : 25
          },
          {
            "Name" : "Button 26",
            "Number" : 26
          },
          {
            "Name" : "Button 27",
            "Number" : 27
          },
          {
            "Name" : "Button 28",
            "Number" : 28
          },
          {
            "Name" : "Button 29",
            "Number" : 29
          },
          {
            "Name" : "Button 30",
            "Number" : 30
          },
          {
            "Name" : "Button 31",
            "Number" : 31
          },
          {
            "Name" : "Button 32",
            "Number" : 32
          },
          {
            "Name" : "Button 33",
            "Number" : 33
          },
          {
            "Name" : "Button 34",
            "Number" : 34
          },
          {
            "Name" : "Button 35",
            "Number" : 35
          },
          {
            "Name" : "Button 36",
            "Number" : 36
          },
          {
            "Name" : "Button 37",
            "Number" : 37
          },
          {
            "Name" : "Button 38",
            "Number" : 38
          },
          {
            "Name" : "Button 39",
            "Number" : 39
          },
          {
            "Name" : "Button 40",
            "Number" : 40
          },
          {
            "Name" : "Button 41",
            "Number" : 41
          },
          {
            "Name" : "Button 42",
            "Number" : 42
          },
          {
            "Name" : "Button 43",
            "Number" : 43
          },
          {
            "Name" : "Button 44",
            "Number" : 44
          },
          {
            "Name" : "Button 45",
            "Number" : 45
          },
          {
            "Name" : "Button 46",
            "Number" : 46
          },
          {
            "Name" : "Button 47",
            "Number" : 47
          },
          {
            "Name" : "Button 48",
            "Number" : 48
          },
          {
            "Name" : "Button 49",
            "Number" : 49
          },
          {
            "Name" : "Button 50",
            "Number" : 50
          },
          {
            "Name" : "Button 51",
            "Number" : 51
          },
          {
            "Name" : "Button 52",
            "Number" : 52
          },
          {
            "Name" : "Button 53",
            "Number" : 53
          },
          {
            "Name" : "Button 54",
            "Number" : 54
          },
          {
            "Name" : "Button 55",
            "Number" : 55
          },
          {
            "Name" : "Button 56",
            "Number" : 56
          },
          {
            "Name" : "Button 57",
            "Number" : 57
          },
          {
            "Name" : "Button 58",
            "Number" : 58
          },
          {
            "Name" : "Button 59",
            "Number" : 59
          },
          {
            "Name" : "Button 60",
            "Number" : 60
          },
          {
            "Name" : "Button 61",
            "Number" : 61
          },
          {
            "Name" : "Button 62",
            "Number" : 62
          },
          {
            "Name" : "Button 63",
            "Number" : 63
          },
          {
            "Name" : "Button 64",
            "Number" : 64
          },
          {
            "Name" : "Button 65",
            "Number" : 65
          },
          {
            "Name" : "Button 66",
            "Number" : 66
          },
          {
            "Name" : "Button 67",
            "Number" : 67
          },
          {
            "Name" : "Button 68",
            "Number" : 68
          },
          {
            "Name" : "Button 69",
            "Number" : 69
          },
          {
            "Name" : "Button 70",
            "Number" : 70
          },
          {
            "Name" : "Button 71",
            "Number" : 71
          },
          {
            "Name" : "Button 72",
            "Number" : 72
          },
          {
            "Name" : "Button 73",
            "Number" : 73
          },
          {
            "Name" : "Button 74",
            "Number" : 74
          },
          {
            "Name" : "Button 75",
            "Number" : 75
          },
          {
            "Name" : "Button 76",
            "Number" : 76
          },
          {
            "Name" : "Button 77",
            "Number" : 77
          },
          {
            "Name" : "Button 78",
            "Number" : 78
          },
          {
            "Name" : "Button 79",
            "Number" : 79
          },
          {
            "Name" : "Button 80",
            "Number" : 80
          },
          {
            "Name" : "Button 81",
            "Number" : 81
          },
          {
            "Name" : "Button 82",
            "Number" : 82
          },
          {
            "Name" : "Button 83",
            "Number" : 83
          },
          {
            "Name" : "Button 84",
            "Number" : 84
          },
          {
            "Name" : "Button 85",
            "Number" : 85
          },
          {
            "Name" : "Button 86",
            "Number" : 86
          },
          {
            "Name" : "Button 87",
            "Number" : 87
          },
          {
            "Name" : "Button 88",
            "Number" : 88
          },
          {
            "Name" : "Button 89",
            "Number" : 89
          },
          {
            "Name" : "Button 90",
            "Number" : 90
          },
          {
            "Name" : "Button 91",
            "Number" : 91
          },
          {
            "Name" : "Button 92",
            "Number" : 92
          },
          {
            "Name" : "Button 93",
            "Number" : 93
          },
          {
            "Name" : "Button 94",
            "Number" : 94
          },
          {
            "Name" : "Button 95",
            "Number" : 95
          },
          {
            "Name" : "Button 96",
            "Number" : 96
          },
          {
            "Name" : "Button 97",
            "Number" : 97
          },
          {
            "Name" : "Button 98",
            "Number" : 98
          },
          {
            "Name" : "Button 99",
            "Number" : 99
          },
          {
            "Name" : "Button 100",
            "Number" : 100
          }
        ]
      },
      {
        "ID" : 3,
        "Name" : "Dino Remote",
        "Buttons" : [
          {
            "Number" : 2
          },
          {
            "Number" : 3
          },
          {
            "Number" : 4
          },
          {
            "Number" : 5
          },
          {
            "Number" : 6
          }
        ]
      }
    ],
    "Zones" : [
      {
        "ID" : 2,
        "Name" : "Diningroom Lights"
      }
    ]
  }
}

SYSVAR support?

Possible to add support to monitoring and setting custom variable (SYSVAR)?

image image

Add an API to allow enumeration of IDs only

For HASS, it would be nice if the enumeration interface provided a set of IDs and then allowed one to retrieve the proper object based on the ID. Integration ID would work quite nicely for most things, though things like motion sensors will be funky.

Grafikeye QS with network interface support

Hi,
I have been looking to integrate my Grafikeye QS with a network interface https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf into home assitant.
Is it possible to expand pylutron to support this? I would help testing it on my system. I have 2 grafik eye qs and 3 International seeTouch QS 10-Button Wallstation with Raise/Lower
Thank you in advance!
Not sure if it's ok to post here but I couldn't find any good info on the HA community pages. Also posted a similar post there.

PyPI update?

@thecynic can we get an update pushed to PyPI? It'd be awesome to see all this hard work get realized in homeassistant :D

Thanks for all the hard work on this btw!

pypi repo secret api token

@thecynic I'd like to automate the PyPI github release with github actions upon a repo tag, but I'll need to either be able to create the secret on this repo for my PyPI API token (requires repo admin), or if you could add your repo token, I'd really appreciate it!

Thanks!

homeworks QS

hi there,

i just made pylutron working with my lutron homeworksQS setup. The only change i made was in init.py, where i changed GNET for QNET. The commands are all the same, both platforms rely on lutron QS Control Protocol. Can you include this on a future release so it can work with both systems?

Disconnects every few seconds from RadioRA2 main repeater

I first saw this in homeassistant after an update. The pylutron package was updated from 0.2.2 to 0.2.5 as part of that update.

The logs show "Disconnected" every few seconds, then pylutron reconnects to the main repeater. This causes HA to lose control and status of the lutron devices at random times. Sometimes a restart of HA will temporarily fix it. Eventually, the main repeater lights all change to and red and the repeater must be power cycled.

Slow pylutron initialization right after project transfer from RR2 Essentials

Hi - running RR2 Essentials 12.7.0 and a RR2 repeater with 12.7 firmware update. 93 devices out of 100 configured. 63 repeater phantom buttons configured. I also have a Connect Hub. So a big set-up, whole house. This is integrated with the latest HomeAssistant 0.113.3 running on an Intel NUC under Proxmox / HassOS 4.12, using the current stock HA Lutron RR2 integration. All of this works terrific - I have fine-grained control over the whole house lighting.

My issue: if I transfer my project to the repeater, and have Essentials still open under Windows or very recently closed, when I restart HA to reload the integration with the repeater, the HA integration takes over 10 minutes to initialize. It always finishes successfully, but it takes a long time. If I have logging set to something below "error" for pylutron, I see the "Disconnected" warning over 40,000 times - it logs it many times per second. If I have logging set to "error" then I don't see all those messages but it still takes a long time so I assume some problem is still going on behind the scenes.

If I wait a few minutes after the transfer completes successfully, or if the repeater has been running normally for awhile, initialization takes about 23 seconds and I do not see all the "Disconnected" messages in the log.

This problem started about a month ago when I added all the phantom button programming, but it may be a coincidence with other changes - hard to tell. I migrated to the NUC from a RPi around that time also as the RPi couldn't gracefully handle my growing HA config.

Other than this, everything is working perfectly and I am very happy with performance and reliability. I have elaborate scenes to shift lighting around, and they operate silky smooth with Lutron's ClearConnect.

From reading your issue tracker I can see you're actively updating this project and planning an overhaul of the HA Lutron integration to go with a new version. I thought you'd want to know about this odd behavior right after a transfer. When debugging all of this, I often adjust the project, transfer it, and then fiddle with HA's configuration to make things work, so it is a common work flow to reboot HA right after a transfer. Has anyone else run into this sort of issue?

Switch to telnetlib3

The built-in telnetlib is deprecated and will be removed soon. We need to switch to telnetlib3

Support for new Caseta switches

I just installed one of the new Caseta Diva switches and it doesn't appear to be supported. I am using this via Home Assistant and am not setup to easily debug this directly, but I was curious if this was an expected issue or the library should be able to handle new switches and something else may be going on.

Thanks!

GRAFIK_T_HYBRID_KEYPAD unsupported

Hi,

I was wondering if it would be possible to add support for GRAFIK_T_HYBRID_KEYPAD? I included a sample xml fragment from the xml.

I'm not sure if anything is required besides changing _parse_area() -- if that's it and it would make your life easier I can submit a pull request.

keypad.txt

I am adding legacy Homeworks HWI controller support

Hi Folks -

I started adding support for the legacy Homeworks HWI controllers. I have a P5 processor and a wireless processor of the same vintage. So far I have the DB parsing, can push buttons, set light levels, and get responses when levels change. The response code path needs some more debugging. I haven't looked at LEDs yet, that's the last bit.

The goal is to integrate into Home Assistant. I'm very new to HA, so I haven't attempted to see if my new pylutron works yet. It should just work (famous last words of a SW engineer), I only changed the low level code, so the API HA uses should just work.

Realistically, I probably broke something with the QS/RA2 code paths. Again, it should just work, I tried not to affect any of those code paths, but....

Besides the new parser, I added a Processor class that does the command set translation back and forth. All the existing code still thinks it's working with the QS/RA2 command set. For example, when the pylutron code sends a #DEVICE, if it's a HWI system, it gets converted to a KBP command. Likewise, when a DL command comes back from the processor, it gets converted back to a ~OUTPUT command. This is all hooked in at the LutronConnection class, nothing else changes.

So,

  1. I'll need some testing to verify I didn't break anything for current users

  2. If anyone has a HWI system, I'd appreciate testing there. This requires a P5 or newer processor and a project that uploaded the full XML database. There's a checkbox in the Illumination SW to upload the full XML, depending on how (and when) the project was created, the XML DB may or may not be there.

  3. What is the general feeling of accepting a PR like this. Historically, it looks like getting some PRs in was difficult.

More complete keypad support needed

The current support for keypads is fairly minimal. @bdunks has put forward a patch #8 to allow the emulation of button presses and I've been working on a separate patch to support subscriber notification of button presses and LED changes. Before I go too far on my patches I thought it would be useful to have a discussion about the best way to represent these components as objects.

As I see it there are several things that would be useful for keypad objects to be able to do:

  • Emulate button presses (a la #8), so that automation systems can set scenes.
  • Get notifications for button press events, so that spare keypad buttons can be used to trigger other sorts of event.
  • Get notifications for LED change events, so that the automation system can show which scenes are active.
  • Set keypad LEDs, so that the automation system can use spare LEDs to reflect state.

Open questions that on which I would appreciate input are:

  • Should there be separate 'Botton' and 'LED' objects or should there just be buttons, with a flag to indicate if the button has an LED? I don't know if there is any compatible Lutron component that has LEDs which are not associated with buttons (although visor remotes and Picos have buttons not associated with LEDs).
  • Should notifications of button and LED events be sent to subscribers of a keypad or should an application need to subscribe to the buttons and/or LEDs individually?
  • How should response parameters be passed to subscribers? When subscribing to the Output objects there is state in the object, so there is no need for the subscriber to see the raw response. With DEVICE events such as button presses the event is transient rather than stateful and we need to pass the parameters up to the subscriber.

Right now I'm inclined to represent buttons and LEDs together, have applications subscribe to buttons individually and define a new subscription model for buttons that passes both button press and LED change events to the subscriber. The subscription model for the existing LutronEntity model would remain the same.

Any thoughts on these subjects would be very helpful. Otherwise I'll just continue the way I'm going.

Occupancy for everything?

In Ra2 there's occupancy for areas that have their sensors, and then there's also a 'rollback' timer. It's possible to have a room set with a rollback timer, and a value that executes a vacancy scene when the timer expires. This is a handy way to allow manually turning on a light that's part of a rollback group and have it (and anything else in the rollback group) automatically set to a scene once the timer expires. Note I mentioned 'set to a scene' not just 'turned off' as you could have one area time out and perhaps change values in another. Like turning off a bathroom, and then setting an adjacent hallway light to a low dimmed level like for a nightlight.

Anyway, I noticed in HA occupancy entities were being picked up for EVERY room, not just ones with a motion sensor or a rollback. I'm not sure that's correct. I can, of course, just disable the entities where there's not actually a sensor/rollback but this gets tedious when you have dozens of them.

Should the importing routine be creating binary_sensor._occupancy for every room? Or only just ones with an actual sensor or rollback?

FutureWarning on Python 3.6

When the library first loads the XML tree from the repeater, Python 3.6's xml.etree module prints a warning:

pylutron/__init__.py:244: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.

NON_DIM_INC is also a switch, not a light

It's possible to use some of the Lutron devices that have dimmers as switches. They show up in the DbXmlInfo.xml file as having an OutputType of "NON_DIM_INC".

The code in https://github.com/thecynic/pylutron/blob/master/pylutron/__init__.py needs to be changed to reflect that.

This is a list of the various OutputTypes from one site here:

OutputType="AUTO_DETECT"
OutputType="CCO_MAINTAINED"
OutputType="CEILING_FAN_TYPE"
OutputType="INC"
OutputType="NON_DIM"
OutputType="NON_DIM_ELV"
OutputType="NON_DIM_INC"
OutputType="EXHAUST_FAN_TYPE"
OutputType="RELAY_LIGHTING"

The 12.9.0 version of Ra2 software lists several ways for a dimmer device to support a non-dimmed load (and that affects the XML output)

image

Unfortunately I don't have a site running from which I could export devices with all of the types. But it'd be a safe starting point to assume 'starts with "NON_DIM" would be a more versatile comparison instead of just

752 return self.type != 'NON_DIM' and not self.type.startswith('CCO_')

Could it be as easy as just changing that to:

return( self.type not in ('NON_DIM', 'NON_DIM_INC', 'NON_DIM_ELV', 'EXHAUST_FAN_TYPE', 'RELAY_LIGHTING') and (not self.type.startswith('CCO_')) )

Radio Ra 2 and Home Assistant

I’m new here and to Home Assistant. I was told someone here may be able to lead me in the right direction. I’m a Ra2 installer and lately I’ve been asked by more than a few clients about timers, for example on a bathroom fan. Ra2 doesn’t natively support this. Does anyone know how I could add this functionality? Even if it’s just using a switch and having the system turn it off 30 minutes later.

Area with more than one Occupancy sensor, only last one added?

If you have an Area (room) that has more than one Occupancy sensor the import routine only creates binary_sensor.AREANAME_occupancy for the last MOTION_SENSOR Device found in the DeviceGroup.

Is it not possible in HA to have more than one occupancy sensor entity in an area? Though I suppose if all you're observing is the occupancy/vacancy of an 'Area' from the repeater (not the individual sensors) then it wouldn't matter.

I can't recall how often the telnet interface provides updates on the Area based on the sensor activity. Does it emit a GROUP message any time a sensor detects? Or only the first time and then only when nothing has been since since the timeout set on the sensor itself?

When I look at the code it seems like it should be passing back the 'Device 001' text, but the created device in HA reads 'Office', which I'm guessing it the Area Name attribute, not the Device Name attribute.

The added problem is each sensor Device Name attribute is 'Device 001' which is not something you can set in the Ra2 software (in fact ALL of the MOTION_SENSOR devices are named that).

So for a MOTION_SENSOR device it seems like the DeviceGroup Name attribute should be used.

This is a snippet of the Area and DeviceGroups for one with two sensors:

			<Area Name="Office" UUID="32120" IntegrationID="181" OccupancyGroupAssignedToID="32122" SortOrder="32">
				<DeviceGroups>
					<DeviceGroup Name="Desk by Bill" SortOrder="7">
						<Devices>
							<Device Name="Device 001" UUID="52965" SerialNumber="99999999" IntegrationID="227" DeviceType="MOTION_SENSOR" GangPosition="0" SortOrder="0">
								<Components>
									<Component ComponentNumber="2" ComponentType="CCI">
										<CCI UUID="52967">
											<Notes/>
										</CCI>
									</Component>
								</Components>
							</Device>
						</Devices>
					</DeviceGroup>
					<DeviceGroup Name="Office Corner" SortOrder="4">
						<Devices>
							<Device Name="Device 001" UUID="44860" SerialNumber="11111111" IntegrationID="210" DeviceType="MOTION_SENSOR" GangPosition="0" SortOrder="0">
								<Components>
									<Component ComponentNumber="2" ComponentType="CCI">
										<CCI UUID="44862">
											<Notes/>
										</CCI>
									</Component>
								</Components>
							</Device>
						</Devices>
					</DeviceGroup>

pylutron seem to just go away

I have a big lutron install, prob 100+ devices. Using Home Assistant. It's a big install, shared with a Crestron system.

It seems after random periods of time (hours or days), the pylutron thread just seems to stop or go away. I suspected some other exception was being thrown (and not handled) in the main run fn. So I added more generic exception handling there, and sprinkled in some more logging to try and determine where/how it was failing.

Unfortunately, I'm not seeing anything revealing. I see lots of logging, but ultimately it calls a (blocking) read (as is normal) and that's the last log msg I ever see.

I see there are some outstanding PRs here, and I'm not sure about the lutron firmware version...

Any ideas or suggestions as to where to log next or how else to try and track down this issue?

Thanks!

Lutron illumination

Hi I'm running a lutron system that's older than the QS version - its running the Lutron illumination software. I have ethernet access to the controller. Do you know if pylutron or any of the HA integrations (lutron or homeworks) will work with this system? If so which one and how would I start. Thanks!

Test pylutron in isolation

Hi @thecynic ,
I wanted to contribute to this project to add support for International Seetouch Keypads, CCIs, WCIs, and of course to support Homeworks.
Do you have a test project for pylutron or are you testing only connecting it with home-assistant?

Do you ever considered to use asyncio?

pypi release?

@thecynic can you cut a new release on pypi so we can test the latest commits out with home assistant?

Are Pico remotes supported?

If not, I would love to see support for the Pico remotes.

Thanks for all of the work that is being done on this.

Documentation questions

I'm prepping for installing a repeater for my RA2 installation in a new house and ran across some info that differs from the Lutron page in the HA docs. Apparently in new versions of the Essentials/Inclusive software they have deleted the default logins, e.g. lutron/integration ( https://forums.lutron.com/showthread.php/15054-Data-Privacy-Compliance-(removal-of-default-login-for-integration)-question ). I'm guessing any changes to that page are bounced to the folks here, any objection to me updating it to note that newer versions of the Lutron SW will need to have telnet logins created? I actually started playing with the SW over a year ago so they were still there for me but I deleted them and added more secure logins. I've never done an update to a public Github repo and this seems like a pretty straightforward way to start...

Also, any reason there isn't a Wiki for this repo? I've put together a bunch of notes that might help other non-IT/SW dev folks and I'm happy to share them. I imagine that there is admin overhead for having a Wiki so I'm not bothered if the answer is no.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.