blinker自动化功能公测
blinker自动化功能开放测试了,通过app即可设置设备间的联动,使用方法如下:
1.在blinker群共享中下载最新版的app ( blinker-2.3.0-beta2或以上版本 ) ,并使用blinker lib dev3.0分支;参考例程:https://github.com/blinker-iot/b ... amples/Blinker_AUTO
2.设置触发器。DIY设备可在设备设置中编辑触发器,专属设备需要通过管理台添加;设置方法见:https://diandeng.tech/doc/actions-and-triggers
3.在 app菜单>智动化 中添加自动化规则。
相关问题,可通过回复本帖提问。
另祝大家,新年快乐
既然两个板子不能联动,就先来点简单的,用一个板子做实验:app上就用现成的例程,一个开关按钮btn-abc,一个计数按钮btn-123,一个数据显示器num-abc,想实现功能:点击开关按钮,除了板载led动作外,计数按钮btn-123跟着动作,从而实现技术显示器上数字的变化,谁知又失败了,而且这次连一次成功的都没有。代码还是从AUTO_WIFI,这是把里面的button1_callback函数略作修改,从而实现btn-abc按钮的乒乓切换,如下所示:
void button1_callback(const String & state)
{
BLINKER_LOG("get button state: ", state);
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
if(digitalRead(LED_BUILTIN))
Button1.print("on");
else Button1.print("off");
}
修改switch触发器为btn-abc ,如下:
添加两个智能化规则:
结果发现,把btn-abc点烂,btn-123也不动作,我知道肯定是我理解的不到位,要不不会一次也不成功,望各位过路的大侠不吝赐教,谢谢了。
支持Blinker 打卡+1:lol 本帖最后由 415412868 于 2020-2-28 19:51 编辑
blinker尽然有智动化功能,主要用于设备间的数据交互和控制,看着好兴奋,于是马上从网上定了两块标号D1的ESP8266实验板,对这个功能做一下尝试,结果实验效果不太理想,现在我把实验过程写出来,希望老大们给予帮助:
代码没什么好说的,就是照抄的blinker lib dev3.0中的AUTO_WIFI例程,就不贴出来了,一式两份,分别下载至两个D1实验板,两个D1中的代码除了Auth参数不同外(手机APP中添加了两个设备),其余全部相同,简便测试,没有添加任何触发器,添加两个设备后的主界面
配置了两个规则
想让一个板子上的led随着另外一个上面的,实现同步,结果发现只能偶尔起作用一次,大部分时间不能实现联动,但是两个分别控制没有问题,串口的调试信息如下:,
主控制板调试信息:
Got: {"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}
fromDevice: senderClient1
parse data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}{"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
defined BLINKER_ARDUINOJSON
autoManager begin: 1 1
get auto setting
_auto trigged action: {"btn-abc":"off"}
checkNum count: 1
strWidgetsParse isParsed
strWidgetsParse: btn-abc
get button state: off
autoFormatData key: btn-abc, json: "btn-abc":{"swi":"ON"}
new.
isParsed
checkNum count: 1
isParsed
print: {"btn-abc":{"swi":"ON"}}
Proto print...
Freeheap: 9960
isJson: {"data":{"btn-abc":{"swi":"ON"}},"fromDevice":"FD468DAEOTS7FOQ8GJ6IEIVV","toDevice":"cd303ce73177ea88daf55d35fb20b4a8","deviceType":"OwnApp"}
MQTT Publish...
Freeheap: 9960
ERROR: MQTT NOT ALIVE OR MSG LIMIT
Freeheap: 10992
Got: {"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}
fromDevice: senderClient1
parse data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}{"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
defined BLINKER_ARDUINOJSON
autoManager begin: 1 1
get auto setting
_auto trigged action: {"btn-abc":"off"}
checkNum count: 1
strWidgetsParse isParsed
strWidgetsParse: btn-abc
get button state: off
autoFormatData key: btn-abc, json: "btn-abc":{"swi":"ON"}
new.
isParsed
checkNum count: 1
isParsed
print: {"btn-abc":{"swi":"ON"}}
Proto print...
Freeheap: 9960
isJson: {"data":{"btn-abc":{"swi":"ON"}},"fromDevice":"FD468DAEOTS7FOQ8GJ6IEIVV","toDevice":"cd303ce73177ea88daf55d35fb20b4a8","deviceType":"OwnApp"}
MQTT Publish...
Freeheap: 9960
ERROR: MQTT NOT ALIVE OR MSG LIMIT
Freeheap: 10992
MQTT Ping!
Freeheap: 10992
被动板调试信息:
Got: {"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}
fromDevice: senderClient1
parse data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}{"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
defined BLINKER_ARDUINOJSON
autoManager begin: 1 1
get auto setting
_auto trigged action: {"btn-abc":"off"}
checkNum count: 1
strWidgetsParse isParsed
strWidgetsParse: btn-abc
get button state: off
autoFormatData key: btn-abc, json: "btn-abc":{"swi":"ON"}
new.
isParsed
checkNum count: 1
isParsed
print: {"btn-abc":{"swi":"ON"}}
Proto print...
Freeheap: 9960
isJson: {"data":{"btn-abc":{"swi":"ON"}},"fromDevice":"FD468DAEOTS7FOQ8GJ6IEIVV","toDevice":"cd303ce73177ea88daf55d35fb20b4a8","deviceType":"OwnApp"}
MQTT Publish...
Freeheap: 9960
ERROR: MQTT NOT ALIVE OR MSG LIMIT
Freeheap: 10992
Got: {"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}
fromDevice: senderClient1
parse data: {"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}}{"deviceType":"DiyArduino","data":{"set":{"auto":{"act":["{\"btn-abc\":\"off\"}"]}}},"fromDevice":"senderClient1","toDevice":"FD468DAEOTS7FOQ8GJ6IEIVV"}
defined BLINKER_ARDUINOJSON
autoManager begin: 1 1
get auto setting
_auto trigged action: {"btn-abc":"off"}
checkNum count: 1
strWidgetsParse isParsed
strWidgetsParse: btn-abc
get button state: off
autoFormatData key: btn-abc, json: "btn-abc":{"swi":"ON"}
new.
isParsed
checkNum count: 1
isParsed
print: {"btn-abc":{"swi":"ON"}}
Proto print...
Freeheap: 9960
isJson: {"data":{"btn-abc":{"swi":"ON"}},"fromDevice":"FD468DAEOTS7FOQ8GJ6IEIVV","toDevice":"cd303ce73177ea88daf55d35fb20b4a8","deviceType":"OwnApp"}
MQTT Publish...
Freeheap: 9960
ERROR: MQTT NOT ALIVE OR MSG LIMIT
Freeheap: 10992
MQTT Ping!
Freeheap: 10992
MQTT Ping!
Freeheap: 10992
MQTT Ping!
Freeheap: 10992
MQTT Ping!
Freeheap: 10992
MQTT Ping!
Freeheap: 10992
我是什么地方操作错了吗?还是怎么回事啊?
为了让老大们看清楚一点,调试信息有点冗长,望见谅。
智动化是否智能支持内置的switch,如果是自行增加的button能够作为触发条件呢?我在开发文档有看到,但是更改autoinput和触发器配置的source后,不可行 能否让APP执行自动发送数据的操作 比如每隔一段时间 自动发送手机某目录下的Text文件里内容,
页:
[1]