OpenZWave / open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
http://www.openzwave.net/
GNU Lesser General Public License v3.0
1.05k stars 916 forks source link

Eaton/Cooper RF9500 battery switch #1632

Closed apetrycki closed 5 years ago

apetrycki commented 5 years ago

The switch is recognized and the toggle works to some extent, but the dimming does not. I assume it's because it's set to generic="18" and specific="0" instead of specific="2" to be a multi-level remote switch.

 <Generic key="0x12" label="Remote Switch" command_classes="0xef,0x20">
    <Specific key="0x01" label="Binary Remote Switch" command_classes="0xef,0x25" basic="0x25"/>
    <Specific key="0x02" label="Multilevel Remote Switch" command_classes="0xef,0x26" basic="0x26"/>
    <Specific key="0x03" label="Binary Toggle Remote Switch" command_classes="0xef,0x28" basic="0x28"/>
    <Specific key="0x04" label="Multilevel Toggle Remote Switch" command_classes="0xef,0x29" basic="0x29"/>
  </Generic>

I couldn't figure out a way to change this to test it as I'm new to the code. The command class is specified in the XML, but I'm guessing it's not being used:

    <Node id="18" name="Battery Switch" location="" basic="4" generic="18" specific="0" type="Remote Switch" listening="false" frequentListening="false" beaming="true" routing="true" max_baud_rate="40000" version="4" secured="true" query_stage="CacheLoad">
        <Manufacturer id="1a" name="Cooper">
            <Product type="5342" id="0" name="RF9500 Light Switch" />
        </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="255" />
            </CommandClass>
            <CommandClass id="38" name="COMMAND_CLASS_SWITCH_MULTILEVEL" version="1" after_mark="true" innif="true">
                <Instance index="1" />
                <Value type="byte" genre="user" instance="1" index="0" label="Level" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
                <Value type="button" genre="user" instance="1" index="1" label="Bright" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
                <Value type="button" genre="user" instance="1" index="2" label="Dim" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
                <Value type="bool" genre="system" instance="1" index="3" label="Ignore Start Level" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="True" />
                <Value type="byte" genre="system" instance="1" index="4" label="Start Level" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
            </CommandClass>
            <CommandClass id="114" name="COMMAND_CLASS_MANUFACTURER_SPECIFIC" version="1" request_flags="4" innif="true">
                <Instance index="1" />
            </CommandClass>
            <CommandClass id="115" name="COMMAND_CLASS_POWERLEVEL" version="1" request_flags="4" innif="true">
                <Instance index="1" />
                <Value type="list" genre="system" instance="1" index="0" label="Powerlevel" units="dB" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="0" size="1">
                    <Item label="Normal" value="0" />
                    <Item label="-1dB" value="1" />
                    <Item label="-2dB" value="2" />
                    <Item label="-3dB" value="3" />
                    <Item label="-4dB" value="4" />
                    <Item label="-5dB" value="5" />
                    <Item label="-6dB" value="6" />
                    <Item label="-7dB" value="7" />
                    <Item label="-8dB" value="8" />
                    <Item label="-9dB" value="9" />
                </Value>
                <Value type="byte" genre="system" instance="1" index="1" label="Timeout" units="seconds" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
                <Value type="button" genre="system" instance="1" index="2" label="Set Powerlevel" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
                <Value type="byte" genre="system" instance="1" index="3" label="Test 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="4" label="Test Powerlevel" units="dB" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="0" size="1">
                    <Item label="Normal" value="0" />
                    <Item label="-1dB" value="1" />
                    <Item label="-2dB" value="2" />
                    <Item label="-3dB" value="3" />
                    <Item label="-4dB" value="4" />
                    <Item label="-5dB" value="5" />
                    <Item label="-6dB" value="6" />
                    <Item label="-7dB" value="7" />
                    <Item label="-8dB" value="8" />
                    <Item label="-9dB" value="9" />
                </Value>
                <Value type="short" genre="system" instance="1" index="5" label="Frame Count" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="-32768" max="32767" value="0" />
                <Value type="button" genre="system" instance="1" index="6" label="Test" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
                <Value type="button" genre="system" instance="1" index="7" label="Report" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
                <Value type="list" genre="system" instance="1" index="8" label="Test Status" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="0" size="1">
                    <Item label="Failed" value="0" />
                    <Item label="Success" value="1" />
                    <Item label="In Progress" value="2" />
                </Value>
                <Value type="short" genre="system" instance="1" index="9" label="Acked Frames" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-32768" max="32767" value="0" />
            </CommandClass>
            <CommandClass id="117" name="COMMAND_CLASS_PROTECTION" version="1" request_flags="4" innif="true">
                <Instance index="1" />
                <Value type="list" genre="system" instance="1" index="0" label="Protection" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="0" size="1">
                    <Item label="Unprotected" value="0" />
                    <Item label="Protection by Sequence" value="1" />
                    <Item label="No Operation Possible" value="2" />
                </Value>
            </CommandClass>
            <CommandClass id="119" name="COMMAND_CLASS_NODE_NAMING" version="1" request_flags="4" innif="true">
                <Instance index="1" />
            </CommandClass>
            <CommandClass id="130" name="COMMAND_CLASS_HAIL" version="1" request_flags="4" innif="true">
                <Instance index="1" />
            </CommandClass>
            <CommandClass id="132" name="COMMAND_CLASS_WAKE_UP" version="1" request_flags="2">
                <Instance index="1" />
                <Value type="int" genre="system" instance="1" index="0" label="Wake-up Interval" units="Seconds" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="3600" />
            </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="5" label="Group #1" auto="true">
                        <Node id="1" />
                    </Group>
                    <Group index="255" max_associations="1" label="Group #255" auto="true">
                        <Node id="1" />
                    </Group>
                </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="3" />
                <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="3.67" />
                <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="3.11" />
            </CommandClass>
        </CommandClasses>
    </Node>

I tried adding the device to the manufacturer_specific.xml:

        <Manufacturer id="001a" name="Cooper">
                <Product type="4441" id="0000" name="RF9542-Z Accessory Dimmer" config="cooper/RF9542-Z.xml"/>
                <Product type="4449" id="0002" name="RF9534DS Wall Dimmer Module"/>
                <Product type="4449" id="0101" name="RF9540-N All Load Dimmer Light Switch" config="cooper/RF9540-N.xml"/>
                <Product type="5244" id="0000" name="RF9505-T Split Control Duplex Receptacle" config="cooper/RF9505-T.xml"/>
                <Product type="5342" id="0000" name="RF9500 Light Switch" config="cooper/RF9500.xml"/>
                <Product type="534c" id="0000" name="RF9501 Light Switch" config="cooper/RF9501.xml"/>
                <Product type="5352" id="0000" name="RF9517 Accessory Light Switch" config="cooper/RF9517.xml"/>
                <Product type="574d" id="0000" name="RFWC5/RFWDC Scene Controller" config="cooper/RFWC5.xml"/>
        </Manufacturer>

and created the config XML:

<?xml version="1.0" encoding="utf-8"?>
<Product xmlns='http://code.google.com/p/open-zwave/'>
        <!-- Basic set as report -->
        <CommandClass id="32" setasreport="true"/>
        <!-- Multilevel set as report -->
        <CommandClass id="38" setasreport="true"/>
</Product>

I'm not sure if setasreport is right or not, but it didn't seem to break anything. It still doesn't seem to register when I press the dimming buttons, though:

2018-10-19 11:48:48.047 Detail, Node018,   Received: 0x01, 0x0b, 0x00, 0x04, 0x00, 0x12, 0x05, 0x26, 0x04, 0x20, 0x01, 0x04, 0xe0
2018-10-19 11:48:48.063 Detail, Node018,   Received: 0x01, 0x08, 0x00, 0x04, 0x00, 0x12, 0x02, 0x82, 0x01, 0x60
2018-10-19 11:48:48.064 Info, Node018, Received Hail command from node 18
2018-10-19 11:48:48.206 Detail, Node018,   Received: 0x01, 0x08, 0x00, 0x04, 0x00, 0x12, 0x02, 0x26, 0x05, 0xc0
2018-10-19 11:48:48.224 Detail, Node018,   Received: 0x01, 0x08, 0x00, 0x04, 0x00, 0x12, 0x02, 0x82, 0x01, 0x60
2018-10-19 11:48:48.224 Info, Node018, Received Hail command from node 18

0x26 should be the dimming command.

There is a SmartThings device handler here: https://github.com/ericvitale/ST-Cooper-RF9500-Beast/blob/master/devicetypes/ericvitale/cooper-rf9500-beast.src/cooper-rf9500-beast.groovy It worked when I was using ST.

Info from Z-Wave Alliance:

<?xml version="1.0" encoding="utf-8"?>
<ProductExport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Id>416</Id>
  <Name>RF9500</Name>
  <Description>Universal switch/dimmer.The ASPIRE RF Battery Operated Switch/Dimmer controls RF receptacles, switches or dimmers to provide remote ON/OFF/DIM/BRIGHT control and provides other programmable functions (association, child lockout, etc.) when used with ASPIRE RF or other Z-Wave® compliant products. The ASPIRE RF Battery Operated Switch/Dimmer utilizes two CR2025 batteries and mounts flush to the wall. No wiring is required. Use with RFBS22.
</Description>
  <Brand>ASPIRE RF Wireless by Eaton Wiring</Brand>
  <Identifier>RF9500</Identifier>
  <CertificationNumber>ZC08-08020002</CertificationNumber>
  <OemVersion>v.1.10</OemVersion>
  <HardwarePlatform>ZW0200</HardwarePlatform>
  <ZWaveVersion>4.25</ZWaveVersion>
  <LibraryType>Routing Slave</LibraryType>
  <DeviceType>Not Z-Wave Plus</DeviceType>
  <ManufacturerId />
  <ProductTypeId />
  <ProductId />
  <FrequencyName>U.S. / Canada / Mexico</FrequencyName>
  <ProductUrl>http://www.cooperindustries.com/content/public/en/wiring_devices/products/lighting_controls/residential/aspire_rf_wireless/dimmers/as</ProductUrl>
  <SupportUrl>http://www.cooperindustries.com/content/public/en/wiring_devices/about_us/contact_us.html</SupportUrl>
  <InclusionDescription />
  <ExclusionDescription />
  <LearnModeDescription />
  <ResetDescription />
  <WakeupDescription />
  <OtherSpecialFeaturesDescription />
  <CertificationApprovedDate>0001-01-01T00:00:00</CertificationApprovedDate>
  <Image>https://products.z-wavealliance.org/ProductImages/Index?productName=ZC08-08020002</Image>
  <Categories>
    <string>All Lighting Devices</string>
    <string>Lighting Accessories</string>
  </Categories>
  <SupportedCommandClasses>
    <CommandClassExport>
      <Name>Association V1</Name>
      <Identifier>COMMAND_CLASS_ASSOCIATION</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Basic V1</Name>
      <Identifier>COMMAND_CLASS_BASIC</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Manufacturer Specific V1</Name>
      <Identifier>COMMAND_CLASS_MANUFACTURER_SPECIFIC</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Multilevel Switch V1</Name>
      <Identifier>COMMAND_CLASS_SWITCH_MULTILEVEL</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>No Operation</Name>
      <Identifier>COMMAND_CLASS_NO_OPERATION</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Node Naming and Location</Name>
      <Identifier>COMMAND_CLASS_NODE_NAMING</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Powerlevel</Name>
      <Identifier>COMMAND_CLASS_POWERLEVEL</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Protection V1</Name>
      <Identifier>COMMAND_CLASS_PROTECTION</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Version V1</Name>
      <Identifier>COMMAND_CLASS_VERSION</Identifier>
    </CommandClassExport>
  </SupportedCommandClasses>
  <ControlledCommandClasses>
    <CommandClassExport>
      <Name>Basic V1</Name>
      <Identifier>COMMAND_CLASS_BASIC</Identifier>
    </CommandClassExport>
    <CommandClassExport>
      <Name>Multilevel Switch V1</Name>
      <Identifier>COMMAND_CLASS_SWITCH_MULTILEVEL</Identifier>
    </CommandClassExport>
  </ControlledCommandClasses>
  <S2Classes />
  <AssociationGroups />
  <ConfigurationParameters />
  <Features />
  <Supports_NWI>false</Supports_NWI>
  <Supports_Explorer>false</Supports_Explorer>
  <is_FLiRS>false</is_FLiRS>
  <Supports_SmartStart>false</Supports_SmartStart>
</ProductExport>

If I can get some guidance as a noob, I'm more than happy to fix it.

Fishwaldo commented 5 years ago

I couldn't figure out a way to change this to test it as I'm new to the code.

You can't - Its sent by the device.

I'm not sure if setasreport is right or not

It shouldn't be needed. In fact, you don't need anything for those CommandClasses. They should be autodiscovered

You should only enter in the Configuration CC details and Associations Info

2018-10-19 11:48:48.224 Info, Node018, Received Hail command from node 18

After that - It should refresh the other Command Classes.

But thats not too efficent. See if there is a configuration option to update to Send a MultiLevel SET instead of a Hail when the changes are made.

Please use our Forums for Questions regarding OpenZWave: https://groups.google.com/forum/#!forum/openzwave

Thanks