dinglifeng 发表于 2021-7-22 16:03:03

使用IOS系统homekit自带遥控控制电视

本帖最后由 dinglifeng 于 2021-7-22 20:37 编辑

自从用了HA,家里各种遥控器都闲置了下来,着急用的时候又没电池,没办法只能想办法把它尽量放到手机里一起控制了

遥控学码就不用赘述了吧,我用的RM4 pro,各位客官用啥都可以,反正就是学习红外吗呗,教程一大堆。
开关状态反馈的话我用的aqara的插头,zigbee协议,各位用啥都行,没有或者不需要的话,把状态反馈的流删掉就可以了(“Samsung TV Status”和“转换”两个删掉)Homekit添加码默认都是1,有特殊需求的自己修改一下

流放下面了,各位自取吧,把所有节点点开确认一下需要修改的内容,特别是蓝色的部分。



试试文件方式


[{"id":"8fb2612e.4eb98","type":"tab","label":"Samsung Television","disabled":false,"info":""},{"id":"a9e569de.eb508","type":"inject","z":"8fb2612e.4eb98","name":"TV on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"Active\":1}","payloadType":"json","x":210,"y":220,"wires":[["93bc492d.3d6848"]]},{"id":"250f61e5.cdbe8e","type":"inject","z":"8fb2612e.4eb98","name":"TV off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"Active\":0}","payloadType":"json","x":210,"y":260,"wires":[["93bc492d.3d6848"]]},{"id":"db46bcc.eec00c","type":"debug","z":"8fb2612e.4eb98","name":"State and source output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":60,"wires":[]},{"id":"d01e0a4e.49da68","type":"debug","z":"8fb2612e.4eb98","name":"Volume output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":580,"wires":[]},{"id":"26b7c791.d278","type":"inject","z":"8fb2612e.4eb98","name":"TV Setup","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":220,"y":160,"wires":[["404e9088.92a208"]]},{"id":"404e9088.92a208","type":"function","z":"8fb2612e.4eb98","name":"Setup TV","func":"var name = \"Samsung TV\";\n\nmsg.payload = {\n \"ConfiguredName\": name,\n \"ActiveIdentifier\" : 0,\n \"SleepDiscoveryMode\" : 0,\n \"Active\" : 0\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":160,"wires":[["93bc492d.3d6848"]]},{"id":"93bc492d.3d6848","type":"homekit-service","z":"8fb2612e.4eb98","isParent":true,"hostType":"0","bridge":"f6a4260d.7e51e","accessoryId":"","parentService":"","name":"Samsung TV","serviceName":"Television","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","firmwareRev":"","hardwareRev":"","softwareRev":"","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{    \"RemoteKey\":null}","waitForSetupMsg":false,"outputs":2,"x":610,"y":220,"wires":[["9db07332.5cc9"],["91845793.afa5a8"]]},{"id":"983c3244.9dfbe8","type":"homekit-service","z":"8fb2612e.4eb98","isParent":false,"bridge":"f6a4260d.7e51e","parentService":"93bc492d.3d6848","name":"Television Speaker","serviceName":"TelevisionSpeaker","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","firmwareRev":"","hardwareRev":"","softwareRev":"","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\"VolumeControlType\":1,\"VolumeSelector\":true,\"Mute\":true}","waitForSetupMsg":false,"outputs":2,"x":450,"y":500,"wires":[[],["d01e0a4e.49da68","9d9db8f5.590a38"]]},{"id":"a033f0fd.75fb1","type":"inject","z":"8fb2612e.4eb98","name":"find out what Characteristics","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"foo\":\"bar\"}","payloadType":"json","x":180,"y":500,"wires":[["983c3244.9dfbe8"]]},{"id":"9d9343d8.f8148","type":"api-call-service","z":"8fb2612e.4eb98","name":"Samsung TV On/Off","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.samsung_tv_power","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1040,"y":160,"wires":[[]]},{"id":"9db07332.5cc9","type":"switch","z":"8fb2612e.4eb98","name":"Active","property":"payload.Active","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":160,"wires":[["9d9343d8.f8148"],["9d9343d8.f8148"]]},{"id":"9d9db8f5.590a38","type":"switch","z":"8fb2612e.4eb98","name":"Volume","property":"payload.VolumeSelector","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":520,"wires":[["57842ca0.f84424"],["86d96e5c.ecda1"]]},{"id":"57842ca0.f84424","type":"api-call-service","z":"8fb2612e.4eb98","name":"Volume Increase","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_volume_increase","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":520,"wires":[[]]},{"id":"86d96e5c.ecda1","type":"api-call-service","z":"8fb2612e.4eb98","name":"Volume decrease","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_volume_decrease","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":930,"y":580,"wires":[[]]},{"id":"91845793.afa5a8","type":"switch","z":"8fb2612e.4eb98","name":"RemoteKey","property":"payload.RemoteKey","propertyType":"msg","rules":[{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"5","vt":"str"},{"t":"eq","v":"6","vt":"str"},{"t":"eq","v":"7","vt":"str"},{"t":"eq","v":"8","vt":"str"},{"t":"eq","v":"9","vt":"str"},{"t":"eq","v":"11","vt":"str"},{"t":"eq","v":"15","vt":"str"}],"checkall":"true","repair":false,"outputs":8,"x":830,"y":320,"wires":[["db0f9ab2.0cda"],["1bb1a7a8.399bc8"],["e5bfde90.179dd"],["678f4b12.2af0f4"],["3567981c.0d8ef8"],["9acf0762.fe7d98"],["485bd21e.b06724"],[]]},{"id":"e5bfde90.179dd","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_ARROW_LEFT","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_arrow_left","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1230,"y":340,"wires":[[]]},{"id":"678f4b12.2af0f4","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_ARROW_RIGHT","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_arrow_right","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1240,"y":400,"wires":[[]]},{"id":"3567981c.0d8ef8","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_SELECT","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_ok","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":460,"wires":[[]]},{"id":"9acf0762.fe7d98","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_BACK","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_back","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":520,"wires":[[]]},{"id":"d94aaf52.cf903","type":"change","z":"8fb2612e.4eb98","name":"转换","rules":[{"t":"change","p":"topic","pt":"msg","from":"switch.samsung_tv_power","fromt":"str","to":"","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"{\"Active\":1}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"{\"Active\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":100,"wires":[["93bc492d.3d6848","db46bcc.eec00c"]]},{"id":"a7949ec4.c9316","type":"server-state-changed","z":"8fb2612e.4eb98","name":"Samsung TV status","server":"d06297cb.c4f038","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.samsung_tv_power","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":80,"wires":[["d94aaf52.cf903"]]},{"id":"db0f9ab2.0cda","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_ARROW_up","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_arrow_up","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1220,"y":220,"wires":[[]]},{"id":"1bb1a7a8.399bc8","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_ARROW_down","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_arrow_down","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1230,"y":280,"wires":[[]]},{"id":"485bd21e.b06724","type":"api-call-service","z":"8fb2612e.4eb98","name":"TV_home","server":"d06297cb.c4f038","version":3,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":"script.samsung_home","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":580,"wires":[[]]},{"id":"f6a4260d.7e51e","type":"homekit-bridge","bridgeName":"Television Bridge","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","firmwareRev":"","hardwareRev":"","softwareRev":"","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":false},{"id":"d06297cb.c4f038","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]





Tao173 发表于 2021-7-22 16:35:38

本帖最后由 Tao173 于 2021-7-22 16:38 编辑

棒{:3_48:}但是导入不了,重新传一下?

wyh260595711 发表于 2021-7-22 20:18:53

……多谢分享

dinglifeng 发表于 2021-7-22 20:31:27

本帖最后由 dinglifeng 于 2021-7-22 20:39 编辑

Tao173 发表于 2021-7-22 16:35
棒但是导入不了,重新传一下?
用工具校验一下,我自己导入倒是正常。。。。。用附件文件试试看

zxyny1989 发表于 2021-7-23 00:22:20

谢谢分享。

wyh260595711 发表于 2021-7-23 06:46:44

输入源那块怎么加入哈?

gaokaowm 发表于 2021-7-27 16:17:19

学习了,看看怎么弄

zjp0225 发表于 2021-7-27 21:44:44

状态反馈和控制完全可以使用API


Always_67 发表于 2021-7-30 10:56:47

只有暂停键有反应,显示remotekey=11怎么办呢?

dinglifeng 发表于 2021-7-30 12:57:01

Always_67 发表于 2021-7-30 10:56
只有暂停键有反应,显示remotekey=11怎么办呢?

11 链接的后面的流是啥?
页: [1] 2 3
查看完整版本: 使用IOS系统homekit自带遥控控制电视