Event support for Scene Controllers

How would I do this in HA? I’ve read through the thread and I don’t understand what I’m missing. I added the command class to the xml file, and still I don’t see any events in the z-wave log when pressing the buttons.

I’m not sure this can be done from the ZWave console in HA. In the past I had to write the scene configuration with OZWCP but, HA has evolved a lot since then. Sadly I’m unable to get the network to announce the Indicator value add for this particular device (only seeing value changed events) so I haven’t looked at it in a while.

I’ve managed to get the RFWC5 programmed to trigger scene activations using openzwave.
Following the code of the SmartThings device handler, I replicated the setup progress using python-openzwave. The RFWC5 needs to be sent COMMAND_CLASS_SCENE_CONTROLLER_CONF commands to set which scene each button is associated with. Unfortunately, there is no support in openzwave for the COMMAND_CLASS_SCENE_CONTROLLER_CONF command class. To overcome this, frames can be manually constructed and sent to the device using openzwave. Unfortunately, this functionality is not currently exposed by python-openzwave. There is a pull request from 6 months ago to add this that hasn’t been merged (https://github.com/OpenZWave/python-openzwave/pull/158). So the code I wrote to program the device currently needs to be run against a version of python-openzwave that includes this functionality. I used docker to build python-openzwave from the author’s repo.

I’ve uploaded the code for a proof of concept here: https://github.com/epotocko/rfwc5-openzwave

The process would be greatly simplified if the sendRawData pull request was merged into python-openzwave. It could be simplified further if functions for COMMAND_CLASS_SCENE_CONTROLLER_CONF were added to openzwave. This might not be worth the effort if very few ZWave devices support this command class.

Actually I just made some great progress with my controller here. After upgrading the 94.4 the indicator value I was previously missing for this device just showed up.

From there I installed this custom component to make automation easier (thanks @blakeblackshear)

After this I was able to get the association for scenes set up correctly through the HA zwave configuration pane. For every group I added the controller and then set the value below that. Between each group I had to refresh frontend, not totally sure why.

But it works!

Guys,
I’m new to hass but not new to home automation in general. I’ve been using the Clare Automation and Vera controllers for a few years. I’ve not been fully happy with either so am looking at moving to hass. One big need for me (and my clients) is to get this Cooper 5-button controller working and I’m struggling. I’ve updated my zwcfg***.xml file to include the CommandClass id=‘91’… stuff (this section did not exist) as per the following (but not even sure if this info is still accurate):


I’m in the same boat as @rogersmj and don’t see any activity in the OZW log when I push any of the buttons.
Has there been any development on getting this device supported out of the box in hass?
Thanks!
Grant

I’m pretty sure the last time I set this up I was able to do most if not all from the web interface (I was using the File Editor add-on from hass-io).

I seem to recall I added the controller to each group association for the 5-button controller. Once I did this the events were firing.

To make it easier I use this custom component from @blakeblackshear which I wish would get added to release (https://github.com/blakeblackshear/rpi-zwave-hub/tree/master/homeassistant/custom_components/cooper_controllers). This does all the work of refreshing the indicator values and masking to switch entities.

from there its just a simple automation.

- id: panel_status_upstairs
  alias: Upstairs Panel Status
  description: ''
  trigger:
    platform: state
    entity_id:
    - group.outside
    - group.basement_grp
    - group.frst_grp
    - group.master_bath_grp
    - group.upstairs_grp
  condition: []
  action:
    service_template: "{% if trigger.to_state.state == 'off' %}\n   switch.turn_off\n\
      {% else %}\n   switch.turn_on\n{% endif %}"
    data_template:
      entity_id: "{% if trigger.entity_id == 'group.outside' %}\n  switch.node_36_button_5\n\
        {% elif trigger.entity_id == 'group.basement_grp' %}\n  switch.node_36_button_4\n\
        {% elif trigger.entity_id == 'group.frst_grp' %}\n  switch.node_36_button_3\n\
        {% elif trigger.entity_id == 'group.master_bath_grp' %}\n  switch.node_36_button_2\n\
        {% elif trigger.entity_id == 'group.upstairs_grp' %}\n  switch.node_36_button_1\n\
        {% endif %}\n"
- id: panel_ctrl_upstairs
  alias: Upstairs Panel Control
  description: ''
  trigger:
    platform: state
    entity_id:
    - switch.node_36_button_1
    - switch.node_36_button_2
    - switch.node_36_button_3
    - switch.node_36_button_4
    - switch.node_36_button_5
  condition:
    condition: template
    value_template: "{% if trigger.entity_id == 'switch.node_36_button_5' %}\n  {{\
      \ trigger.to_state.state != states('group.outside') }}\n{% elif trigger.entity_id\
      \ == 'switch.node_36_button_4' %}\n  {{ trigger.to_state.state != states('group.basement_grp')\
      \ }}\n{% elif trigger.entity_id == 'switch.node_36_button_3' %}\n  {{ trigger.to_state.state\
      \ != states('group.frst_grp') }}\n{% elif trigger.entity_id == 'switch.node_36_button_2'\
      \ %}\n  {{ trigger.to_state.state != states('group.master_bath_grp') }}\n{%\
      \ elif trigger.entity_id == 'switch.node_36_button_1' %}\n  {{ trigger.to_state.state\
      \ != states('group.upstairs_grp') }}\n{% endif %}\n"
  action:
    service_template: "{% if trigger.to_state.state == 'off' %}\n   homeassistant.turn_off\n\
      {% else %}\n   homeassistant.turn_on\n{% endif %}"
    data_template:
      entity_id: "{% if trigger.entity_id == 'switch.node_36_button_5' %}\n  group.outside\n\
        {% elif trigger.entity_id == 'switch.node_36_button_4' %}\n  group.basement_grp\n\
        {% elif trigger.entity_id == 'switch.node_36_button_3' %}\n  group.frst_grp\n\
        {% elif trigger.entity_id == 'switch.node_36_button_2' %}\n  group.master_bath_grp\n\
        {% elif trigger.entity_id == 'switch.node_36_button_1' %}\n  group.upstairs_grp\n\
        {% endif %}\n"

Hope that helps.

Devan

I just got one working, which was super frustrating, but I was able to piece together the method from posts on the forums. Few notes, need to shutdown HA before editing the zwcfg***.xml or the changes won’t take. I don’t think I was able to get everything setup properly using the web interface, it didn’t seem to take everything all the time, so I downloaded a separate program (Z-Wave PC Controller from Silicon Labs) to properly program my zwave hub usb stick, I found a post with the download and describing what you need to do from another site. I also used @blakeblackshear custom component to keep everything in sync.

After a lot of fiddling around with it, I got it working and it is really rock solid. One of my favorite devices now. Good luck

What did you have to edit in zwcfg? Was it an old install? On my most recent build (early this year) I did not have to edit this at all.

Regards,
Devan

I had to add the central scene command class stuff that @gsads linked to. I don’t recall seeing it in there already. You didn’t have to do this? I installed on 0.105, I just assumed I had to since it seems like that is what people mentioned doing in the forums, also because of the aforementioned link.

So… I rebuilt my entire instance from scratch thinking that maybe it wasn’t working due to it being an old original install. Turns out, it wasn’t the problem. I’ve modified my zwcfg***.xml and added the custom components with the help of this post: How to add community build component to home assistant. Still no dice… nothing happening in the OZW log.
One thing that I’m confused about is this comment:

@Devanl Can you please explain exactly what this means? Are you going in to Z-Wave Node Management, picking the scene controller (RFWDC), and then adding Node group associations?

Grant

Correct, I’m adding the HA controller node to the node group associations for each button.

captured

I did have a problem where I had to reload the window between creating each association to get the fields to populate correctly.

Regards,
Devan

@Devanl Thanks so much for your posts :slight_smile:
Did that, as follows (similar for all 5 groups):

As you mentioned, I had to refresh and re-choose the Z-Stick multiple times for it to register. I was trailing the OZW log file to make sure I saw it there.

Still no action in OZW log on button press. Just to confirm, I have not put anything in my configuration.yaml file yet… I’m waiting to see the button press register in the log file before I move on to that step.
What am I missing?

Grant

May want to check if the events are firing in the developer pane of HA. I have seen entries missing from my OZW log in the past.

Devan

Unfortunately nothing there either. I’ve read and re-read this and other threads to see if I can find where I went wrong. I noticed a couple of things:

  1. In the Z-Wave Node Management screen, after selecting my scene-controller, I don’t see any Entities when I select the Entities field. Is this correct?
  2. In the Z-Wave Node Management screen, after selecting my scene-controller, I don’t see anything in the Node Configuration Options drop-down as per the following post above: Event support for Scene Controllers Is this correct?

I’m thinking that maybe somehow my device is configured differently than yours. In fact, I purchased it through Clare Controls (it’s their version of the original Cooper device). Any chance you can send me the entry in your zwcfg***.xml file? Mine is below (node is now 9… I removed and re-added):

	<Node id="9" name="Scene Contrl" location="" basic="2" generic="2" specific="2" type="Static Scene Controller" listening="true" frequentListening="false" beaming="true" routing="false" max_baud_rate="40000" version="3" query_stage="Complete">
		<Manufacturer id="1a" name="Eaton">
			<Product type="574d" id="fa00" name="Unknown: type=574d, id=fa00" />
		</Manufacturer>
		<CommandClasses>
			<CommandClass id="32" name="COMMAND_CLASS_BASIC" version="1" request_flags="4" after_mark="true">
				<Instance index="1" />
				<Value type="byte" genre="basic" instance="1" index="0" label="Basic" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
			</CommandClass>
			<CommandClass id="33" name="COMMAND_CLASS_CONTROLLER_REPLICATION" version="1" request_flags="4" innif="true">
				<Instance index="1" />
				<Value type="byte" genre="system" instance="1" index="0" label="Node" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
				<Value type="list" genre="system" instance="1" index="1" label="Functions" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="0" size="1">
					<Item label="Groups" value="49" />
					<Item label="Group Names" value="50" />
					<Item label="Scenes" value="51" />
					<Item label="Scene Names" value="52" />
				</Value>
				<Value type="button" genre="system" instance="1" index="2" label="Replicate" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
			</CommandClass>
			<CommandClass id="34" name="COMMAND_CLASS_APPLICATION_STATUS" version="1" request_flags="4" innif="true">
				<Instance index="1" />
			</CommandClass>
			<CommandClass id="43" name="COMMAND_CLASS_SCENE_ACTIVATION" version="1" request_flags="4" after_mark="true">
				<Instance index="1" />
			</CommandClass>
			<CommandClass id="91" name="COMMAND_CLASS_CENTRAL_SCENE" version="1" request_flags="5" innif="true" scenecount="0">
				<Instance index="1" />
				<Value type="int" genre="system" instance="1" index="0" label="Scene Count" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
				<Value type="int" genre="system" instance="1" index="1" label="Button One" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
				<Value type="int" genre="system" instance="1" index="2" label="Button Two" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
				<Value type="int" genre="system" instance="1" index="3" label="Button Three" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
				<Value type="int" genre="system" instance="1" index="4" label="Button Four" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
				<Value type="int" genre="system" instance="1" index="5" label="Button Five" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
			</CommandClass>
			<CommandClass id="112" name="COMMAND_CLASS_CONFIGURATION" version="1" request_flags="4" innif="true">
				<Instance index="1" />
			</CommandClass>
			<CommandClass id="114" name="COMMAND_CLASS_MANUFACTURER_SPECIFIC" version="1" request_flags="4" innif="true">
				<Instance index="1" />
			</CommandClass>
			<CommandClass id="119" name="COMMAND_CLASS_NODE_NAMING" version="1" request_flags="4" innif="true">
				<Instance index="1" />
			</CommandClass>
			<CommandClass id="133" name="COMMAND_CLASS_ASSOCIATION" version="1" request_flags="4" innif="true">
				<Instance index="1" />
				<Associations num_groups="255">
					<Group index="1" max_associations="232" label="Group 1" auto="true">
						<Node id="1" />
					</Group>
					<Group index="2" max_associations="232" label="Group 2" auto="false">
						<Node id="1" />
					</Group>
					<Group index="3" max_associations="232" label="Group 3" auto="false">
						<Node id="1" />
					</Group>
					<Group index="4" max_associations="232" label="Group 4" auto="false">
						<Node id="1" />
					</Group>
					<Group index="5" max_associations="232" label="Group 5" auto="false">
						<Node id="1" />
					</Group>
					<Group index="255" max_associations="1" label="Group 255" auto="false" />
				</Associations>
			</CommandClass>
			<CommandClass id="134" name="COMMAND_CLASS_VERSION" version="1" request_flags="4" innif="true">
				<Instance index="1" />
				<Value type="string" genre="system" instance="1" index="0" label="Library Version" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="1" />
				<Value type="string" genre="system" instance="1" index="1" label="Protocol Version" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="2.78" />
				<Value type="string" genre="system" instance="1" index="2" label="Application Version" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="4.05" />
			</CommandClass>
			<CommandClass id="135" name="COMMAND_CLASS_INDICATOR" version="1" request_flags="4" innif="true">
				<Instance index="1" />
				<Value type="byte" genre="user" instance="1" index="0" label="Indicator" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
			</CommandClass>
		</CommandClasses>
	</Node>

Thanks again for everything.

Grant