Skip to content
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

DDF add support for HEIMAN IR control HS2IRC #7860

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions devices/generic/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"$TYPE_CARBONMONOXIDE_SENSOR": "ZHACarbonMonoxide",
"$TYPE_FORMALDEHYDE_SENSOR": "ZHAFormaldehyde",
"$TYPE_PARTICULATEMATTER_SENSOR": "ZHAParticulateMatter",
"$TYPE_CONTROL_SENSOR": "ZHAControl",
"$TYPE_ALARM_SENSOR": "ZHAAlarm",
"$TYPE_ANCILLARY_CONTROL": "ZHAAncillaryControl",
"$TYPE_BATTERY_SENSOR": "ZHABattery",
Expand Down
8 changes: 8 additions & 0 deletions devices/generic/items/config_learnkey_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"schema": "resourceitem1.schema.json",
"id": "config/learnkey",
"datatype": "String",
"access": "RW",
"public": true,
"description": "Memorise code."
}
8 changes: 8 additions & 0 deletions devices/generic/items/config_sendkey_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"schema": "resourceitem1.schema.json",
"id": "config/sendkey",
"datatype": "String",
"access": "RW",
"public": true,
"description": "Send a code."
}
17 changes: 17 additions & 0 deletions devices/generic/subdevices/control_sensor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"schema": "subdevice1.schema.json",
"type": "$TYPE_CONTROL_SENSOR",
"name": "ZHAControl",
"restapi": "/sensors",
"order": 20,
"uuid": [
"$address.ext",
"0x01",
"0xFC82"
],
"items": [
"config/on",
"config/reachable",
"state/lastupdated"
]
}
81 changes: 81 additions & 0 deletions devices/heiman/HS2IRC_IR_control.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"schema": "devcap1.schema.json",
"manufacturername": "HEIMAN",
"modelid": "IRControl-EM",
"vendor": "HEIMAN",
"product": "HS2IRC",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_CONTROL_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0xFC82"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/lastupdated"
},
{
"name": "config/sendkey",
"write": {
"fn": "zcl:cmd",
"ep": "0x01",
"cl": "0xfc82",
"cmd": "0xf0",
"eval": "('0'+parseInt(Item.val.split(',')[0]).toString(16)).slice(-2) + ('0'+parseInt(Item.val.split(',')[1]).toString(16)).slice(-2);"
}
},
{
"name": "config/learnkey",
"write": {
"fn": "zcl:cmd",
"ep": "0x01",
"cl": "0xfc82",
"cmd": "0xf1",
"eval": "('0'+parseInt(Item.val.split(',')[0]).toString(16)).slice(-2) + ('0'+parseInt(Item.val.split(',')[1]).toString(16)).slice(-2);"
}
},
{
"name": "config/reachable"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
}
]
}
]
}
62 changes: 62 additions & 0 deletions general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5253,6 +5253,68 @@ These devices can operate on either battery or mains power, and can have a wide
</server>
</cluster>

<!-- HEIMAN -->
<cluster id="0xfc82" name="Heiman specific" mfcode="0x120b">
<description>Heiman specific attributes for the device HS2IRC.</description>
<server>
<command id="0xf4" dir="recv" name="Create ID" required="m" response="0xf5">
<description>Create model ID</description>
<payload>
<attribute id="0x0000" name="Model type" type="u8" default="0" required="m"></attribute>
</payload>
</command>
<command id="0xf1" dir="recv" name="Learn key" required="m" response="0xf2">
<description>Learn new code</description>
<payload>
<attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
<attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
</payload>
</command>
<command id="0xf0" dir="recv" name="Send key" required="m">
<description>Send a key</description>
<payload>
<attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
<attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
</payload>
</command>
<command id="0xf3" dir="recv" name="Delete key" required="m">
<description>Delete a key</description>
<payload>
<attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
<attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
</payload>
</command>
<command id="0xf6" dir="recv" name="Get list" required="m" response="0xf7">
<description>Get list code</description>
</command>
</server>
<client>
<command id="0xf2" dir="recv" name="Learn key response" required="m">
<description>The Response to the learn key request.</description>
<payload>
<attribute id="0x0000" type="u8" name="Id" required="m" default="0x00"></attribute>
<attribute id="0x0001" type="u8" name="Key Code" required="m" default="0x00"></attribute>
<attribute id="0x0002" type="u8" name="Result" required="m" default="0x00"></attribute>
</payload>
</command>
<command id="0xf7" dir="recv" name="Get list response" required="m">
<description>The Response to the Get list request.</description>
<payload>
<attribute id="0x0000" type="u8" name="Total" required="m" default="0x00"></attribute>
<attribute id="0x0001" type="u8" name="Number" required="m" default="0x00"></attribute>
<attribute id="0x0002" type="ostring" name="Payload" required="m" showas="hex"></attribute>
</payload>
</command>
<command id="0xf5" dir="recv" name="Create model response" required="m">
<description>The Response to the Create model request.</description>
<payload>
<attribute id="0x0000" type="u8" name="ID" required="m" default="0x00"></attribute>
<attribute id="0x0001" type="u8" name="Model type" required="m" default="0x00"></attribute>
</payload>
</command>
</client>
</cluster>

<!-- Tuya -->
<cluster id="0xe001" name="Tuya specific" mfcode="0x1141">
<description>Tuya Specific switch mode cluster.</description>
Expand Down