- 积分
- 999
- 金钱
- 886
- 威望
- 0
- 贡献
- 0
- HASS币
- 10
高级会员
- 积分
- 999
- 金钱
- 886
- HASS币
- 10
|
本帖最后由 三金 于 2020-2-2 22:01 编辑
ios有homekit实在太舒服了
之前我也试过安卓手机上用tileboard,但是间距的配置有点麻烦,放弃
安卓Tasker场景简单HA面板(随手乱做的,有点丑,但是意思表达出来就好)
家里人看电视,视频声音有点杂,建议静音
先在node-red建立流程,参考来自于:Node Red系列教程之四 用好安卓神器Tasker
流程
[{"id":"a2475b44.6eaed8","type":"api-call-service","z":"b9c5d80c.d92298","name":"继电器关","server":"560348a2.b2ab38","service_domain":"switch","service":"turn_off","data":"{"entity_id":"switch.ji_dian_qi_1"}","mergecontext":"","x":520,"y":1400,"wires":[[]]},{"id":"210b20c.98791e","type":"api-call-service","z":"b9c5d80c.d92298","name":"继电器开","server":"560348a2.b2ab38","service_domain":"switch","service":"turn_on","data":"{"entity_id":"switch.ji_dian_qi_1"}","mergecontext":"","x":520,"y":1320,"wires":[[]]},{"id":"53eb89e8.247578","type":"api-current-state","z":"b9c5d80c.d92298","name":"继电器状态开","server":"560348a2.b2ab38","halt_if":"on","override_topic":false,"override_payload":false,"entity_id":"switch.ji_dian_qi_1","x":360,"y":1320,"wires":[["210b20c.98791e"]]},{"id":"cb321735.c6d648","type":"api-current-state","z":"b9c5d80c.d92298","name":"继电器状态关","server":"560348a2.b2ab38","halt_if":"off","override_topic":false,"override_payload":false,"entity_id":"switch.ji_dian_qi_1","x":360,"y":1400,"wires":[["a2475b44.6eaed8"]]},{"id":"6dc6c7ea.d063f8","type":"http in","z":"b9c5d80c.d92298","name":"继电器","url":"/light","method":"get","upload":false,"swaggerDoc":"","x":190,"y":1360,"wires":[["53eb89e8.247578","cb321735.c6d648"]]},{"id":"560348a2.b2ab38","type":"server","z":"","name":"HomeAssistant","url":"http://localhost:8123","pass":"zxc","llat":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI0NzRmZmFlM2QxNWQ0NGYyYTFiZjRlNTAyNmE1NzExNSIsImlhdCI6MTU3OTU4NTkyMSwiZXhwIjoxODk0OTQ1OTIxfQ.x2fKJxHBeKx6CVzWwJkqA8nSSaNtSbifKqrEmSbdEGI"}]
然后在Tasker里建立场景,添加文本和开关
在开关的元素编辑->改变->任务中加入 HTTP GET,服务器处就填上面教程里说的地址,
最后就只需应用场景
我这里选择调出面板的触发条件是 长按音量+ 当然也可以选其他的
在配置文件里添加自己所需的触发条件
然后在任务里选择 代码->JavaScriptlet,添加如下代码:
destroyScene("HA" );
showScene( "HA", "Dialog", 0, 0, true, false);
这里HA是我的场景名字(其实我不清楚这个Scene的各个参数意义,不过能用就行)
同理可以在场景内的某一元素再调用另一个场景,比如我在主场景上加了‘卧室’按钮,然后再添加JavaScriptlet任务,就可以调出卧室场景(视频有效果展示的)
那个HTTP GET按理说可以换mqtt的,还可以反馈状态,但是mqtt和tasker我还不是太会用,就先这样
有点简单,但是闲着无聊,我感觉分享一下挺好的。
(其实是伸手伸惯了,有大佬带我们吃现成的就特别舒服)
前面太丑,附上我的Tileboard平均一下颜值
|
评分
-
参与人数 1 | 金钱 +20 |
HASS币 +10 |
收起
理由
|
囧
| + 20 |
+ 10 |
膜拜大神! |
查看全部评分
|