panasonic_smart_app icon indicating copy to clipboard operation
panasonic_smart_app copied to clipboard

請問是否能支援冷暖氣機 CS-UJ40BA2

Open marceautw opened this issue 9 months ago • 13 comments

CS-UJ40BA2 是今年新推出的系列,昨天裝上 CZ-T007 模組,HA 裡面只出現3個實體,其中2個無法使用,請問是我安裝問題? 還是能考慮新增支援此型號呢?

Image

謝謝!

marceautw avatar Apr 02 '25 01:04 marceautw

方便的話請附上 debug log,這個型號看起來是第一次出現

osk2 avatar Apr 03 '25 15:04 osk2

我有兩台分別為 CS-UJ40BA2 與 CS-LJ28BA2,都是加裝CZ-T007,我發現應該是取不到 CS-UJ40BA2 的 CommandList ??

DEBUG (敏感資訊已加上XXX) 如需要補充請再告知,感謝 :

2025-04-03 15:24:49.246 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Making #8 request to https://ems2.panasonic.com.tw/api/UserGetRegisteredGwList2 with headers {'cptoken': '14xxx99', 'user-agent': 'okhttp/4.9.1'} and data None, proxy: 
2025-04-03 15:24:49.247 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Making #9 request to https://ems2.panasonic.com.tw/api/UserGetInfo with headers {'cptoken': '14xxx99', 'user-agent': 'okhttp/4.9.1'} and data {'name': 'Power', 'from': '2025/04/01', 'unit': 'day', 'max_num': 31}, proxy: 
2025-04-03 15:24:49.249 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Making #10 request to https://ems2.panasonic.com.tw/api/UserGetInfo with headers {'cptoken': '14xxx99', 'user-agent': 'okhttp/4.9.1'} and data {'name': 'CO2', 'from': '2025/04/01', 'unit': 'day', 'max_num': 31}, proxy: 
2025-04-03 15:24:49.249 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Making #11 request to https://ems2.panasonic.com.tw/api/UserGetInfo with headers {'cptoken': '14xxx99', 'user-agent': 'okhttp/4.9.1'} and data {'name': 'Other', 'from': '2025/04/01', 'unit': 'day', 'max_num': 31}, proxy: 
2025-04-03 15:24:51.251 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Making #12 request to https://ems2.panasonic.com.tw/api/DeviceGetInfo with headers {'cptoken': '14xxx99', 'auth': '28xxxFF', 'gwid': '28xxx28', 'user-agent': 'okhttp/4.9.1'} and data [{'CommandTypes': [{'CommandType': '0x00'}, {'CommandType': '0x01'}, {'CommandType': '0x04'}, {'CommandType': '0x03'}, {'CommandType': '0x02'}, {'CommandType': '0x0F'}, {'CommandType': '0x21'}, {'CommandType': '0x0B'}, {'CommandType': '0x0C'}, {'CommandType': '0x08'}, {'CommandType': '0x1B'}, {'CommandType': '0x1E'}, {'CommandType': '0x1A'}, {'CommandType': '0x18'}, {'CommandType': '0x05'}, {'CommandType': '0x17'}, {'CommandType': '0x11'}, {'CommandType': '0x19'}, {'CommandType': '0x1F'}, {'CommandType': '0x37'}], 'DeviceID': 1}], proxy: 
2025-04-03 15:24:53.252 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Making #13 request to https://ems2.panasonic.com.tw/api/DeviceGetInfo with headers {'cptoken': '14xxx99', 'auth': '28xxxFF', 'gwid': '28xxx60', 'user-agent': 'okhttp/4.9.1'} and data [{'CommandTypes': [{'CommandType': '0x00'}, {'CommandType': '0x01'}, {'CommandType': '0x04'}, {'CommandType': '0x03'}, {'CommandType': '0x02'}, {'CommandType': '0x0F'}, {'CommandType': '0x21'}, {'CommandType': '0x0B'}, {'CommandType': '0x0C'}, {'CommandType': '0x08'}, {'CommandType': '0x1B'}, {'CommandType': '0x1E'}, {'CommandType': '0x1A'}, {'CommandType': '0x18'}, {'CommandType': '0x05'}, {'CommandType': '0x17'}, {'CommandType': '0x11'}, {'CommandType': '0x19'}, {'CommandType': '0x1F'}, {'CommandType': '0x37'}], 'DeviceID': 1}], proxy: 
2025-04-03 15:24:49.350 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Succeed to access #8 API. Returned 200: {"State":"success","StateMsg":"","MVersion":"20250403231913","GroupList":[],"AreaList":[{"AreaID":"0","AreaName":"","AreaNo":"0","AreaIcon":"1"}],"GwList":[{"GWID":"28xxx28","ModelID":"CZ-T006","AreaID":"0","SeqNo":"0","Auth":"28xxxFF","NickName":"冷氣機RF","City":"xxx","Area":"xxx","LatLng":"24.xxx,120.xxx","DeviceType":"1","ModelType":"UJ","Model":"CS-UJ40BA2","Function":{"SetSchedule":"1"},"Attribute":{},"Devices":[{"DeviceID":1,"Name":"","IsAvailable":1}]},{"GWID":"28xxx60","ModelID":"CZ-T006","AreaID":"0","SeqNo":"0","Auth":"28xxxFF","NickName":"冷氣機23","City":"xxx","Area":"xxx","LatLng":"24.xxx,120.xxx","DeviceType":"1","ModelType":"LJ","Model":"CS-LJ28BA2","Function":{"SetTask":"0","SetSchedule":"1","SleepTempMode":"0"},"Attribute":{},"Devices":[{"DeviceID":1,"Name":"","IsAvailable":1}]}],"CommandList":[{"ModelType":"LJ","JSON":[{"DeviceType":1,"DeviceName":"冷氣機","ModelType":"LJ","ProtocalType":"SAA","ProtocalVersion":"4","Timestamp":"20210929140000","list":[{"CommandType":"0x00","CommandName":"電源","ParameterType":"enum","ParameterUnit":"","Parameters":[["停止",0],["運轉",1]]},{"CommandType":"0x01","CommandName":"運轉","ParameterType":"enum","ParameterUnit":"","Parameters":[["冷氣",0],["除濕",1],["清淨",2],["自動",3],["暖氣",4]]},{"CommandType":"0x03","CommandName":"溫度設定","ParameterType":"range","ParameterUnit":"度","Parameters":[["Min",16],["Max",30]]},{"CommandType":"0x02","CommandName":"風量","ParameterType":"rangeA","ParameterUnit":"","Parameters":[["Auto",0],["Min",1],["Max",5]]},{"CommandType":"0x0b","CommandName":"時間到開","ParameterType":"range","ParameterUnit":"分鐘","Parameters":[["Min",0],["Max",1440]]},{"CommandType":"0x0c","CommandName":"時間到關","ParameterType":"range","ParameterUnit":"分鐘","Parameters":[["Min",0],["Max",1440]]},{"CommandType":"0x18","CommandName":"自體淨","ParameterType":"enum","ParameterUnit":"","Parameters":[["關閉",0],["開啟",1]]},{"CommandType":"0x05","CommandName":"睡眠","ParameterType":"enum","ParameterUnit":"","Parameters":[["關閉",0],["開啟",1]]},{"CommandType":"0x1e","CommandName":"操作提示音","ParameterType":"enum","ParameterUnit":"","Parameters":[["開啟",0],["關閉",1]]},{"CommandType":"0x0f","CommandName":"上下風向","ParameterType":"rangeA","ParameterUnit":"","Parameters":[["Auto",0],["Min",1],["Max",5]]},{"CommandType":"0x11","CommandName":"左右風向","ParameterType":"rangeA","ParameterUnit":"","Parameters":[["Auto",0],["Min",1],["Max",7]]},{"CommandType":"0x1a","CommandName":"急速","ParameterType":"enum","ParameterUnit":"","Parameters":[["關閉",0],["開啟",1]]},{"CommandType":"0x1f","CommandName":"機體燈光","ParameterType":"enum","ParameterUnit":"","Parameters":[["亮",0],["暗",1],["ECO燈滅",2]]},{"CommandType":"0x1b","CommandName":"ECONAVI","ParameterType":"enum","ParameterUnit":"","Parameters":[["關閉",0],["開啟",1]]},{"CommandType":"0x08","CommandName":"nanoe","ParameterType":"enum","ParameterUnit":"","Parameters":[["關閉",0],["開啟",1]]}]}]}]}
2025-04-03 15:24:49.447 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Succeed to access #9 API. Returned 200: {"Summary":0.1,"kwh":[0.0,0.1,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"AreaList":[{"AreaID":"0","AreaName":"","AreaNo":"0","AreaIcon":"1","Total_kwh":"0.10","percent":"100.00"}],"GwList":[{"GwID":"28xxx28","DeviceType":"1","NickName":"冷氣機RF","AreaID":"0","AreaName":"","AreaNo":"0","SeqNo":"0","Total_kwh":"0.10","kwh":[0.0,0.1,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"percent":"100.00","Attribute":{}},{"GwID":"28xxx60","DeviceType":"1","NickName":"冷氣機23","AreaID":"0","AreaName":"","AreaNo":"0","SeqNo":"0","Total_kwh":"0.00","kwh":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"percent":"0.00","Attribute":{}}]}
2025-04-03 15:24:49.448 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Succeed to access #10 API. Returned 200: {"Summary":0.042,"kg":[0.0,0.042,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"AreaList":[{"AreaID":"0","AreaName":"","AreaNo":"0","AreaIcon":"1","Total_kg":"0.042","percent":"100.00"}],"GwList":[{"GwID":"28xxx28","DeviceType":"1","NickName":"冷氣機RF","AreaID":"0","AreaName":"","AreaNo":"0","SeqNo":"0","Total_kg":"0.042","kg":[0.0,0.042,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"percent":"100.00","Attribute":{}},{"GwID":"28xxx60","DeviceType":"1","NickName":"冷氣機23","AreaID":"0","AreaName":"","AreaNo":"0","SeqNo":"0","Total_kg":"0.000","kg":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"percent":"0.00","Attribute":{}}]}
2025-04-03 15:24:49.409 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Succeed to access #11 API. Returned 200: {"AllRef_OpenDoor":"0","AllWM_WashTime":"0","AllWM_WaterUsed":"0","AreaList":[],"GwList":[]}
2025-04-03 15:24:52.444 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Succeed to access #12 API. Returned 200: {"status":"success","devices":[{"DeviceID":1,"Info":[{"CommandType":"0x11","status":"0"},{"CommandType":"0x17","status":"0"},{"CommandType":"0x18","status":"65535"},{"CommandType":"0x19","status":"65535"},{"CommandType":"0x21","status":"19"},{"CommandType":"0x37","status":"65535"},{"CommandType":"0x00","status":"0"},{"CommandType":"0x01","status":"3"},{"CommandType":"0x04","status":"20"},{"CommandType":"0x03","status":"25"},{"CommandType":"0x02","status":"0"},{"CommandType":"0x0F","status":"0"},{"CommandType":"0x0B","status":"0"},{"CommandType":"0x0C","status":"0"},{"CommandType":"0x08","status":"1"},{"CommandType":"0x1B","status":"0"},{"CommandType":"0x1E","status":"1"},{"CommandType":"0x1A","status":"0"},{"CommandType":"0x05","status":"0"},{"CommandType":"0x1F","status":"0"}]}],"updated_at":"20250403232407"}
2025-04-03 15:24:53.894 DEBUG (MainThread) [custom_components.panasonic_smart_app.smartApp] Succeed to access #13 API. Returned 200: {"status":"success","devices":[{"DeviceID":1,"Info":[{"CommandType":"0x11","status":"0"},{"CommandType":"0x17","status":"0"},{"CommandType":"0x18","status":"0"},{"CommandType":"0x19","status":"65535"},{"CommandType":"0x21","status":"19"},{"CommandType":"0x37","status":"65535"},{"CommandType":"0x00","status":"0"},{"CommandType":"0x01","status":"3"},{"CommandType":"0x04","status":"20"},{"CommandType":"0x03","status":"25"},{"CommandType":"0x02","status":"0"},{"CommandType":"0x0F","status":"0"},{"CommandType":"0x0B","status":"0"},{"CommandType":"0x0C","status":"0"},{"CommandType":"0x08","status":"1"},{"CommandType":"0x1B","status":"0"},{"CommandType":"0x1E","status":"1"},{"CommandType":"0x1A","status":"0"},{"CommandType":"0x05","status":"0"},{"CommandType":"0x1F","status":"0"}]}],"updated_at":"20250403232439"}
2025-04-03 15:24:55.253 DEBUG (MainThread) [custom_components.panasonic_smart_app] Finished fetching Panasonic Smart Application data in 6.018 seconds (success: True)

marceautw avatar Apr 03 '25 15:04 marceautw

看起來是 UserGetRegisteredGwList2 這隻 API 沒有回傳裝置資訊,所以看不到冷氣相關的實體 這蠻詭異的,這個情況會一直發生嗎? 請再附上詳細的 debug log,開啟方式如圖:

Image

osk2 avatar Apr 07 '25 14:04 osk2

的確應該就是 API 無法回傳這型號的資訊導致,這問題一直存在,就算在原廠 APP 刪除重新註冊,UJ 這系列始終 command list 都回傳空白。

查看手機內原廠 1.0.9 版 APP 保留的 log file,他自己裡面呼叫 UserGetRegisteredGwList 這 API 時也是發生:舊型號 LJ 正常,新型號 UJ 空白,看來是原廠支援度不足問題。

如果來源端就沒完整資料,後面的程式應該也難配合,我有反應給 Panasonic ,就看原廠願不願意修改了。

marceautw avatar Apr 11 '25 08:04 marceautw

後來將 LJ 系列的指令套用在新的 UJ 系列,看來是可以運作無誤!

Model: CS-UJ40BA2 / CS-UJ36BA2

Image

marceautw avatar Apr 19 '25 15:04 marceautw

後來將 LJ 系列的指令套用在新的 UJ 系列,看來是可以運作無誤!

Model: CS-UJ40BA2 / CS-UJ36BA2

Image

請問如何套用指令?

GavinkoT avatar Apr 25 '25 02:04 GavinkoT

的確應該就是 API 無法回傳這型號的資訊導致,這問題一直存在,就算在原廠 APP 刪除重新註冊,UJ 這系列始終 command list 都回傳空白。

查看手機內原廠 1.0.9 版 APP 保留的 log file,他自己裡面呼叫 UserGetRegisteredGwList 這 API 時也是發生:舊型號 LJ 正常,新型號 UJ 空白,看來是原廠支援度不足問題。

如果來源端就沒完整資料,後面的程式應該也難配合,我有反應給 Panasonic ,就看原廠願不願意修改了。

若你有成功解決這個問題的話歡迎發 PR 或是可以將裝置分享條碼寄到 [email protected],我有空看一下有沒有辦法在下一版處理這個問題

osk2 avatar Apr 25 '25 13:04 osk2

我是問 chatgpt 他幫我改出一版。但怎麼改都是臨時做法,畢竟新機的新功能也沒辦法增加,除非原廠修改 API。

我是一開始就反應給原廠,原廠說從後台看到我有定期規律的查詢,只問我應用情境,最後也沒給出會不會調整的回覆。

希望更多用戶一起反應,才能push原廠提供新機種支援。

marceautw avatar Apr 29 '25 05:04 marceautw

我稍微看了一下 UJ 應該是取代舊的 LJ 系列,command 共用就不太意外了,這我可以調整一下讓 UJ 對應到 LJ 系列 若 @marceautw 方便的話可以將完整的 debug logging 寄到 [email protected],讓我確認一下是不是我猜測的那樣

osk2 avatar May 02 '25 08:05 osk2

app裡有出現更新,更新完之後實體有增加,但好像仍然只有像室外溫度之類的東西@@

EJHOME2025 avatar Jun 16 '25 01:06 EJHOME2025

目前的狀態還是跟之前一樣,API 沒有回應 UJ 系列的數據,我目前也沒太多能量去實作 UJ -> LJ 的對應 若有人能協助開發歡迎發 PR 👍

osk2 avatar Jun 16 '25 04:06 osk2

請問後來UJ系列有解決方案嗎?

billbohome avatar Jul 20 '25 18:07 billbohome

請問後來UJ系列有解決方案嗎?

之前打算深入研究一下原廠的 app 怎麼處理 UJ 系列,但沒有太多時間可以處理這塊,目前狀態還是跟先前的回覆一樣

osk2 avatar Jul 23 '25 06:07 osk2

已在 v2.13 中支援 UJ 系列,若更新完有發現問題可以再重新打開這個 issue

osk2 avatar Dec 30 '25 14:12 osk2