Announcement

Collapse
No announcement yet.

Device string in HS4

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

    Device string in HS4

    Do devices in HS4 have a general purpose string associated with them like they used to in HS3. I do not see it in this JSON dump. To ask the same question in another way. What string will be affected by this HS scripting command

    hs.SetDeviceString 2805, "this is a test",true

    {
    "ref": 2805,
    "name": "MD5 Output",
    "location": "Unknown",
    "location2": "Unknown",
    "value": 0,
    "status": "Off",
    "device_type_string": "",
    "last_change": "/Date(-62135596800000)/",
    "relationship": 3,
    "hide_from_view": false,
    "associated_devices": [],
    "device_type": {
    "Device_API": 0,
    "Device_API_Description": "No API",
    "Device_Type": 0,
    "Device_Type_Description": "Type 0",
    "Device_SubType": 0,
    "Device_SubType_Description": ""
    },
    "device_type_values": null,
    "UserNote": "",
    "UserAccess": "Any",
    "status_image": "/images/HomeSeer/status/off.gif",
    "voice_command": "",
    "misc": 4352,
    "interface_name": ""
    },

    #2
    From a scripting perspective, it should be exactly the same between HS3 & HS4, otherwise there would be compatibility issues between the two.

    Did you see this in your JSON dump?

    "device_type_string": "",
    Jon

    Comment


      #3
      I cannot find a reference to what was called DeviceString in HS3 in the HS4 API Reference. For backward compatibiliy, the HS3 API is still available, although I'm not sure what DeviceString would contain for HS4 devices.
      tenholde

      Comment


        #4
        Originally posted by jon00 View Post
        From a scripting perspective, it should be exactly the same between HS3 & HS4, otherwise there would be compatibility issues between the two.

        Did you see this in your JSON dump?

        "device_type_string": "",
        Yes, I do see "device type string" but it is what it says it is - a string related to the device's type not the general string that was part of device's attributes in HS3.

        Comment


          #5
          Device string, if set, is returned in the JSON 'status' parameter.

          Verified on both HS3 & HS4.

          In this example, the device string contains HTML <br> tags; in the JSON these are replaced by CR-LF (\r\n)

          Code:
                           {
                             'UserAccess' => 'Any',
                             'UserNote' => '',
                             'associated_devices' => [],
                             'device_type' => {
                                                'Device_API' => 0,
                                                'Device_API_Description' => 'No API',
                                                'Device_SubType' => 0,
                                                'Device_SubType_Description' => '',
                                                'Device_Type' => 0,
                                                'Device_Type_Description' => 'Type 0'
                                              },
                             'device_type_string' => '',
                             'device_type_values' => undef,
                             'hide_from_view' => $VAR1->{'Devices'}[1]{'hide_from_view'},
                             'interface_name' => '',
                             'last_change' => '/Date(1596521460051-0700)/',
                             'location' => 'Moon',
                             'location2' => 'Weather',
                             'misc' => 4160,
                             'name' => 'Phase',
                             'ref' => 5,
                             'relationship' => 0,
                             'status' => 'Full Moon
          99.4% illuminated
          Age: 14d 15h 13m
          New in 14d 17h 54m
          Full in 28d 20h 35m
          In Capricornus',
                             'status_image' => 'images/Moon/188.png',
                             'value' => '188',
                             'voice_command' => ''
                           },

          Comment


            #6
            https://docs.homeseer.com/pages/view...pageId=7443561

            devString in HS3 is located in Status in HS4
            tenholde

            Comment


              #7
              Originally posted by tenholde View Post
              https://docs.homeseer.com/pages/view...pageId=7443561

              devString in HS3 is located in Status in HS4
              I think you need to expand that to say in the HS4 PLUGIN SDK. It is not available in HS4 scripting as confirmed by Rich.
              Jon

              Comment


                #8
                Originally posted by jon00 View Post

                I think you need to expand that to say in the HS4 PLUGIN SDK. It is not available in HS4 scripting as confirmed by Rich.
                Or the HS4 GUI - the field is always blank

                Comment


                  #9
                  Originally posted by Tillsy View Post

                  Or the HS4 GUI - the field is always blank
                  Which field are you referring to?
                  Jon

                  Comment


                    #10
                    Click image for larger version

Name:	Status Field.jpg
Views:	440
Size:	45.8 KB
ID:	1408388

                    Comment


                      #11
                      Originally posted by Tillsy View Post
                      Click image for larger version

Name:	Status Field.jpg
Views:	440
Size:	45.8 KB
ID:	1408388
                      That is device status not device string.

                      If you want to know what device status is, read here: https://forums.homeseer.com/forum/de...-device-status

                      If you go to the Legacy /deviceutility page, you will see both Status and String listed. Example below.

                      Click image for larger version

Name:	Capture.PNG
Views:	437
Size:	30.9 KB
ID:	1408397
                      Jon

                      Comment


                        #12
                        Originally posted by jon00 View Post

                        That is device status not device string.

                        If you want to know what device status is, read here: https://forums.homeseer.com/forum/de...-device-status

                        If you go to the Legacy /deviceutility page, you will see both Status and String listed. Example below.

                        Click image for larger version

Name:	Capture.PNG
Views:	437
Size:	30.9 KB
ID:	1408397
                        Where in HS4 you can see "Legacy /deviceutility page" ????? ... or do you mean for me to go back to HS3 to see it ?
                        Pls clarify.

                        Comment


                          #13
                          Rather than /devices.html , type in /deviceutility
                          Jon

                          Comment


                            #14
                            Originally posted by jon00 View Post
                            That is device status not device string.
                            Well it's not status either because it is BLANK.

                            And here is the source code for that field showing it's actually the string - {{dv=deviceclass_by_ref child.ref}}{{dv.hsdev_string}}

                            So we don't have the status, only the value, and we don't have the string either. Three completely different versions of a device's output.

                            Comment


                              #15


                              Originally posted by jon00 View Post
                              Rather than /devices.html , type in /deviceutility
                              Thanks. I see it now. What was wrong with that beautiful HS3 GUI and why did I pay good money to move to HS4 crap?

                              The truth is that HS4 displays the "device string" in the "device status" field.

                              In HS3 (or the legacy in HS4 ) the "device string" is called "device string" and the "device status" is actually a compilation of the "device value" and the settings on "status graphics" page. In other words if you want value 0 to correspond to status "off" than status will be displayed as "off" when the value is 0.

                              I'm very sensitive to the issue of "device string" as I'm big time user of Big5 plug-in to deal with various APIs and communication with peripherals over HTTP, TCP, MQTT and all this info is stored as a string in most cases when it arrives into HomeSeer via Big5 plug-in.






                              Comment

                              Working...
                              X