localtuya
localtuya copied to clipboard
Adding support for Talo Pet Feeder
I have been able to add the 101 ID as a switch (not ideal, need to turn it off and on to dispense 1 portion each time).
From the tuya iot platform I got these IDs, weirdly the 111 voiceswitch is not in the query properties list. The beep mute switch is in the Tuya app but never actually worked, this is probably the reason for it. Added translations for each ID.
{
"abilityId": 101,
"accessMode": "rw",
"code": "timer_feed",
"description": "定时出粮", ;;;Deliver food regularly
"extensions": {
"trigger": "direct"
},
"name": "定时出粮", ;;;Deliver food regularly
"typeSpec": {
"type": "value",
"max": 12,
"min": 0,
"scale": 0,
"step": 1,
"unit": "份" ;;;Share
}
},
{
"abilityId": 102,
"accessMode": "ro",
"code": "fault",
"description": "1=宠粮不足、2=宠粮用尽、4=宠粮堵塞", ;1=Insufficient pet food, 2=Exhausted pet food, 4=Clogged pet food
"extensions": {
"scope": "fault"
},
"name": "粮桶状态", ;;;Grain barrel status
"typeSpec": {
"type": "bitmap",
"label": [
"1",
"2",
"3"
],
"maxlen": 3
}
},
{
"abilityId": 103,
"accessMode": "rw", ;;;Used to control the manual grain discharging switch button on the equipment. If you turn on this switch, you can dispense grain through the grain discharging button of the equipment. If you turn off this function, the grain discharging button on the equipment will not take effect.
"code": "feeding",
"description": "用来控制设备上的手动出粮开关按键,打开此开关,则可以通过设备的出粮按键出粮,若关闭此功能,则设备上的出粮按键不会生效",
"name": "手动出粮",
"typeSpec": {
"type": "bool"
}
},
{
"abilityId": 104,
"accessMode": "rw",
"code": "express_feed",
"description": "立即出粮按钮功能", ;;Immediate grain delivery button function
"extensions": {
"trigger": "direct"
},
"name": "快速出粮", ;;;Fast food delivery
"typeSpec": {
"type": "value",
"max": 12,
"min": 0,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 105,
"accessMode": "rw",
"code": "Manual_amount",
"description": "",
"name": "出粮份数", ;;;;;;Number of grain portions
"typeSpec": {
"type": "value",
"max": 12,
"min": 1,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 106,
"accessMode": "ro", ;;;When the button is pressed to manually disburse grain, the grain discharging result will be reported after the grain dispensing is completed.
"code": "manual_feed",
"description": "当按键手动出粮的时候,出粮完成上报出粮结果",
"extensions": {
"trigger": "direct"
},
"name": "手动出粮", ;;;Manual grain dispensing
"typeSpec": {
"type": "value",
"max": 12,
"min": 0,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 107,
"accessMode": "ro",
"code": "express_result",
"description": "快速出粮的结果", ;;;;Fast food results
"extensions": {
"trigger": "direct"
},
"name": "快速出粮", ;;;;Fast food delivery
"typeSpec": {
"type": "value",
"max": 12,
"min": 0,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 108,
"accessMode": "ro",
"code": "timer_result",
"description": "定时出粮结果", ;;;Regular grain results
"extensions": {
"trigger": "direct"
},
"name": "定时出粮", ;;;Deliver food regularly
"typeSpec": {
"type": "value",
"max": 12,
"min": 0,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 109,
"accessMode": "ro", ;;;After the device completes execution, it reports historical data. When reporting historical data, the value is composed of 4 bytes. The highest byte represents the error code (1: No food, 2: Insufficient food, 3: Food is blocked); the next highest byte is 100. The bit indicates the type of grain delivery (2: Alex 1: Manual 0: Automatic); the third byte indicates the actual number of grain delivery portions; the last byte indicates the reporting ID, which is increased by 1 after each report.
"code": "history_data",
"description": "设备执行完成后上报历史数据,上报历史数据时,value由4个字节拼接而成,最高位字节表示错误码(1:无粮 2:食物不足 3:粮食堵塞);次高位字节百位表示出粮类型(2:Alex 1:手动 0:自动);第三字节表示实际出粮份数;最后一字节表示上报ID,每次上报后加1。nresult = ((uint32)devState.errType<<24|(uint32)foodCount<<16|(uint32)rebackCount<<8|(uint32)sendID);n",
"name": "上报历史数据", ;;;;Report historical data
"typeSpec": {
"type": "value",
"max": 2147483646,
"min": 0,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 110,
"accessMode": "rw", ;;;Control the number of grains produced by the button. The hundred's digit indicates enable, and the last two digits indicate the number of grains to be distributed (110 indicates that grain distribution is allowed, and 10 grains will be produced by pressing the button)
"code": "weight",
"description": "控制按钮的出粮份数。百位表示enable,后面两位表示出粮份数(110表示允许出粮,按键出粮10份)",
"name": "Manual feeding",
"typeSpec": {
"type": "value",
"max": 255,
"min": 1,
"scale": 0,
"step": 1,
"unit": ""
}
},
{
"abilityId": 111,
"accessMode": "rw",
"code": "VoiceSwitch",
"description": "出粮音开关", ;;;Grain dispensing sound switch
"name": "声音开关", ;;;;sound switch
"typeSpec": {
"type": "bool"
}
}
]```
I'm basically trying to just be able to dispense food / portions and perhaps turn off the beep (voiceswitch).
If anyone can help me figure it out further would be great.