官方文档https://www.domoticz.com/wiki/Hardware_Setup#Dummy_Hardware
API及JSON介绍https://www.domoticz.cn/wiki/Domoticz_API%E5%8F%8AJSON%E7%BD%91%E5%9D%80
介绍
Another special hardware type is the Dummy Hardware. As the name implies this hardware does not communicate with the outside world. It’s purpose is to be a placeholder for virtual switches and virtual sensors which can be used as variables in events and scripts. New virtual switches need to be added in the switches tab (Add manual light/switch). New virtual sensors can be created from the hardware overview list.
Dummy是domoticz的一个虚拟传感器功能,在domoticz创建相应硬件及设备以后可以用http中的get方法上传数据。
添加硬件及设备
首先点击右上方 设置 —— 硬件。
在类型中下拉选择 Dummy(Does nothing, use for virtual switches only),填写名称,点击增加按钮
完成以后上方列表中即会出现相应硬件。
这时点击 创建虚拟传感器按钮 ,会弹出下方所示窗口,选择需要的类型,填写名称,点击ok按钮即可。
点击右上方 设置 —— 设备,即可在列表中看到刚才创建的虚拟传感器设备
记住Idx值
上传数据
使用http中的get方法
请求格式:
http://ip:port/json.htm?type=command¶m=udevice&idx=Idx&nvalue=0&svalue=temp
比如上传温度为15摄氏度的数据
http://192.168.1.88:8080/json.htm?type=command¶m=udevice&idx=3&nvalue=0&svalue=15