Unknown device named ###### model WYSMTOD16A
I really like the pyvesync library which would allow me to retrieve info in python from my smart outdoor plugs. The model is GreenSun HSCB-SMT-EU. pyvesync logs properly to the vesync APIbut the model is not recognized. Is there anything I should try to retrieve info from this model ? Alternatively would you be able to recommend a vesync smart plug available in Europe that would work. None of the Etkcity products seem to be available. Thks.
The only thing I can suggest is to capture packets and build into library. I am happy to assist you with the process
All those sockets are treated via this endpoint and payload:
https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
{
"appVersion": "VeSync 4.3.40",
"phoneBrand": "Jeedom-VeSync",
"phoneOS": "Jeedom-VeSync",
"traceId": "1733083741506",
"acceptLanguage": "fr",
"timeZone": "Europe\/Brussels",
"accountID": "XXXX",
"token": "XXXX",
"method": "bypassV2",
"debugMode": true,
"deviceRegion": "EU",
"cid": "XXXX",
"configModule": "ZY_WFBO_OTL_WYSMTOD16A_UN",
"payload": {
"data": [],
"method": "getOutletStatus",
"source": "APP"
}
}
{
"traceId": "1733083743506",
"code": 0,
"msg": "request success",
"module": null,
"stacktrace": null,
"result": {
"traceId": "1733083743506",
"code": 0,
"result": {
"enabled": true,
"voltage": 234.9955291748047,
"energy": 0.00041502082778,
"power": 5.35991096496582,
"current": 0.02284645661711
}
}
}
@Flobul : seems to work at least for JeeDom issue #134553 - how was it implemented there?
Hey. After some digging, I found another way to get all datas from this socket.
method 'getProperty' with payload: "powerSwitch_1","realTimeVoltage","realTimePower","electricalEnergy","protectionStatus","voltageUpperThreshold","currentUpperThreshold","scheduleNum","powerSave","powerProtection","powerUpperThreshold","inchings","aways"
@Flobul : what are the methods for
- get energy (weekly, monthly and yearly)
- switch the plug on / off Thank you for sharing the logs.
At least "get_details()" is working BIG_GRIN
getOutletStatus is not used for this socket on the app to maintain status. Got lucky it worked here, but values are slightly different from this other way => But getProperty is. This is the status method sent continually by the app:
{
"appVersion": "VeSync 5.1.60 build7",
"phoneBrand": "iPad Air",
"phoneOS": "iOS12.5.4",
"traceId": "1733433302338",
"acceptLanguage": "fr",
"timeZone": "Europe\/Brussels",
"accountID": "XXXXXX",
"token": "XXXXXXXXXXXXXX",
"method": "bypassV2",
"debugMode": true,
"cid": "XXXXXXXXXXXX",
"configModule": "ZY_WFBO_OTL_WYSMTOD16A_UN",
"configModel": "ZY_WFBO_OTL_WYSMTOD16A_UN",
"payload": {
"data": {
"properties": ["powerSwitch_1", "realTimeVoltage", "realTimePower", "electricalEnergy", "protectionStatus", "voltageUpperThreshold", "currentUpperThreshold", "scheduleNum"]
},
"method": "getProperty",
"source": "APP"
},
"userCountryCode": "FR"
}
get_property is working:
realTimeVoltage = 236.9227294921875
realTimePower = 37.89560317993164
electricalEnergy = 0.20144282673142
protectionStatus = normal
voltageUpperThreshold = 265
currentUpperThreshold = 17
scheduleNum = 26
powerSave = {'enable': 0, 'triggerUpperThreshold': 0}
powerProtection = {'enable': 0, 'triggerType': 'overUpper', 'upperThreshold': 0}
powerUpperThreshold = 4080
inchings = []
aways = []
@Flobul : but setProperty is not working for 'powerSwitch_1' to switch plug on / off?!?
Is there a how-to for capturing traffic of vesync app? Didn't succeed until yet. MacOS, iPhone, WireShark available frida approach wasn't successful yet with emulated "Pixel3A XL"
@Flobul : but setProperty is not working for 'powerSwitch_1' to switch plug on / off?!?
Works with setSwitch with payload : 'enabled'
Is there a how-to for capturing traffic of vesync app? Didn't succeed until yet. MacOS, iPhone, WireShark available frida approach wasn't successful yet with emulated "Pixel3A XL"
iPad jailbreaked, ssl-kill-switch3 installed, mitmproxy on my Mac. Up and running.
something is wrong with:
body['payload'] = {
'method': 'setSwitch',
'source': 'APP',
'data': {'enabled': 1},
}
something is wrong with:
body['payload'] = { 'method': 'setSwitch', 'source': 'APP', 'data': {'enabled': 1}, }
Add {'id': 0, 'enabled': true}
@Flobul : Thank you! Now I can get Details and toggle switch see fork Screenshot will follow.
how can I update a single file or install the repo to HomeAssistant?
@Flobul : one thing is not working - get energy by period
body['payload'] = {
'method': 'getEnergyHistory',
'source': 'APP',
'data': {
'fromDay': int(from_day.timestamp()),
'toDay' : int(till_day.timestamp()),
}
}
returns code = -1
@Flobul : one thing is not working - get energy by period
body['payload'] = { 'method': 'getEnergyHistory', 'source': 'APP', 'data': { 'fromDay': int(from_day.timestamp()), 'toDay' : int(till_day.timestamp()), } }returns
code = -1
Yeah, it doesn't work on every devices.
how can I update a single file or install the repo to HomeAssistant?
I don't use this or homeassistant. 🤗
Well, than I‘m done. Will prepare the pull request, so @cdnninja can update the HA part.
I created my own custom integration for testing.
current status for a device that is online (!):
Something is missing in integration :(
I created my own custom integration for testing. current status for a device that is online (!):
Something is missing in integration :(
Can't help you with HA. Works fine on Jeedom.
finally I got it working 🥳
will clean up my code and prepare pull requests…
Awesome, looking forward to seeing the PR.
@cdnninja : will send you my updated integration files ( supported devices are now more generic) - test pending. have a look at my vesync_integration
We are working to try move the HA integration to be more generic. Assuming the changes for this device follow that trend it should be easy to get it working.
@cdnninja: Tests are passed and seems to work with pyvesync 2.1.17 package (RP created). please update my changes I made to vesync integration.
This is now included in v3.0. Please check the readme, this was a complete rewrite with many breaking changes so existing code will not work.
There seems to be two separate API calls for the outlet status. For anyone which getOutletStatus works, can you please tell me your deviceType and configModule?
This is now supported. Please open a new issue if there are any bugs