Announcement

Collapse
No announcement yet.

Switchbot blind tilt - These work great

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    I'm still using v1.0 but not mapped it to v1.1 of the api. I was merely showing the slider I've setup for my curtainbot and how I like the UI setup that way. That is, I can open it close or something in between.
    HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

    Comment


      #47
      What are the v1 commands sent for each of your three controls?

      Comment


        #48
        I just send a capi to the big5 post device or profile where it is id 1404.

        i.e hs.CAPIControlHandler(hs.CAPIGetSingleControl(1404, false, 50, false, true)). The 50 in this example is for opening the curtain 50%.
        The device with the slider is just a virtual device with controls. I had to look as it is approaching 2 years since I set this up.
        HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

        Comment


          #49
          Thanks for looking. V1.1 API includes up or down with the command plus the number. I guess we will need to assess empirically how up/down plays into the control. It does seem to confirm that the hardware has only one axis of control. I do not see why the new API seems to have two. Perhaps they are planning for a device that can go both up/down like shades as well as tilt like blinds.

          Comment


            #50
            I'm still trying to get the ability to control my Bot as the API reports that it is not cloud enabled. It does show cloud enabled for the contact sensor, but since it does not have any control it does not help much.

            The response back from Support for IR was to try a different query endpoint. It resulted in a Forbidden response so still working on that one.

            Also struggling with the Webhook. When setup sometimes it returns 401 status, sometimes 190 indicating that it already exists, sometimes 190 with no message content. I monitored incoming traffic on the webhook port that I setup but nothing shows in Wireshark so my best guess is that there is no success on its setup. I am able to control the Bot via smartphone and contact sensor changes are reflected in the app and plugin so I would expect to have Webhook data too.

            I also discovered that there is a daily limit of 1000 requests. Found this out by letting it run overnight and I exceeded it. I put in checks and limits to avoid this in the future. I'm locked out for the remainder of today.

            If somebody want to play with it there is a HS4 updater package at the bottom of mcsMQTT Change Log (HS4 & HS3) - HomeSeer Message Board​ The Webhook functionality has been disabled at this time until I can get it working on my system. I expect blinds, bot, contact sensor to work as that is where I focused my testing. The others should also work, but I have not run test cases on them.

            The user document mcsMQTT.pdf is included in the download. Section 12.7 describes the integration. After plugin install, select plugin menu option for Cloud Page and then Switchbot Tab. Enter the user credentials as described in the document and a polling rate. If there are issues, then some feedback exists on the Developer Console if enabled from HS Setup. More is available in \data\mcsMQTT\mcsMQTT Debug.txt that is created when the Debug checkbox is enabled on the MQTT Page, General Tab at the top.

            It is version 6.3.1.0. I will soon be submitting to HST as there are other things I would like to release, but would like to have Switchbot working before I do.

            Comment


              #51
              Michael is this going to be a mcsMQTT add on or a stand alone plugin? I do not use mcsMQTT.
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #52
                It will not be a standalone plugin. There is no need to use MQTT protocol or other integrations available through this plugin if you want to take advantage of its Switchbot integration. The plugin has a page to enter Switchbot account parameters. That is all you need to do to populate HS Device/Feature based upon what is in your Cloud Account. It also has features to help when things do not go as expected.

                Comment


                  #53
                  I was using two smartphone with Switchbot app installed. It looks like Switchbot does not sync each app. When I enabled my bot on the second smartphone, I was able to control the Bot from HS.

                  This introduced another hurdle where the control of a device returns a JSON status that is not documented in the API. I was able to include the code for the Bot status response to update the HS status, but I do not yet have info on other devices such as Blinds. I will need the debug output of the plugin to know what to expect and then update code so HS device is updated immediately.

                  The other thing I became aware is that the 1000 server hits per day is really constraining. If a user has 10 devices, then they can only have an update of 100 times per day. The Webhook is the solution, but this is not yet functional.

                  Switchbot user support is good, but they recognized that my questions need to go the developers and directed me to use Github for future support. I have initiated that channel. Since it is the weekend, no response is expected yet.

                  I did update the 6.3.1.0 version that was previously referenced to capture the latest knowledge and code updates. This means you need to download again if you had previously installed 6.3.1.0. I feel pretty good about the Switchbot operation for control. A realistic real time status needs to have a Webhook operational. I suspect I will submit 6.3.1.0 to the updater and then update for the Webhook as I get more feedback from Switchbot developers and users. The initial release will not have Webhook operational, but for things like blinds where status updates are not needed that often it should be perfectly acceptable. Even the Bot does not need frequent updates since status is returned immediately after the command and then confirmed with an immediate status request. Of course, I still need the debug for what Switchbot Server sends in response to a blinds command. Things like contact sensors will need the Webhook operational if there is a need for realtime status.

                  I do have four Switchbot US Plugs that I installed Tasmota firmware to have local control. These are still recognized in the list of devices on the account. When I try to control them, I get the message that they are not connected to the Hub. This is expected since I change the firmware. It is a good sign, however, that a reasonable response is received. I do not recall ever linking these four plugs to my account so I am surprised they exists in the account. It was a year ago I did the smarplugs and memory is not a reliable source

                  Comment


                    #54
                    Michael,
                    I can test this but I'm not sure what to download and setup. Can you tell me what I need to load and setup?
                    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                    Comment


                      #55
                      1. The Updater package is at the bottom of https://forums.homeseer.com/forum/hs...ge-log-hs4-hs3. This one is for HS4 version 6.3.1.0. below the link is a description of how to use the Updater Override process. In essence, place the linked zip in HS4 root folder. Extract updater_override.json into the HS4 root folder. Go to HS Menu, Plugins, Add and only mcsMQTT should be listed as an available plugin. If this is not the case then HS may need a restart. After the the plugin is installed then remove updater_override.json from HS4 root to restore normal Updater functionality.

                      2. If you do not have Developer Mode option setup on HS Setup menu, then enabled it. The console window will have feedback to you want to observe and cut/paste so I can see what is returned.

                      3. Enable mcsMQTT from the HS Menu, Plugins, Manage

                      4. Select the Cloud page from Plugins, mcsMQTT
                      Click image for larger version

Name:	3.jpg
Views:	196
Size:	60.2 KB
ID:	1600634



                      5. Navigate to Switchbot tab and enter your Token and Secret key. Set polling rate to 100000. Server disconnect radio should be at the top to enable access to the Switchbot Cloud Server. The mcsMQTT user guide is place in\docs\mcsMQTT\mcsMQTT.pdf. It is also available from DOC menu option shown above, but this may just be a download depending upon browser settings. You do not need to look at the user guide for this other than knowing how to get your Token and Secret key. Hover the mouse over the Token text box and the tooltip will show you how to do this from the Switchbot smartphone App. It is "Go to Profile > Preference b) Tap App Version 10 times. Developer Options will show up c) Tap Developer Options d) Tap Get Token". I copied the two items to the clipboard and emailed to myself.

                      Click image for larger version

Name:	2.jpg
Views:	96
Size:	63.8 KB
ID:	1600635

                      6. On the Console window for mcsMQTT you should see the data being returned from Switchbot such as below. It is the JSON after the "Initialization Complete" message. If statusCode is not 100 then there is an issue with login to the account with credentials provided.

                      Click image for larger version

Name:	1.jpg
Views:	101
Size:	85.6 KB
ID:	1600636

                      7. HS Device and set of Features will be created in the Switchbot Floor and Room based upon the Device

                      Click image for larger version

Name:	0.jpg
Views:	98
Size:	34.1 KB
ID:	1600637
                      8. For the test I ran with output in the Console Window above I used the CloseDown button. The last line in the Console Window shows the command sent and the response. The response in this case is wrong DeviceId because this is not a real Switchbot item. It is just one I simulated. A successful response will be JSON with message key with success and code key with 100. I am interested in this last line with a successful response so I can update the code based upon what content exists in the JSON response.

                      9. Every two minutes or so a status request will be made. This should update the HS Features. If the blinds are changed it should be reflected in the HS Features.

                      Comment


                        #56
                        @Michael McSharry
                        I loaded the plugin and closed a blind and this is what was returned. Is this what you needed?

                        Switchbot command response to {"commandType":"command","command":"closeDown","parameter ":" default"} is {"statusCode":100,"body":{"items":[{"deviceID":"C42D760B715E","code":100,"status":{"isStuck" :fa lse,"deviceChain":1,"isCalibrate":true,"connectAllow":true," power":"on","position":0,"battery":100,"runStatus":"static", "direction":"horizontal"},"message":"success"}]},"message":"success"}

                        I'm not sure the status is supposed to be working but nothing updated when I controlled the blind.
                        Click image for larger version  Name:	image.png Views:	0 Size:	68.8 KB ID:	1600718

                        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                        Comment


                          #57
                          Yes this is what I need. I am guessing that close down is a position feedback of 0. Every two minutes or so you should be getting a status update on the console window. Can you provide that as well? The one you have is the important one to get the status after command. Some status should also be available via polling.

                          Comment


                            #58
                            Originally posted by Michael McSharry View Post
                            Yes this is what I need. I am guessing that close down is a position feedback of 0. Every two minutes or so you should be getting a status update on the console window. Can you provide that as well? The one you have is the important one to get the status after command. Some status should also be available via polling.
                            Here you go:
                            HS Startup Complete
                            Initialization Complete
                            MQTTClientSetup Host Supports IPV6
                            {"statusCode":100,"body":{"deviceList":[{"deviceId":"C42D760B715E","deviceName":"Left blind","deviceType":"Blind Tilt","enableCloudService":true,"hubDeviceId":"EB26467697C0" ,"group":false,"master":true,"blindTiltDevicesIds":[]},{"deviceId":"D1577677F543","deviceName":"Middle blind","deviceType":"Blind Tilt","enableCloudService":true,"hubDeviceId":"EB26467697C0" ,"group":false,"master":true,"blindTiltDevicesIds":[]},{"deviceId":"EB26467697C0","deviceName":"Hub","deviceType " :"Hub Mini","enableCloudService":true,"hubDeviceId":"000000000000" },{"deviceId":"ED8B44A24848","deviceName":"Right blind","deviceType":"Blind Tilt","enableCloudService":true,"hubDeviceId":"EB26467697C0" ,"group":false,"master":true,"blindTiltDevicesIds":[]}],"infraredRemoteList":[{"deviceId":"02-202303162107-92595706","deviceName":"Blinds","remoteType":"Others","hubDe viceId":"EB26467697C0"},{"deviceId":"02-202303162124-12190314","deviceName":"TV","remoteType":"TV","hubDeviceId": "EB26467697C0"}]},"message":"success"}

                            Here's an update:
                            Waiting for MQTT Messages
                            {"statusCode":100,"body":{"deviceId":"C42D760B715E","devi ceT ype":"Blind Tilt","hubDeviceId":"EB26467697C0","version":20,"calibrate": true,"battery":100,"direction":"Down","slidePosition":50},"m essage":"success"}
                            {"statusCode":100,"body":{"deviceId":"D1577677F543","devi ceT ype":"Blind Tilt","hubDeviceId":"EB26467697C0","version":20,"calibrate": true,"battery":100,"direction":"Down","slidePosition":50},"m essage":"success"}
                            {"statusCode":100,"body":{"deviceId":"ED8B44A24848","devi ceT ype":"Blind Tilt","hubDeviceId":"EB26467697C0","version":20,"calibrate": true,"battery":100,"direction":"Down","slidePosition":50},"m essage":"success"}​
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #59
                              All looks good with two confusion items. In polling status direction returns "Down". In command acknowledge the direction key returns "horizontal". Are there two position settings? Do I need two HS Features? Are position (ack) and slidePosition (poll) the same or two different measurements??

                              Confirm that the control via HS is achieving the desired result of the Blinds.

                              Comment


                                #60
                                Originally posted by Michael McSharry View Post
                                All looks good with two confusion items. In polling status direction returns "Down". In command acknowledge the direction key returns "horizontal". Are there two position settings? Do I need two HS Features? Are position (ack) and slidePosition (poll) the same or two different measurements??

                                Confirm that the control via HS is achieving the desired result of the Blinds.
                                All three buttons work as expected. I would think that the slider would follow the current status ie closed down, all the way to the left, fully open, slider in the middle and close up, the slider all the way to the right. Is this what you were asking?
                                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                                Comment

                                Working...
                                X