Diese ist eine MoesGo Zigbee Tuya Fernbedienung und ist "out of the Box". Daher ohne Veränderung an ihr Vorgenommen zu haben ist diese nutzbar.
Ich nutze diese mit meinem Tuya Tasmota Zigbee Hub über MQTT und Openhab 3.1.
Die Fernbedienung lässt sich über das Anlernverfahren mit dem Hub pairen.
Einschalten des Kanals "Doppelklick"
Ausschalten des Kanals "Single Klick"
Pairen: "langer langer klick"
Ich empfehle anschließend im Zigbeemodul folgende Commands, um die spätere Einrichtung, bei voller Ahnungslosigkeit (wie bei mir auch der Fall ) anzuwenden:
"SetOption101"
Das Gerät nutzt 4 Endpoints für die Kanäle.
Das heißt es macht z.b.
Taste 1 "Doppelklick"
..."Lidlpower":1 , "Endpoint" 1
Taste 3 "einfachklick"
..."Lidlpower":0 , "Endpoint" 3
Mit dem Command wird es viel einfacher!
Danach erhält der Endpoint einen eigenen leichter definiertes Attribut:
Z.b.
tele/tasmota_945D3D/<remotedevice>_1/SENSOR = {"ZbReceived":{"0x<remotedevice>":{"Device":"0x<remotedevice>","0006!FD":"00","LidlPower1":0,"Endpoint":1,"LinkQuality":84}}}
Es wird viel einfacher über MQTT anzusprechen, weil die Endpointvariable entfällt, und nicht mehr Interpretiert werden muss.
Nun im Openhab:
In Scriptform ist es einfacher, auch für euch zum kopieren.
Code: Alles auswählen
UID: <euer UID>
label: <thingname>
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:<euer broker>
channels:
- id: Taste_1
channelTypeUID: mqtt:switch
label: Taste 1
description: ""
configuration:
commandTopic: cmnd/<zbbridgename>/<remotedevice>_1/ZbSend
formatBeforePublish: '{"device":"0x<remotedevice>","send":{"LidlPower1":%s}}'
stateTopic: tele/<zbbridgename>/<remotedevice>_1/SENSOR
transformationPattern: JSONPATH:$.ZbReceived.0x<remotedevice>LidlPower1
off: "0"
on: "1"
- id: Taste_2
channelTypeUID: mqtt:switch
label: Taste 2
description: ""
configuration:
commandTopic: cmnd/<zbbridgename>/<remotedevice>_2/ZbSend
formatBeforePublish: '{"device":"0x<remotedevice>","send":{"LidlPower22":%s}}'
stateTopic: tele/<zbbridgename>/<remotedevice>_2/SENSOR
transformationPattern: JSONPATH:$.ZbReceived.0x<remotedevice>.LidlPower22
off: "0"
on: "1"
- id: Taste_3
channelTypeUID: mqtt:switch
label: Taste 3
description: ""
configuration:
commandTopic: cmnd/<zbbridgename>/<remotedevice>_3/ZbSend
formatBeforePublish: '{"device":"0x<remotedevice>","send":{"LidlPower33":%s}}'
stateTopic: tele/<zbbridgename>/<remotedevice>_3/SENSOR
transformationPattern: JSONPATH:$.ZbReceived.0x<remotedevice>.LidlPower33
off: "0"
on: "1"
- id: Taste_4
channelTypeUID: mqtt:switch
label: Taste 4
description: ""
configuration:
commandTopic: cmnd/<zbbridgename>/<remotedevice>_4/ZbSend
formatBeforePublish: '{"device":"0x<remotedevice>","send":{"LidlPower44":%s}}'
stateTopic: tele/<zbbridgename>/<remotedevice>_4/SENSOR
transformationPattern: JSONPATH:$.ZbReceived.0x<remotedevice>.LidlPower44
off: "0"
on: "1"
Empfiehlt sich, weil wenn die kleine 12V Batterie leer sein sollte, könnt ihr es noch über den Computer, oder Smartphone steuern.
Nun legt ihr nur noch zwei steuernde Rules pro Kanal an.
Z.b. bei mir schaltet dies die Steckdosenleiste, und den Fernseher über den Harmonyhub.
EIN:
Code: Alles auswählen
configuration: {}
triggers:
- id: "1"
configuration:
itemName: SceneRemoteTVHiFiGaming_Taste1
state: ON
previousState: OFF
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "4"
configuration:
itemName: Wohnwandfunksteckdosenleiste_Fernsehersteckdose
command: ON
type: core.ItemCommandAction
- inputs: {}
id: "3"
configuration:
command: PowerToggle
itemName: SamsungDVR_SendButtonPress
type: core.ItemCommandAction
- inputs: {}
id: "5"
configuration:
blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
type="oh_sleep" id="u]c1`2c)_iE{=x4/bib3" x="198" y="86"><field
name="milliseconds">10000</field></block></xml>
type: application/javascript
script: |
var thread = Java.type('java.lang.Thread')
thread.sleep(10000);
type: script.ScriptAction
- inputs: {}
id: "2"
configuration:
command: PowerOn
itemName: ToshibaTV_SendButton
type: core.ItemCommandAction
Code: Alles auswählen
configuration: {}
triggers:
- id: "1"
configuration:
itemName: SceneRemoteTVHiFiGaming_Taste1
state: OFF
previousState: ON
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "3"
configuration:
blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
type="oh_sleep" id="nk5^![:$8Zrz~%nPCaZJ" x="132" y="81"><field
name="milliseconds">5000</field></block></xml>
type: application/javascript
script: |
var thread = Java.type('java.lang.Thread')
thread.sleep(5000);
type: script.ScriptAction
- inputs: {}
id: "2"
configuration:
command: PowerOff
itemName: ToshibaTV_SendButton
type: core.ItemCommandAction
- inputs: {}
id: "4"
configuration:
command: PowerToggle
itemName: SamsungDVR_SendButtonPress
type: core.ItemCommandAction
- inputs: {}
id: "5"
configuration:
itemName: Wohnwandfunksteckdosenleiste_Fernsehersteckdose
command: OFF
type: core.ItemCommandAction
Wünsche euch viel Spaß.
Frohe Ostern