Closed BillyFKidney closed 4 months ago
Currently, the S10 and K10 are not supported by the Switchbot API, making it difficult to properly accommodate them. I'm tracking this issue.
However, looking at the device support status in homebridge-switchbot, there is a possibility that they share the same command structure as the S1.
Referring to #10, setting EnforceDeviceTypes may allow the S10 to be recognized as an S1:
EnforceDeviceTypes:
- DeviceId: <S10 DeviceId>
DeviceType: Robot Vacuum Cleaner S1
In this state, could you please verify if various commands and webhooks operate correctly?
I was able to get the DeviceID but unfortunately nothing appears to be working otherwise.
09:10:56 warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {KEYKEYKEYKEYKEY} may be persisted to storage in unencrypted form.
09:10:56 info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8098
09:10:56 info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8099
09:10:56 dbug: SwitchBotMqttApp.Services.AutomatedHostedService[0] Application has started - will start services
09:10:56 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down.
09:10:56 info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production
09:10:56 info: Microsoft.Hosting.Lifetime[0] Content root path: /app/
09:10:56 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 3,0
09:10:57 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/IDIDIDIDIDIDIID/status
09:10:57 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/IDIDIDIDIDIDIID/status,{"statusCode":100,"body":{},"message":"success"}
09:10:57 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,scenes
09:10:57 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/scenes,{"statusCode":100,"body":[],"message":"success"}
09:10:57 info: SwitchBotMqttApp.Services.MqttCoreService[0] started
09:10:57 info: SwitchBotMqttApp.Services.PollingService[0] started
09:11:01 info: FluffySpoon.Ngrok.NgrokProcess[0] Starting Ngrok process
09:11:01 info: FluffySpoon.Ngrok.NgrokApiClient[0] Creating tunnel SwitchBotMqttApp
09:11:01 info: FluffySpoon.Ngrok.NgrokApiClient[0] Creating tunnel SwitchBotMqttApp
09:11:01 info: FluffySpoon.Ngrok.NgrokApiClient[0] Tunnel FluffySpoon.Ngrok.Models.TunnelResponse created
09:11:01 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/queryWebhook
09:11:01 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/queryWebhook,{"statusCode":190,"body":{},"message":""}
09:11:01 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/setupWebhook
09:11:01 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/setupWebhook,{"statusCode":100,"body":{},"message":"success"}
09:11:01 info: SwitchBotMqttApp.Services.WebhookService[0] start listen https://IPIPIPIPIPIP.ngrok-free.app/webhook
09:11:24 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/IDIDIDIDIDIDIID/status
09:11:24 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/IDIDIDIDIDIDIID/status,{"statusCode":100,"body":{},"message":"success"}
09:11:53 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 3,0
09:12:07 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 3,0
09:12:16 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,devices/IDIDIDIDIDIDIID/commands
09:12:16 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/devices/IDIDIDIDIDIDIID/commands,{"statusCode":190,"body":{},"message":"not support device type"}
I attempted to poll the device status first, but it did not update anything.
From inspecting the response body, it appears that the API itself indeed does not seem to support S10, as you observed. I will make efforts to update as soon as support for the API is added.
@BillyFKidney Since the API specifications for the S10 have been released, I have added support for the S10 in add-on version 1.0.12, which was just released. As I don't own the actual device, the testing was only done theoretically.I would appreciate your feedback after trying it out. If you have previously specified EnforceDeviceTypes, please remove that specification.
I removed the force entry and updated.
The unit appears but controls are…light. Is that to be expected?
@BillyFKidney Since the device type is displayed as S1, it seems that previously detected devices may not have been overwritten correctly. Please try deleting the S1 device (and any dedicated devices that can operate PowLevel) defined by the MQTT integration's auto-discovery, then restart the add-on to see if they are detected again.
For me it works fine? If you want me to check something let me know
The following two points are key aspects of the API specifications and unique features of the add-on for the S10:
Robot Vacuum Cleaner S10
It would be great if you could confirm the following:
After some testing last night here is some feedback: I think the workingstatus/tasktype arent working 100% yet. This is my cleaning log: Sensors:
Also it says cleaRing instead of cleaNing ? is this normal or a typo?
Some info from your integration:
i use the polling service because i don't know what that webhook thingy is.. maybe this is why i'm not getting the updates?
@stinobook
Thank you for the feedback.
Clearing
is a typo in the API specifications. It has been continuing since the S1 and earlier models (haha).
Since the add-on uses the API response as is, I currently don't plan to fix the typo in the add-on.
https://github.com/OpenWonderLabs/SwitchBotAPI?tab=readme-ov-file#floor-cleaning-robot-s10-3
To briefly explain the difference between polling and webhooks...
"Polling" is the active retrieval of status.
The add-on calls the API to get the status and reflects the changes in the MQTT device. (This is what we refer to as polling.) There is a manual polling button that users can press and automatic polling that occurs at specified intervals.
Automatic polling is configured to retrieve data every hour (PT1H) by default. If you are not using webhooks, it is recommended to increase the frequency to something like every 5 minutes (PT5M). Since the API has a limit of 10,000 calls per day per account, you can adjust the number of devices and the desired polling frequency accordingly.
"Webhooks" passively retrieve status.
Devices that support SwitchBot webhooks report their status to the SwitchBot server via WiFi. When the SwitchBot server detects a status change, it sends a push notification to the app and notifies the webhook.
The add-on supports receiving webhooks, and when it receives one, it reflects the status changes in the MQTT device, similar to polling.
To receive webhooks, the add-on must act as a server that can accept HTTP requests from the internet. Becoming a server typically requires opening ports in the firewall, which can be cumbersome.
The add-on incorporates a tool called Ngrok, which allows it to securely receive webhooks without opening any ports. (If you want to enable webhooks, this is recommended.)
Oh i see! okay i enabled webhooks. i'll keep you posted how it works tomorrow :)
10:33:27 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,scenes
10:33:27 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/setupWebhook,{"statusCode":100,"body":{},"message":"success"}
10:33:27 info: SwitchBotMqttApp.Services.WebhookService[0] start listen <Configuration required only when using Webhook without ngrok>/webhook
10:33:28 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/scenes,{"statusCode":100,"body":[],"message":"success"}
@stinobook Ah, from the way those logs are appearing, it seems like the configuration might not be set up correctly.
If you are using Ngrok:
UseWebhook: true
UseNgrok: true
NgrokAuthToken: 2KY2Ol....your ngrok key
HostUrl: <Configuration required only when using Webhook without ngrok>
Log:
18:00:00 info: SwitchBotMqttApp.Services.WebhookService[0] start listen https://ffc3-xxx-xxx-xxx-xxx.ngrok-free.app/webhook
If you are opening a port and receiving the webhook directly:
UseWebhook: true
UseNgrok: false
NgrokAuthToken: <Configuration required only when using Webhook with ngrok>
HostUrl: http://<your public ip address>:8098
Log:
18:00:00 info: SwitchBotMqttApp.Services.WebhookService[0] start listen http://<your public ip address>:8098/webhook
When not receiving webhooks:
UseWebhook: false
UseNgrok: true
NgrokAuthToken: <Configuration required only when using Webhook with ngrok>
HostUrl: <Configuration required only when using Webhook without ngrok>
Woops! was to quick and indeed did not set the IP :)
12:16:38 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 1,0
12:16:39 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/redacted/status
12:16:39 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/queryWebhook,{"statusCode":190,"body":{},"message":""}
12:16:39 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/setupWebhook
12:16:40 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"ChargeDone","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"standBy"},"message":"success"}
12:16:40 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted"
12:16:40 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin"
12:16:40 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,scenes
12:16:40 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/setupWebhook,{"statusCode":100,"body":{},"message":"success"}
12:16:41 info: SwitchBotMqttApp.Services.WebhookService[0] start listen http://redacted.com:8098/webhook
12:16:41 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/scenes,{"statusCode":100,"body":[],"message":"success"}
12:16:41 info: SwitchBotMqttApp.Services.MqttCoreService[0] started
12:16:41 info: SwitchBotMqttApp.Services.PollingService[0] started
12:17:31 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 1,0
12:17:44 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 1,0
Tried sending a command: didnt do anything.
I've put the robot in 'Mop Drying' mode, which updates only after pressing the 'polling' controll in MQTT home assistant:
12:40:24 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"Clearing","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"standBy"},"message":"success"}
@stinobook
Based on the API response of parameters error, it seems there might be an error in the API specification... The implementation of selfClean follows the API specification, and the actual payload was as follows:
{"commandType":"command","command":"selfClean","parameter":"2"}
Please also try executing other commands to see if they work.
Additionally, I released version 1.0.15 just now due to an error in the addon's internal CSV master data. However, this only changes the payload values for selfClean from 0, 1, 2 to 1, 2, 3 and should not resolve the parameters error issue.commit https://github.com/OpenWonderLabs/SwitchBotAPI?tab=readme-ov-file#floor-cleaning-robot-s10-2
Updated to .15. here are some more command tests: -- verified doing something on robot (im not at home so just checking through the app)
--- verified
--- verified
--- setVolume not working
--- Still same error
--- verified but switched app to 'vacuum' mode (even with waterlevel 1) maybe because i tried vacuum only mode at earlier command?
can also switch times to 3. app shows nothing selected anymore (it doesn't have an option for 3x so it might be working)
Meanwhile nothing changed in MQTT HASS:
Thank you for trying out so many commands.
Regarding the setVolume command... This is likely an issue on the API server side. Since the domain of the API called from external sources is not divided by region, and changing the destination is not something handled by the add-on, it's probable that there are configuration oversights on SwitchBot's server side, leading to the command not being routed correctly.
Regarding the changeParam command... On the add-on's Ingress page command test screen, you must always input all parameters. If you omit parameters as shown in the image, the actual command payload will be as follows:
{"commandType":"command","command":"changeParam","parameter":{"fanLevel":1,"times":2}}
Whether this command works correctly in this state is not defined in the API specifications. (Since there are commands that are passed as a single string combined with colons instead of in JSON format, all parameters are essentially required.) However, this restriction applies only to tests on the add-on's Ingress page. In the actual MQTT integration's auto-discovered command devices, default values are defined and sent, so all parameters will be filled even if you do not explicitly input them. (The image shows the card screen of the device for the setPosition command of the curtain.)
The commands get accepted even if you don't fill out all values in the ingress page :) fyi. i saw them change on my app. Startstate:
Command sent: New state: New command sent: New state:
So another day of testing and I don't get any updates from the web hook. I have to manually press polling to get an update. Any idea how to troubleshoot this ?
https://github.com/hsakoh/switchbot-mqtt/issues/17#issuecomment-2118764538 Based on this comment, I understand that you are trying to receive Webhooks by opening ports, etc., without using Ngrok.
https://github.com/hsakoh/switchbot-mqtt/issues/18#issuecomment-2104346541 Referring to this comment, the first step is to ensure that the Webhook can be correctly accessed from the internet and that the ports are correctly opened.
You can use the payload mentioned in that comment, or refer to the following: https://github.com/OpenWonderLabs/SwitchBotAPI?tab=readme-ov-file#floor-cleaning-robot-s10-3 (The primary goal is to confirm that the webhook can be received.)
Webhooks seem to work:
Does my hosturl setting also need to have the /webhook/ in it? or just the url ? this is it currently: HostUrl: http://red.acted.com:8098
@stinobook
The HostUrl setting for the add-on only needs to include the port number, and you do not need to include /webhook
.
https://github.com/hsakoh/switchbot-mqtt/blob/main/src/SwitchBotMqttApp/Services/WebhookService.cs#L62-L64
It seems that you have confirmed the reception of the webhook (from the internet?). Do you have any other SwitchBot devices that support to webhooks?
Could it be an issue on the SwitchBot side where the S10 webhooks are not being triggered? I'm not sure what the cause is. Sorry I couldn't be of more help..
I followed the test from the comment you linked so yes it's from the internet. I don't own any other SwitchBot devices sadly. If I use web hooks do I need to disable polling? Because ever since enabling web hooks now the polling doesn't do anything anymore either.
Polling and webhooks can both be enabled simultaneously.
I believe the polling responses are being logged by the add-on. Are there any errors showing up? If the Status Lastupdate of the MQTT device is being updated, polling is functioning correctly. It might be that the data on the SwitchBot server is not being updated.
Could it be that the S10 is not communicating properly with the internet or the SwitchBot server? Sometimes, a device restart can help improve the situation. (Even if the S10 is near and can be controlled via the smartphone app, it is likely communicating via Bluetooth, so you may not notice a loss of communication with the server.)
i tried restarting it but that didnt do anything. i do have this in the logs:
12:00:34 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted"
12:00:34 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin"
@stinobook From the information you provided, the following can be inferred:
trce
is recorded, the log level is set to Trace.Points to confirm:
trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/XXXXXXXXXXX/status {"statusCode":100,"body":{....},"message":"success"}
switchbot/XXXXXXXXXXX/status/both
or switchbot/XXXXXXXXXXX/status/status
? If so, can you provide the timestamps and contents of these messages?
@stinobook From the information you provided, the following can be inferred:
- Since
trce
is recorded, the log level is set to Trace.- Polling was executed at 12:00:34.
- Manual polling was executed at 12:36:22.
- After the add-on is started (or after the UTC date changes), the API has only been called twice.
i rebooted HASS at 12:00 to restart everything and went to get a bite to eat. when i came back i noticed no updates were done so i pressed manual polling.
Points to confirm:
- After entering the polling frequency, have you saved the settings?
yes
- After changing and saving the polling frequency, have you restarted the add-on (or stopped and started the PollingService)?
i just restarted addon now for giving feedback on this comment. i did restart it earlier but can't recall when.
- Could you provide more specific details such as the time when the add-on was started, the expected times for automatic polling, and the times for manual polling?
Home assistant restarted at 12:00-ish Addon restarted at 13:47 no manual polling since 13:47
- At the Trace level, logs like the following should be output. Can you provide these logs?
trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/XXXXXXXXXXX/status {"statusCode":100,"body":{....},"message":"success"}
13:46:52 info: Microsoft.Hosting.Lifetime[0] Application is shutting down... 13:46:52 dbug: SwitchBotMqttApp.Services.AutomatedHostedService[0] Application has stopped - will stop services 13:46:52 info: SwitchBotMqttApp.Services.PollingService[0] stopped 13:46:52 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/updateWebhook 13:46:52 info: SwitchBotMqttApp.Services.MqttCoreService[0] stopped 13:46:54 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/updateWebhook,{"statusCode":100,"body":{},"message":"success"} 13:46:54 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/deleteWebhook 13:46:55 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/deleteWebhook,{"statusCode":100,"body":{},"message":"success"} 13:46:55 info: SwitchBotMqttApp.Services.WebhookService[0] stopped 13:46:57 warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {redacted} may be persisted to storage in unencrypted form. 13:46:57 info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8098 13:46:57 info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8099 13:46:57 dbug: SwitchBotMqttApp.Services.AutomatedHostedService[0] Application has started - will start services 13:46:57 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/queryWebhook 13:46:57 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. 13:46:57 info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production 13:46:57 info: Microsoft.Hosting.Lifetime[0] Content root path: /app/ 13:46:57 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 1,0 13:46:58 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/redacted/status 13:46:59 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/queryWebhook,{"statusCode":190,"body":{},"message":""} 13:46:59 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send POST,webhook/setupWebhook 13:46:59 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"ChargeDone","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"standBy"},"message":"success"} 13:46:59 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted" 13:46:59 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin" 13:46:59 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,scenes 13:47:00 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response POST,https://api.switch-bot.com/v1.1/webhook/setupWebhook,{"statusCode":100,"body":{},"message":"success"} 13:47:00 info: SwitchBotMqttApp.Services.WebhookService[0] start listen http://redac.ted.com:8098/webhook 13:47:00 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/scenes,{"statusCode":100,"body":[],"message":"success"} 13:47:00 info: SwitchBotMqttApp.Services.MqttCoreService[0] started 13:47:00 info: SwitchBotMqttApp.Services.PollingService[0] started 13:48:07 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 1,0 13:52:00 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/redacted/status 13:52:02 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"ChargeDone","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"standBy"},"message":"success"} 13:52:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted" 13:52:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin" 13:57:00 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/redacted/status 13:57:02 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"ChargeDone","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"standBy"},"message":"success"} 13:57:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted" 13:57:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin" 14:02:00 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/redacted/status 14:02:02 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"ChargeDone","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"standBy"},"message":"success"} 14:02:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted" 14:02:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin" 14:07:00 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Send GET,devices/redacted/status 14:07:02 trce: SwitchBotMqttApp.Logics.SwitchBotApiClient[0] Response GET,https://api.switch-bot.com/v1.1/devices/redacted/status,{"statusCode":100,"body":{"deviceId":"redacted","deviceType":"WoSweeperOrigin","workingStatus":"GotoChargeBase","onlineStatus":"online","battery":100,"waterBaseBattery":100,"taskType":"cleanArea"},"message":"success"} 14:07:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceId,"redacted" 14:07:02 trce: SwitchBotMqttApp.Services.MqttCoreService[0] disable polling paylod RobotVacuumCleanerS10,deviceType,"WoSweeperOrigin"
- From the following MQTT devices, you can verify the values subscribed by the MQTT device. Can you confirm if messages are being published to topics such as
switchbot/XXXXXXXXXXX/status/both
orswitchbot/XXXXXXXXXXX/status/status
? If so, can you provide the timestamps and contents of these messages?
Paste: https://pastebin.com/x491j3cE Word: Y8QDDpu9Bd
there you go :)
PS: Since just rebooting the addon the polling seems to work again! thats already something. but the webhook doesn't automatically update still.
@stinobook Thank you for the detailed information. It seems that the messages in the MQTT topics are being stored as intended.
I'm glad to hear that the polling started working after the restart. If the issue recurs, please send the same details as this time, and i might be able to identify the cause...
The issue with the webhooks not functioning is still unresolved, unfortunately.
FYI, doing some more testing on the webhooks:
curl -H "Content-Type: application/json" -H "Authorization: TOKEN" -X POST https://api.switch-bot.com/v1.1/webhook/queryWebhook -d '{"action":"queryUrl"}' response: {"statusCode":100,"body":{"urls":["https://red.a.com:cted8098/webhook"]}
curl -v -H "Content-Type: application/json" -H "Authorization: TOKEN" -X POST https://api.switch-bot.com/v1.0/webhook/queryWebhook -d '{"action":"queryDetails", "urls":["https://red.acted.com:8098/webhook"]}'
{"statusCode":100,"body":[{"deviceList":"ALL","createTime":1716717225850,"url":"https://red.acted.com:8098/webhook","enable":true,"lastUpdateTime":1716717225850}],"message":"success"}
Then i went ahead and deleted the webhook through the api. since i wasnt sure that the existing webhook was from my testing or from the addon. restarted addon did a new queryURL and the URL is back in the list. So far so good !
http...s? The HTTP server built into the add-on (ASP.NET Kestrel) does not hold SSL/TLS certificates for the domain (or IP address), so it is set to listen for connections over HTTP. Therefore, if you are not using Ngrok, the domain specified in the add-on configuration needs to use HTTP. (Alternatively, this would not apply if there is an external reverse proxy with SSL offloading so that the add-on is not directly exposed to the internet.)
As of the following comment, I understood it was using HTTP: https://github.com/hsakoh/switchbot-mqtt/issues/17#issuecomment-2118764538
On a slightly different note... So far, no one has successfully received a webhook from the S10. To distinguish whether it is a "connection issue" or "webhooks have not yet been implemented by SwitchBot," using Ngrok temporarily might help with the diagnosis.
http...s? The HTTP server built into the add-on (ASP.NET Kestrel) does not hold SSL/TLS certificates for the domain (or IP address), so it is set to listen for connections over HTTP. Therefore, if you are not using Ngrok, the domain specified in the add-on configuration needs to use HTTP. (Alternatively, this would not apply if there is an external reverse proxy with SSL offloading so that the add-on is not directly exposed to the internet.)
Ah yes oops that was one of my tries with editing the URL :) leftover from testing different configurations..
As of the following comment, I understood it was using HTTP: #17 (comment)
Back then it probably was :)
On a slightly different note... So far, no one has successfully received a webhook from the S10. To distinguish whether it is a "connection issue" or "webhooks have not yet been implemented by SwitchBot," using Ngrok temporarily might help with the diagnosis.
Oh okay so it's not just me ! ill have a look at that ngrok then, ill keep you posted :)
-- edit: So far no MQTT messages with ngrok.. same as before :) guess we'll wait for switchbot then..
Would it be possible to support the S10?