Announcement

Collapse
No announcement yet.

Switchbot blind tilt - These work great

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

    #61
    That was part of it to confirm operation. The second part was the polling data for position key returns "Down" while the command acknowledge status update returns "horizontal" for position key. This did not make sense to me. What I did is to rename the ack position to "orientation" and included both in HS. I actually think there is much more info than is really desired for HS, but easier to remove that to add. Removing is either with the HS Hide option or the mcsMQTT unassociate option.

    In the attached is an update to clean up the % suffix on most of the Features and to add the additional information from the data from the Console Window. Unzip the attached into HS subfolder \bin\mcsMQTT. Restart the plugin.


    Click image for larger version

Name:	0.jpg
Views:	163
Size:	72.3 KB
ID:	1600810

    Since some of the update involves Features that will only take effect when the Feature is created, the best thing to do is to start with a clean slate. This can be done in either of two ways from the MQTT Page. A textual approach is from the General Tab about 70% of the way toward the bottom and enter "Switchbot/#" in the texbox for the Remove Obsolete row. This removes all evidence of the Switchbot data that has been received and includes removing the HS Device & Features.

    Click image for larger version

Name:	1.jpg
Views:	115
Size:	13.6 KB
ID:	1600811

    The other way is the visual approach with a check in the Device/Main Topic "o" column checkbox . O is for obsolete. A Delete button will show to replace the "o" column header. Clicking it will remove all the Blind Tilt data. It is the Device Ref 970 in my example below. To make it easier to find the row of interest, use the T1 and/or T3 filter to select Switchbot and/or Blind Tilt. Follow this with the Show Associations button on the top of the table.

    Click image for larger version

Name:	2.jpg
Views:	117
Size:	54.5 KB
ID:	1600812

    I believe that attached update is fully functional except the Webhook. I am welcome to any feedback you would like to provide on things that are not correct or could be made better.

    Thank You for your help with the evaluation.

    Comment


      #62
      Michael,
      The slider now moves to the left on close down and to the middle on fully opened. Thanks. One thing I notice is none of the child devices update other than the Blind Tilt: slidePosition. So for me all the other chile devices can be left off the list. If battery worked I'd like it as well but it doesn't appear this is working either.

      Click image for larger version

Name:	image.png
Views:	118
Size:	101.9 KB
ID:	1600885​
      πŸ’β€β™‚οΈ Support & Customer Service πŸ™‹β€β™‚οΈ Sales Questions πŸ›’ Shop HomeSeer Products​

      Comment


        #63
        I used all three sources (devices,status,ack) of your data and see why status was not being updated. Update attached. Unzip into \bin\mcsMQTT subfolder of HS4.

        I added a radio setting on the Switchbot Tab or the Cloud Page to allow a user to select between autocreation of a minimal set of Features or a full set of Features. In the Blind Tilt case if will include slidePosition and battery for the minimal set and all for the maximum set.

        Click image for larger version

Name:	1.jpg
Views:	95
Size:	66.9 KB
ID:	1600985

        I also observed that your IR is being reported (mine is not). Unfortunately the report is at a high level and does not provide an itemization of the code names that are learned or associated with an appliance. From the API the following is available for control:

        Click image for larger version

Name:	0.jpg
Views:	120
Size:	86.3 KB
ID:	1600984

        Note: Most of the devices support turnOn or turnOff, which are case-sensitive. For infrared remote devices, when you have created customized buttons, you must set commandType to customize, otherwise the command will not work. command needs to be set to the name of the customized button.​
        To make this work there will been to be UI setup where the user can enter the names of the Appliance and Code that they want to control from HS. Should I provide this capability? Since I do not have IR being reported on my account I will need somebody to do the evaluation.

        Comment


          #64
          I went ahead and added the IR with the attached and evaluated with your JSON data. The control is a selector that is pre-populated with Switchbot's API definitions for standard types of equipment. The user is responsible for populating the controls (VSP) for the custom/Other type of IR appliances. In the example below I just entered the label "over" for the custom Blinds IR with a value of 1. Value of 0 is reserved for a blank selector. Any number can be used as long as unique.

          I confirmed the intended command is being delivered. I do not know what the status response will be, but I suspect it will just be a status of 100. You can post it from the console if it looks interesting.

          Click image for larger version

Name:	0.jpg
Views:	123
Size:	48.3 KB
ID:	1601002

          Comment


            #65
            I'm experimenting with Switchbot and have only one device: Smart Switch button. I have manually updated mcsMQTT to 6.3.1.0 on HS4 Pro Edition 4.2.18.3 (Windows). I've added my token and secret key to Switchbot in mcsMQTT. The plugin indicates that it is making requests to server. Problem is that mcsMQTT did not create the Switchbot device in HomeSeer. The Smart Switch is Bluetooth, not IR. So, is this to be expected at this time, since the Switch is different technology from the blind tilt device? Thanks.
            "Living with technology means living in a [constant] state of flux."
            S. Higgenbotham, 2023

            Comment


              #66
              As RUPP did above, can you enable Developer Mode and provide the data from the Console Window. 1. First message after initialization is complete will be the device list. This is the one that the plugin uses to create devices. 2. Every two minutes or so a status update will occur. After commanding from HS (after you get the HS device created), it will be the acknowledgement of the command request.

              In general the API on GitHub is well documented, but incomplete. It could be that the smart switch is not documented, and I will need to see the data to know how to create the device in HS. I do not recall doing a Smart Switch so it is likely a new product after the API was published.

              Comment


                #67
                Originally posted by Michael McSharry View Post
                I went ahead and added the IR with the attached and evaluated with your JSON data. The control is a selector that is pre-populated with Switchbot's API definitions for standard types of equipment. The user is responsible for populating the controls (VSP) for the custom/Other type of IR appliances. In the example below I just entered the label "over" for the custom Blinds IR with a value of 1. Value of 0 is reserved for a blank selector. Any number can be used as long as unique.

                I confirmed the intended command is being delivered. I do not know what the status response will be, but I suspect it will just be a status of 100. You can post it from the console if it looks interesting.

                Click image for larger version  Name:	0.jpg Views:	0 Size:	48.3 KB ID:	1601002
                Michael,
                I loaded the latest files and here are my findings. For the IR Blinds the selection list is blank but should show up and down.
                Click image for larger version

Name:	image.png
Views:	109
Size:	64.2 KB
ID:	1601151

                For the IR:TV the device view is:
                Click image for larger version

Name:	image.png
Views:	80
Size:	52.1 KB
ID:	1601152​
                If I select volumeSub the debug code is shown:
                Switchbot command response to {"commandType":"command","command":"volumeSub","parameter ":" default"} is {"statusCode":100,"body":{"items":[{"deviceID":"02-202303162124-12190314","code":100,"status":{"power":1},"message":"success "}]},"message":"success"}​

                Issue: I can only send one command. If I chose another command nothing is logged and the command isn't completed.

                Thanks for adding the Minimum Operational Set. ​

                Greg
                πŸ’β€β™‚οΈ Support & Customer Service πŸ™‹β€β™‚οΈ Sales Questions πŸ›’ Shop HomeSeer Products​

                Comment


                  #68
                  Originally posted by Michael McSharry View Post
                  As RUPP did above, can you enable Developer Mode and provide the data from the Console Window. 1. First message after initialization is complete will be the device list. This is the one that the plugin uses to create devices. 2. Every two minutes or so a status update will occur. After commanding from HS (after you get the HS device created), it will be the acknowledgement of the command request.

                  In general the API on GitHub is well documented, but incomplete. It could be that the smart switch is not documented, and I will need to see the data to know how to create the device in HS. I do not recall doing a Smart Switch so it is likely a new product after the API was published.
                  I would if I knew how to get to "Console window for mcsMQTT."
                  "Living with technology means living in a [constant] state of flux."
                  S. Higgenbotham, 2023

                  Comment


                    #69
                    Originally posted by Richel View Post

                    I would if I knew how to get to "Console window for mcsMQTT."
                    Select Setup > General Tab > Other setting > check developer mode. Then restart HS4 and you'll see a console window for each plugin you have enabled.
                    πŸ’β€β™‚οΈ Support & Customer Service πŸ™‹β€β™‚οΈ Sales Questions πŸ›’ Shop HomeSeer Products​

                    Comment


                      #70
                      Originally posted by Rupp View Post

                      Select Setup > General Tab > Other setting > check developer mode. Then restart HS4 and you'll see a console window for each plugin you have enabled.
                      Thank you!
                      "Living with technology means living in a [constant] state of flux."
                      S. Higgenbotham, 2023

                      Comment


                        #71
                        Issue: I can only send one command. If I chose another command nothing is logged and the command isn't completed.
                        I ran this one down and made source code updates. I will wait for Richel input to include his device in the next build.

                        For the IR Blinds the selection list is blank but should show up and down.
                        In the previous post I think you overlooked the following. Your Blinds IR is classified as Other from Switchbot server. You may also be interested in converting this one in particular to Buttons rather than selector. It is described below also.

                        The user is responsible for populating the controls (VSP) for the custom/Other type of IR appliances. In the example below I just entered the label "over" for the custom Blinds IR with a value of 1. Value of 0 is reserved for a blank selector. Any number can be used as long as unique.
                        I expanded this in mcsMQTT.pdf with the following IR section of mcsMQTT.pdf.

                        I find the easiest way to navigate the Edit Tab/Popup of mcsMQTT is to start with the MQTT Page, Association Tab. Find the HS Feature Ref number that you want to modify. Filter T3 set to IR will reduce the Association Table size to 2 in your case after clicking the Show Associations button at the top of the table.

                        Click on the Ref Number button for the Blinds IR Feature Ref. This will bring up the Edit popup. From there the described changes can be made. In your particular case I would use the Edit popup and change the Control/Status UI to Button and in the VSP textbox I would enter "down,up" without quotes. This will result in a DOWN and UP button for the two IR codes for the Blinds IR. You could do the same for the TV if you want buttons, but don't change the VSP in this case since it is based upon what is available from Switchbot API.


                        12.7.4 Switchbot Infra-RedSwitchbot hub supports learning of IR code for custom devices and from a library of standard devices such as TV, DVR, Fan, etc. Each appliance that has been learned will be reflected in HS as a Device and Feature with a dropdown selector control. Control is also possible through standard event action and scripting methods. See Figure 124.
                        Click image for larger version

Name:	dataurl005740.png
Views:	73
Size:	43.4 KB
ID:	1601224
                        Figure 124 Switchbot IR Appliance Devices
                        For the standard IR appliances known by Switchbot, mcsMQTT will populate the selector control with the available IR-code names. These are the only ones that the Switchbot hub will recognize and respond by blasting an IR pulse sequence.
                        For the custom IR appliances, the user needs to define the IR-code names that were setup on their account via the Switchbot App. The names are maintained as Value Status Pairs (VSP). They can be entered from the HS Devices Page, click on the IR Feature, Status/Graphics Tab, New Single Value, Edit icon, enter Label column Status such as β€œClose” in Figure 125.

                        Click image for larger version

Name:	dataurl005743.png
Views:	72
Size:	51.6 KB
ID:	1601227
                        Figure 125 Switchbot Custom IR Code Definition
                        This can also be done on the MQTT Page, Edit Tab/Popup for the selected IR Topic as shown in Figure 126. The syntax in the Add/Edit textbox is Name=number;Name for a single entry or to put all entries in at once use comma between each name such as β€œ-,On,Off,Close,Open,Tilt” to define six IR Codes. Before doing this make certain the Max Number of VSP texbox will account for all codes being entered.

                        Click image for larger version

Name:	dataurl005743.png
Views:	73
Size:	15.6 KB
ID:	1601225
                        Figure 126 Switchbot Custom IR Codes Setup on Edit Tab
                        For both custom and standard IR Appliances it is possible to change between using Buttons or a Selector for the HS Devices control. The default is Selector. The Selector is identified on the Edit Tab with a HS Device Control/Status UI of List. To change the list to a set of Buttons on the HS Devices Page for control then select the Button radio option.

                        Click image for larger version

Name:	dataurl005744.png
Views:	69
Size:	18.8 KB
ID:	1601226
                        Click image for larger version

Name:	dataurl005744.png
Views:	153
Size:	27.6 KB
ID:	1601223
                        Figure 127 Switchbot IR Control via Buttons
                        ​

                        Comment


                          #72
                          Originally posted by Michael McSharry View Post
                          As RUPP did above, can you enable Developer Mode and provide the data from the Console Window. 1. First message after initialization is complete will be the device list. This is the one that the plugin uses to create devices. 2. Every two minutes or so a status update will occur. After commanding from HS (after you get the HS device created), it will be the acknowledgement of the command request.

                          In general the API on GitHub is well documented, but incomplete. It could be that the smart switch is not documented, and I will need to see the data to know how to create the device in HS. I do not recall doing a Smart Switch so it is likely a new product after the API was published.
                          Not much to see:

                          Connecting to HomeSeer...
                          Connected to HomeSeer
                          Waiting for initialization...
                          mcsMQTT Browser Pages Registered with HS
                          HS Startup Complete
                          Initialization Complete
                          MQTTClientSetup Host Supports IPV6
                          Starting Windows BLEScan
                          BLE Device Watcher Started
                          {"statusCode":100,"body":{"deviceList":[],"infraredRemoteList":[]},"message":"success"}
                          Waiting for MQTT Messages
                          Bluetoth Watcher Stop
                          Starting Windows BLEScan
                          BLE Device Watcher Started​
                          "Living with technology means living in a [constant] state of flux."
                          S. Higgenbotham, 2023

                          Comment


                            #73
                            The good news is that your Token and Key are recognized with a successful login.
                            Code:
                            {"statusCode":100,"body":{"deviceList":[],"infraredRemoteList":[]},"message":"success"}
                            The bad news is that the Switchbot server does not see any devices in the account and no IR remote yet learned. From your smartphone make certain your device has been enabled for Cloud access. I suggest contacting Switchbot support. It can be done most easily through the smartphone app. Their customer support is responsive, but questions relating to the API need to be forwarded to their developers usually. I have had several issues and they eventually told me to submit my issues on GitHub. I did this but have had no response yet through that channel.

                            My concern is that the Switch is not supported in the API either because of its physical characteristics or because it is a new product that is ahead of the developers supporting the API.

                            It also may be supported, and we are just calling it different things. The button pusher is called "Bot" and is in the API and I do have it for testing. When I do a search on Google for "Switchbot Smart Switch" the only hits I get are for the Bot. If this is the case then Switchbot support should be able to resolve your situation.

                            The API link on GitHub is OpenWonderLabs/SwitchBotAPI: SwitchBot Open API Documents (github.com)​

                            Comment


                              #74
                              Originally posted by Michael McSharry View Post
                              The good news is that your Token and Key are recognized with a successful login.
                              Code:
                              {"statusCode":100,"body":{"deviceList":[],"infraredRemoteList":[]},"message":"success"}
                              The bad news is that the Switchbot server does not see any devices in the account and no IR remote yet learned. From your smartphone make certain your device has been enabled for Cloud access. I suggest contacting Switchbot support. It can be done most easily through the smartphone app. Their customer support is responsive, but questions relating to the API need to be forwarded to their developers usually. I have had several issues and they eventually told me to submit my issues on GitHub. I did this but have had no response yet through that channel.

                              My concern is that the Switch is not supported in the API either because of its physical characteristics or because it is a new product that is ahead of the developers supporting the API.

                              It also may be supported, and we are just calling it different things. The button pusher is called "Bot" and is in the API and I do have it for testing. When I do a search on Google for "Switchbot Smart Switch" the only hits I get are for the Bot. If this is the case then Switchbot support should be able to resolve your situation.

                              The API link on GitHub is OpenWonderLabs/SwitchBotAPI: SwitchBot Open API Documents (github.com)​
                              Thanks, Michael. I think that I need to purchase and implement their hub, in order to have the Switchbot switch register with their cloud.
                              "Living with technology means living in a [constant] state of flux."
                              S. Higgenbotham, 2023

                              Comment


                                #75
                                I believe you have the most likely diagnosis.

                                Comment

                                Working...
                                X