dkerr64 / homebridge-yolink

Apache License 2.0
12 stars 2 forks source link

Add support for YoLink -EC devices #84

Closed r1chards closed 11 months ago

r1chards commented 11 months ago

Describe Your Problem:

Hello, I'm trying get the motion sensor working, it shows in Apple Home (HomeKit) app but it's not push any updates when triggered by movement or triggering a light to come via an automation. Homebrige logs highlight "Device offline or other error for Garden Motion Sensor". On the YoLink App the sensor is working correctly and push alerts to my phone.

Can you offer any guidance please

Thank you.

Richard

Logs:

[11/21/2023, 11:17:20 PM] [Homebridge UI] Homebridge log truncated by RDS-HomeBridge.
[11/21/2023, 11:17:21 PM] [Homebridge UI] Homebridge restart request received
[11/21/2023, 11:17:21 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[11/21/2023, 11:17:21 PM] [Homebridge UI] Sending SIGTERM to Homebridge
[11/21/2023, 11:17:21 PM] Got SIGTERM, shutting down Homebridge...
[11/21/2023, 11:17:21 PM] Got SIGTERM, shutting down child bridge process...
[11/21/2023, 11:17:26 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[11/21/2023, 11:17:31 PM] [HB Supervisor] Restarting Homebridge...
[11/21/2023, 11:17:31 PM] [HB Supervisor] Starting Homebridge with extra flags: -I
[11/21/2023, 11:17:31 PM] [HB Supervisor] Started Homebridge v1.7.0 with PID: 1197
[11/21/2023, 11:17:31 PM] Loaded config.json with 0 accessories and 2 platforms.
[11/21/2023, 11:17:31 PM] Loaded 0 cached accessories from cachedAccessories.
[11/21/2023, 11:17:31 PM] ---
[11/21/2023, 11:17:32 PM] Loaded plugin: homebridge-config-ui-x@4.52.3
[11/21/2023, 11:17:32 PM] Registering platform 'homebridge-config-ui-x.config'
[11/21/2023, 11:17:32 PM] ---
[11/21/2023, 11:17:32 PM] Loaded plugin: homebridge-yolink@1.4.0
[11/21/2023, 11:17:32 PM] Registering platform 'homebridge-yolink.YoLink'
[11/21/2023, 11:17:32 PM] ---
[11/21/2023, 11:17:32 PM] Loading 2 platforms...
[11/21/2023, 11:17:32 PM] [YoLink] Initializing YoLink platform...
[11/21/2023, 11:17:32 PM] [YoLink] Initializing child bridge 0E:C5:86:2B:C6:BB
Setup Payload:
X-HM://00241FSYRMKDU
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

[11/21/2023, 11:17:32 PM] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge 9CCD) is running on port 51924.
[11/21/2023, 11:17:32 PM] [YoLink] Launched child bridge with PID 1209
[11/21/2023, 11:17:32 PM] Registering platform 'homebridge-yolink.YoLink'
[11/21/2023, 11:17:32 PM] [YoLink] Loaded homebridge-yolink v1.4.0 child bridge successfully
[11/21/2023, 11:17:32 PM] Loaded 2 cached accessories from cachedAccessories.0EC5862BC6BB.
[11/21/2023, 11:17:32 PM] [YoLink] YoLink plugin for HomeBridge version 1.4.0 (c) 2022 David A. Kerr
Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues

[11/21/2023, 11:17:32 PM] [YoLink] [verbose] Loaded configuration:
{
  "name": "YoLink",
  "platform": "YoLink",
  "tokenURL": "https://api.yosmart.com/open/yolink/token",
  "apiURL": "https://api.yosmart.com/open/yolink/v2/api",
  "mqttPort": 8003,
  "userAccessId": "xxxxx",
  "secretKey": "xxxx",
  "refreshAfter": 14500,
  "verboseLog": true,
  "liteLog": true,
  "allDevices": true,
  "excludeTypes": [
    "Hub",
    "SpeakerHub"
  ],
  "enableExperimental": false,
  "devices": {},
  "includeTypes": [],
  "deviceTemperatures": false,
  "powerFailureSensorAs": "Outlet",
  "version": "1.4.0",
  "garageDoors": [],
  "checkNewDeviceInterval": 0
}
[11/21/2023, 11:17:32 PM] [YoLink] [verbose] YoLinkAPI.constructor
[11/21/2023, 11:17:32 PM] [YoLink] [verbose] Loading accessory from cache:Garage Motion Sensor
[11/21/2023, 11:17:32 PM] [YoLink] [verbose] Loading accessory from cache:Garden Motion Sensor
[11/21/2023, 11:17:32 PM] [YoLink] Login to YoLink API with credentials from config
[11/21/2023, 11:17:32 PM] [YoLink] [verbose] SENDING:
grant_type=client_credentials&client_id=xxxxxxxxxxA&client_secret=xxxxxxxx
[11/21/2023, 11:17:32 PM] Homebridge v1.7.0 (HAP v0.11.1) (YoLink) is running on port 32248.
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] RECEIVED:
{"access_token":"xxxxxxx","token_type":"bearer","expires_in":7200,"refresh_token":"xxxxxxx","scope":["create"]}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] SENDING:
{"time":1700608653479,"method":"Home.getGeneralInfo"}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] RECEIVED:
{"code":"000000","time":1700608653597,"msgid":1700608653597,"method":"Home.getGeneralInfo","desc":"Success","data":{"id":"xxxxxxx"}}
[11/21/2023, 11:17:33 PM] [YoLink] Starting interval timer to refresh accessToken every 6480 seconds
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] YoLinkAPI.getDeviceList
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] YoLinkAPI.getAccessToken
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] SENDING:
{"time":1700608653674,"method":"Home.getDeviceList"}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] RECEIVED:
{"code":"000000","time":1700608653807,"msgid":1700608653807,"method":"Home.getDeviceList","desc":"Success","data":{"devices":[{"deviceId":"xxxxxxxxxxx9d","deviceUDID":"xxxxxxxxxxxea05","name":"Garage Motion Sensor","token":"xxxxxxxxxxx707A","type":"MotionSensor","parentDeviceId":null,"modelName":"YS7805-EC"},{"deviceId":"xxxxxxxxxxx040","deviceUDID":"xxxxxxxxxxx0edf","name":"Garden Motion Sensor","token":"xxxxxxxxxxxBF03","type":"MotionSensor","parentDeviceId":null,"modelName":"YS7805-EC"},{"deviceId":"xxxxxxxxxxx69f","deviceUDID":"xxxxxxxxxxx4d5","name":"YoLink Hub","token":"xxxxxxxxxxx083F","type":"SpeakerHub","parentDeviceId":null,"modelName":"YS1604-EC"}]}}
[11/21/2023, 11:17:33 PM] [YoLink] YoLinkAPI.getDeviceList found 3 devices [lite]
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] {
  "deviceId": "xxxxxxxxxxx9d",
  "deviceUDID": "xxxxxxxxxxxea05",
  "name": "Garage Motion Sensor",
  "token": "xxxxxxxxxxx707A",
  "type": "MotionSensor",
  "parentDeviceId": null,
  "modelName": "YS7805-EC"
}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] Restoring accessory from cache: Garage Motion Sensor (xxxxxxxxxxx9d)
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] Data refresh timer for Garage Motion Sensor (xxxxxxxxxxx9d) fired
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] {
  "deviceId": "xxxxxxxxxxx040",
  "deviceUDID": "xxxxxxxxxxx0edf",
  "name": "Garden Motion Sensor",
  "token": "xxxxxxxxxxxBF03",
  "type": "MotionSensor",
  "parentDeviceId": null,
  "modelName": "YS7805-EC"
}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] Restoring accessory from cache: Garden Motion Sensor (xxxxxxxxxxx040)
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] Data refresh timer for Garden Motion Sensor (xxxxxxxxxxx040) fired
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] {
  "deviceId": "xxxxxxxxxxx69f",
  "deviceUDID": "xxxxxxxxxxx4d5",
  "name": "YoLink Hub",
  "token": "xxxxxxxxxxx083F",
  "type": "SpeakerHub",
  "parentDeviceId": null,
  "modelName": "YS1604-EC"
}
[11/21/2023, 11:17:33 PM] [YoLink] Not registering device YoLink Hub (xxxxxxxxxxx69f) as config 'hide=true'
[11/21/2023, 11:17:33 PM] [YoLink] Create MQTT client to connect to YoLink message service
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] MQTT options: {"clean":true,"username":"xxxxxxxxx","reconnectPeriod":2000}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:17:33 PM] [YoLink] YoLinkAPI.getDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) [lite]
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:17:33 PM] [YoLink] YoLinkAPI.getDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) [lite]
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] YoLinkAPI.getAccessToken
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] SENDING:
{"time":1700608653898,"method":"MotionSensor.getState","targetDevice":"xxxxxxxxxxx9d","token":"xxxxxxxxxxx707A"}
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] YoLinkAPI.getAccessToken
[11/21/2023, 11:17:33 PM] [YoLink] [verbose] SENDING:
{"time":1700608653898,"method":"MotionSensor.getState","targetDevice":"xxxxxxxxxxx040","token":"xxxxxxxxxxxBF03"}
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] RECEIVED:
{"code":"000000","time":1700608654026,"msgid":1700608654026,"method":"MotionSensor.getState","desc":"Success","data":{}}
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] Battery level for Garage Motion Sensor (xxxxxxxxxxx9d) is: 100%
[11/21/2023, 11:17:34 PM] [YoLink] Device offline or other error for Garage Motion Sensor (xxxxxxxxxxx9d)
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] Set data refresh timer for Garage Motion Sensor (xxxxxxxxxxx9d) to run in 14499 seconds
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] MQTT connect: subscribe to messages for 'yl-home/36cc7a54fc05441895566e2e3e927980/+/report'
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] RECEIVED:
{"code":"000000","time":1700608654348,"msgid":1700608654348,"method":"MotionSensor.getState","desc":"Success","data":{}}
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] Battery level for Garden Motion Sensor (xxxxxxxxxxx040) is: 100%
[11/21/2023, 11:17:34 PM] [YoLink] [verbose] Set data refresh timer for Garden Motion Sensor (xxxxxxxxxxx040) to run in 14499 seconds
[11/21/2023, 11:17:34 PM] [YoLink] Device offline or other error for Garden Motion Sensor (xxxxxxxxxxx040)
[11/21/2023, 11:17:34 PM] [YoLink] MQTT subscribed: yl-home/36cc7a54fc05441895566e2e3e927980/+/report
[11/21/2023, 11:22:33 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:22:33 PM] [YoLink] Device offline or other error for Garden Motion Sensor (xxxxxxxxxxx040)
[11/21/2023, 11:22:34 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:22:34 PM] [YoLink] [verbose] Battery level for Garden Motion Sensor (xxxxxxxxxxx040) is: 100%
[11/21/2023, 11:22:34 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:22:34 PM] [YoLink] Device offline or other error for Garage Motion Sensor (xxxxxxxxxxx9d)
[11/21/2023, 11:22:34 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:22:34 PM] [YoLink] Device offline or other error for Garden Motion Sensor (xxxxxxxxxxx040)
[11/21/2023, 11:23:01 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:23:01 PM] [YoLink] [verbose] Battery level for Garage Motion Sensor (xxxxxxxxxxx9d) is: 100%
[11/21/2023, 11:24:31 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:24:31 PM] [YoLink] [verbose] Battery level for Garage Motion Sensor (xxxxxxxxxxx9d) is: 100%
[11/21/2023, 11:24:31 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:24:31 PM] [YoLink] Device offline or other error for Garage Motion Sensor (xxxxxxxxxxx9d)
[11/21/2023, 11:24:31 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:24:31 PM] [YoLink] [verbose] Battery level for Garden Motion Sensor (xxxxxxxxxxx040) is: 100%
[11/21/2023, 11:24:31 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:24:31 PM] [YoLink] Device offline or other error for Garden Motion Sensor (xxxxxxxxxxx040)
[11/21/2023, 11:25:22 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:25:22 PM] [YoLink] [verbose] Battery level for Garage Motion Sensor (xxxxxxxxxxx9d) is: 100%
[11/21/2023, 11:25:22 PM] [YoLink] [verbose] checkDeviceState for Garage Motion Sensor (xxxxxxxxxxx9d) (refresh after 14500 seconds)
[11/21/2023, 11:25:22 PM] [YoLink] Device offline or other error for Garage Motion Sensor (xxxxxxxxxxx9d)
[11/21/2023, 11:25:22 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:25:22 PM] [YoLink] [verbose] Battery level for Garden Motion Sensor (xxxxxxxxxxx040) is: 100%
[11/21/2023, 11:25:22 PM] [YoLink] [verbose] checkDeviceState for Garden Motion Sensor (xxxxxxxxxxx040) (refresh after 14500 seconds)
[11/21/2023, 11:25:22 PM] [YoLink] Device offline or other error for Garden Motion Sensor (xxxxxxxxxxx040)

Plugin Config:

{
    "name": "YoLink",
    "platform": "YoLink",
    "tokenURL": "https://api.yosmart.com/open/yolink/token",
    "apiURL": "https://api.yosmart.com/open/yolink/v2/api",
    "mqttPort": 8003,
    "userAccessId": "xxxxxxxx",
    "secretKey": "xxxxxx",
    "refreshAfter": 14500,
    "verboseLog": true,
    "liteLog": true,
    "allDevices": true,
    "excludeTypes": [
        "Hub",
        "SpeakerHub"
    ],
    "enableExperimental": false,
    "_bridge": {
        "username": "0E:C5:86:2B:C6:BB",
        "port": 32248
    }
}

Screenshots:

Environment:

dkerr64 commented 11 months ago

This is a strange one....

[11/21/2023, 11:17:34 PM] [YoLink] [verbose] RECEIVED:
{"code":"000000","time":1700608654026,"msgid":1700608654026,"method":"MotionSensor.getState","desc":"Success","data":{}}

We are receiving a successful response, but I have never seen one where the data field is empty,{} My message that device is offline is based on value in the data, so if it is empty I assume it is offline. However it is clearly not offline as we are receiving a valid response. So I can "fix" my code logic to not print that warning.

But... Of more interest is whether any MQTT messages are received on motion. For my device I receive...

[11/21/2023, 7:59:29 PM] [YoLink] [verbose] MQTT message: yl-home/d3d51dfc169c4f7aa02b1bf5901a92db/abcdef0123456789/report
{"event":"MotionSensor.Alert","time":1700614768972,"msgid":"1700614768971","data":{"state":"alert","battery":4,"version":"050e","ledAlarm":false,"alertInterval":1,"nomotionDelay":1,"sensitivity":2,"loraInfo":{"netId":"010205","signal":-83,"gatewayId":"abcdef0123456789","gateways":1},"stateChangedAt":1700614768971},"deviceId":"abcdef0123456789"}

whenever there is motion. Are you seeing that whenever you trigger motion?

Thanks

r1chards commented 11 months ago

Absolutely, no change in the logs when then motion is detected, just an nofication from the iOS app.

Are there any setting on the app for the motion sensor or the speaker hub that needed to enabled to push the alerts into the api?

thanks

Richard IMG_2557 IMG_2558

r1chards commented 11 months ago

Hi ya I’ve just re-read the install instructions and it does mention… “The plugin registers as a MQTT client and subscribes to reports published by YoLink for real time alerts and status updates.”

Do I have to install something to register as a MQTT client?

Update: I’ve installed homebridge-mqtt and Mosquitto broker for macOS and it seems to be running, listening to port: 1883

Log says: [mqtt] connected (url = mqtt://127.0.0.1)

But still no updates in the logs when motion is detected.

thanks

Richard

dkerr64 commented 11 months ago

You don't need to do anything for MQTT, the plugin registers automatically and that part is working, your log reports...

[11/21/2023, 11:17:34 PM] [YoLink] [verbose] MQTT connect: subscribe to messages for 'yl-home/36cc7a54fc05441895566e2e3e927980/+/report'
[11/21/2023, 11:17:34 PM] [YoLink] MQTT subscribed: yl-home/36cc7a54fc05441895566e2e3e927980/+/report

With that, and your log level, we should see receipt of MQTT messages whenever motion is triggered. But it seems like nothing is being received.

I'm still thinking if I should tolerate empty data field on responses to getState. It is very unusual.

r1chards commented 11 months ago

Not sure if this will help, the setup mentioned above is directly with MacOS. I've also created today a version within my UTM app, Linux, Debian within Docker. This is up and working and says: "This plugin threw an error from the characteristic 'Motion Detected': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'state'). See https://homebridge.io/w/JtMGR for more info."

[11/23/2023, 1:42:36 PM] [YoLink] Login to YoLink API with credentials from config
[11/23/2023, 1:42:37 PM] Homebridge v1.7.0 (HAP v0.11.1) (YoLink) is running on port 57792.
[11/23/2023, 1:42:38 PM] [YoLink] Starting interval timer to refresh accessToken every 6480 seconds
[11/23/2023, 1:42:39 PM] [YoLink] Not registering device YoLink Hub (d88b4c160400a69f) as config 'hide=true'
[11/23/2023, 1:42:39 PM] [YoLink] Create MQTT client to connect to YoLink message service
[11/23/2023, 1:42:39 PM] [YoLink] MQTT subscribed: yl-home/36cc7a54fc05441895566e2e3e927980/+/report
[11/23/2023, 1:42:39 PM] [YoLink] Device offline or other error for Garden Motion Sensor (d88b4c010004f040)
[11/23/2023, 1:42:39 PM] [YoLink] Device offline or other error for Garage Motion Sensor (d88b4c010004f09d)
[11/23/2023, 1:43:28 PM] [homebridge-yolink] This plugin threw an error from the characteristic 'Motion Detected': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'state'). See https://homebridge.io/w/JtMGR for more info.
[11/23/2023, 1:43:28 PM] [homebridge-yolink] This plugin threw an error from the characteristic 'Motion Detected': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'state'). See https://homebridge.io/w/JtMGR for more info.
[11/23/2023, 1:43:28 PM] [YoLink] Device offline or other error for Garage Motion Sensor (d88b4c010004f09d)
[11/23/2023, 1:43:28 PM] [YoLink] Device offline or other error for Garden Motion Sensor (d88b4c010004f040)
[11/23/2023, 1:43:34 PM] [homebridge-yolink] This plugin threw an error from the characteristic 'Motion Detected': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'state'). See https://homebridge.io/w/JtMGR for more info.
[11/23/2023, 1:43:34 PM] [homebridge-yolink] This plugin threw an error from the characteristic 'Motion Detected': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'state'). See https://homebridge.io/w/JtMGR for more info.
[11/23/2023, 1:43:34 PM] [YoLink] Device offline or other error for Garden Motion Sensor (d88b4c010004f040)
[11/23/2023, 1:43:34 PM] [YoLink] Device offline or other error for Garage Motion Sensor (d88b4c010004f09d)
dkerr64 commented 11 months ago

The errors are all related, that no data is coming back from the device is causing the cannot read properties of undefined error. I can suppress that error by checking if the variable is defined first, but that doesn't solve the problem. We need to get to the root cause.

The only thing I am noticing as different is that your motion detector is reporting modelName as YS7805-EC. When I look at my own logs, my motion detector is reporting that it is a YS7805-UC. But the only difference is the frequency they operate on (some countries may use different frequencies).

I will ask YoLink team on Discord and see if they have any ideas.

dkerr64 commented 11 months ago

One other thought... What firmware does your motion detector have? Mine is at 050E. If the mobile app states that an update is available you could try updating.

matrixd2 commented 11 months ago

@dkerr64 Model Name ends with EC not support for UAC and MQTT now, we are working on it

r1chards commented 11 months ago

One other thought... What firmware does your motion detector have? Mine is at 050E. If the mobile app states that an update is available you could try updating.

Mine says it's the latest Firmware at 50A.

Again many thanks for looking into this.

dkerr64 commented 11 months ago

@r1chards given the response from @matrixd2, your device is not going to work with this plugin until YoLink add support to their API for all devices that model name ends in -EC.

Nothing I can do, sorry.

r1chards commented 11 months ago

OK thanks for trying.

Richard

r1chards commented 11 months ago

This can be closed now, maybe just a note in the read documents that EC devices are not currently supported by their API.

Thanks Richard

dkerr64 commented 11 months ago

Yes, I have updated the README to note that -EC devices are currently not supported.

matrixd2 commented 11 months ago

Yes, I have updated the README to note that -EC devices are currently not supported.

api.yosmart.com for UC devices api-eu.yosmart.com for EC devices

dkerr64 commented 11 months ago

@matrixd2 so, if I point my requests at the 2nd URL then -EC devices will work?

Which leads to question... would you expect any environment with a mix of -UC and -EC devices (so I would have to handle connections to both at the same time), or could I assume that a user would have all of one or the other (so I only need to connect to the one service, and can configure which at initialization) ?

Thanks

dkerr64 commented 11 months ago

@matrixd2 also, are -EC devices only sold in select regions/countries, like Europe? I'm just trying to think through how to document this in a manner a user would understand. Thanks.

matrixd2 commented 11 months ago

@matrixd2 also, are -EC devices only sold in select regions/countries, like Europe? I'm just trying to think through how to document this in a manner a user would understand. Thanks.

Yes, different countries/regions have different restrictions on radio communication.

dkerr64 commented 11 months ago

@r1chards can you please try the URL suggested by @matrixd2. You can do this by updating your config so that....

  "tokenURL": "https://api-eu.yosmart.com/open/yolink/token",
  "apiURL": "https://api-eu.yosmart.com/open/yolink/v2/api",

You can do this in the plugin settings user interface or the config editor... save and then restart the plugin bridge.

I tested this myself and get the same symptoms that you see when using the other URL... the data field returns empty. That is because I have -UC devices.

So long as a user has all -EC or all -UC devices then the plugin support already exists... but I need to update the instructions in README.md to document the different servers.

Thank you.

dkerr64 commented 11 months ago

Closing as this is believed to be working once user updates the API URL.