Announcement

Collapse
No announcement yet.

Direct Storage from HS Devices to InfluxDB

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

    #91
    (8) indicates that it does not like auth using "Token user : pass" while (7) gets past the auth, but it does not like something about the message. I had similar experience when testing V2.0. (7) is the best candidate at this time. I know you tried it before without success, but could you try again, show the response from the debug and also show what you have in the [http] section of influxDB config file.

    Code:
    17-1-2021 22:24:14 1111745 | InfluxDB Write Finally The remote server returned an error: [B](401) Unauthorized.[/B]

    Comment


      #92
      In the conf file:
      Code:
      [http]
      auth-enabled = true
      pprof-enabled = true
      pprof-auth-enabled = true
      ping-auth-enabled = true
      OK, back to version 7 of the dll. In the debug:

      Code:
      17-1-2021 23:13:18 119194 | SubGet URL http://192.168.1.55:8086/api/v2/buckets?name=MQTT2
      17-1-2021 23:13:18 119480 | SubmitGet Finally no Response
      17-1-2021 23:13:18 119483 | InfluxDB Post URL http://192.168.1.55:8086/query Data: q=CREATE DATABASE MQTT2
      17-1-2021 23:13:18 119483 | InfluxDB Post Header Authorization: Basic YWRtaW46UGlrbGVfNTU5MUluZg==
      17-1-2021 23:13:18 119511 | InfluxDB Post After postStream
      17-1-2021 23:13:18 119511 | InfluxDB Post After postStream Finally False
      17-1-2021 23:13:18 119513 | InfluxDB Post Response Requested
      17-1-2021 23:13:18 119545 | InfluxDB Post Response Success {"results":[{"statement_id":0}]}
      Code:
      17-1-2021 23:14:39 200108 | InfluxDB Write URI http://192.168.1.55:8086/api/v2/write?bucket=MQTT2&orgID=homeseer
      17-1-2021 23:14:39 200108 | InfluxDB Write Auth Authorization: Basic YWRtaW46UGlrbGVfNTU5MUluZg==
      17-1-2021 23:14:39 200110 | InfluxDB Write Requesting Response
      17-1-2021 23:14:39 200113 | InfluxDB Write Finally The remote server returned an error: (400) Bad Request.
      17-1-2021 23:14:39 200143 | HSEvent VALUE_SET| 2048| F891BB20-180-Q319| 16,2| 16,2| 388
      17-1-2021 23:14:39 200144 | InfluxDB Write URI http://192.168.1.55:8086/api/v2/write?bucket=MQTT2&orgID=homeseer
      17-1-2021 23:14:39 200144 | InfluxDB Write Auth Authorization: Basic YWRtaW46UGlrbGVfNTU5MUluZg==
      17-1-2021 23:14:39 200146 | InfluxDB Write Requesting Response
      17-1-2021 23:14:39 200148 | InfluxDB Write Finally The remote server returned an error: (400) Bad Request.

      Comment


        #93
        Michael, which of the versions of the ddl uses the InfluxDB 1.8 API ? I mean without that /api/v2/write but just /write ?

        Comment


          #94
          What is the field name that is being selected? (i.e. device 388). I see in post #80 you are using all hs properties available. I tried mine with the same and it continues to work as desired during a write. Assuming you have a simple name without special characters can you use this format to evaluate if there is something in the name vs something else.

          Comment


            #95
            388 was a non plugin device. I am using now these:

            Click image for larger version

Name:	2021-01-18_000649.png
Views:	120
Size:	157.6 KB
ID:	1448936

            Comment


              #96
              If I look in the debug file then I see no write actio when these device appear:

              Code:
              18-1-2021 00:14:15 1050925 | ActOnMessageForTrigger QueueSize=0 ,Topic Sensor/Buiten/licht,Payload 0
              18-1-2021 00:14:15 1051074 | HSEvent VALUE_CHANGE| 1024| | 26940| 26939| 594
              18-1-2021 00:14:15 1051079 | HSEvent VALUE_CHANGE| 1024| | 14669| 14667| 258
              18-1-2021 00:14:15 1051334 | Update Accepted 852 to 1022 StatusType=2 Payload= 1022 RegExValue= 1022
              18-1-2021 00:14:15 1051348 | Updating Device from 1022 PayloadNumeric=True
              18-1-2021 00:14:15 1051361 | HSEvent VALUE_SET| 2048| Sensor/Buiten| 1022| 1022| 852
              18-1-2021 00:14:15 1051362 | ActOnMessageForTrigger QueueSize=0 ,Topic Sensor/Buiten/baro,Payload 1022
              18-1-2021 00:14:15 1051375 | ActOnMessageForTrigger QueueSize=2 ,Topic Sensor/Buiten/x,Payload 4.1
              18-1-2021 00:14:15 1051388 | ActOnMessageForTrigger QueueSize=1 ,Topic Sensor/Buiten/dpt,Payload 2.6
              Isn't this strange?

              Comment


                #97
                I see no more write statement at all in the debug file with these devices beeing selected. Only the creation of the database.

                Comment


                  #98
                  Is is far past midnight here, I call it a day. Looking forward to more conversation tomorrow.
                  Thanks so far!

                  Comment


                    #99
                    No write means that the device ref was not in the list of devices targeted to influxdb. Debug added to show the active list before checking if going to write. This is (10). In subsequent builds I removed header keys one by one until the end when I tried a few variants. Don't care about ability to create a database. Only if there is a write success. Just guessing on each of these
                    Attached Files

                    Comment


                      There is something weird going on. I use dll 10 now and in the debug I see devices connected to the InfluxDB list that are not selected in the associations tab.

                      Code:
                      18-1-2021 10:19:30 1419552 | HSEvent VALUE_CHANGE| 1024| F891BB20-190-Q17| 75| 74| 861
                      18-1-2021 10:19:30 1419552 | InfluxDB List
                      but device 861 is not selected in the associations tab:

                      Click image for larger version

Name:	2021-01-18_102419.png
Views:	123
Size:	51.8 KB
ID:	1449001

                      Other devices that are refenced as in the InfluxDB List are 852 and 859. I did once select them but they are deselected.
                      The only devices that are selected are presented in post #95. These are device numbers 852, 853 and 854 and they do not appear in the debug with the InfluxDB List reference.

                      Code:
                      18-1-2021 10:20:15 1464876 | HSEvent VALUE_CHANGE| 1024| Sensor/Buiten| 206| 204| 854
                      18-1-2021 10:20:15 1464384 | HSEvent VALUE_SET| 2048| Sensor/Buiten| 3,8| 3,8| 853
                      18-1-2021 10:20:15 1464385 | ActOnMessageForTrigger QueueSize=0 ,Topic Sensor/Buiten/buitentemp,Payload 3.8
                      18-1-2021 10:20:15 1464548 | HSEvent VALUE_CHANGE| 1024| | 51029| 51027| 258
                      18-1-2021 10:20:15 1464825 | Update Accepted 854 to 206 StatusType=2 Payload= 206 RegExValue= 206
                      18-1-2021 10:20:15 1464840 | Updating Device from 204 PayloadNumeric=True
                      18-1-2021 10:20:15 1464873 | ActOnMessageForTrigger QueueSize=0 ,Topic Sensor/Buiten/licht,Payload 206
                      18-1-2021 10:20:15 1464876 | HSEvent VALUE_CHANGE| 1024| Sensor/Buiten| 206| 204| 854
                      18-1-2021 10:20:16 1465236 | Update Accepted 852 to 1021 StatusType=2 Payload= 1021 RegExValue= 1021
                      18-1-2021 10:20:16 1465243 | Updating Device from 1021 PayloadNumeric=True
                      18-1-2021 10:20:16 1465247 | HSEvent VALUE_SET| 2048| Sensor/Buiten| 1021| 1021| 852
                      Could there something be wrong with the selection mechanism?

                      Comment


                        I have now installed dll version 11.
                        In the associations tab I deselected all the devices. Then I selected three devices: 852, 853 and 854.

                        In the debug I see now for device 852:
                        Code:
                        18-1-2021 10:44:16 513537 | HSEvent VALUE_SET| 2048| Sensor/Buiten| 1020| 1020| 852
                        18-1-2021 10:44:16 513538 | InfluxDB List 854 853 852
                        18-1-2021 10:44:16 513538 | InfluxDB Write URI http://192.168.1.55:8086/api/v2/write?bucket=MQTT&orgID=homeseer
                        18-1-2021 10:44:16 513541 | InfluxDB Write Requesting Response
                        18-1-2021 10:44:16 513544 | ActOnMessageForTrigger QueueSize=0 ,Topic Sensor/Buiten/baro,Payload 1020
                        18-1-2021 10:44:16 513553 | InfluxDB Write Response Success
                        18-1-2021 10:44:16 513553 | InfluxDB Write Finally
                        so YES, a successful write!

                        On the Influx server:

                        Code:
                        > use MQTT2
                        Using database MQTT2
                        > select * from mcsMQTT
                        name: mcsMQTT
                        time device value
                        ---- ------ -----
                        1610963115279036857 Sensor_Buiten_buitentemp_853 4
                        1610963115715305550 Sensor_Buiten_licht_854 194
                        1610963116149314783 Sensor_Buiten_baro_852 1020
                        1610963175293388137 Sensor_Buiten_buitentemp_853 4.1
                        1610963175706640724 Sensor_Buiten_licht_854 197
                        1610963176117888900 Sensor_Buiten_baro_852 1020
                        1610963235269806742 Sensor_Buiten_buitentemp_853 4.1
                        1610963235705423004 Sensor_Buiten_licht_854 203
                        1610963236116340771 Sensor_Buiten_baro_852 1020
                        1610963295262170530 Sensor_Buiten_buitentemp_853 4.1
                        1610963295721352123 Sensor_Buiten_licht_854 211
                        1610963296125133130 Sensor_Buiten_baro_852 1020
                        1610963355259300466 Sensor_Buiten_buitentemp_853 4.1
                        1610963355707575182 Sensor_Buiten_licht_854 219
                        1610963356119085353 Sensor_Buiten_baro_852 1020
                        1610963415270730547 Sensor_Buiten_buitentemp_853 4.1
                        1610963415710948938 Sensor_Buiten_licht_854 226
                        1610963416131199990 Sensor_Buiten_baro_852 1020
                        1610963475254007353 Sensor_Buiten_buitentemp_853 4.1
                        1610963475720344105 Sensor_Buiten_licht_854 221
                        1610963476129204717 Sensor_Buiten_baro_852 1020
                        >
                        In the history tab I filled user : passw the authorization token.

                        Another observation:
                        The three devices report every minute there values. In the debug I see every minute these reports, but in the database I see much more entries of these devices. Is that due to the test dll?
                        Now I see the data coming in nicely every minute
                        Last edited by Cor; January 18, 2021, 05:41 AM. Reason: new experience

                        Comment


                          Is it useful to test the other dll's as well?

                          Comment


                            Another observation: If I disable and enable the plugin than it turns out that the selection of devices in the association tab are ignored. Deselecting and selecting these devices makes the data coming in again.
                            Once this is going it is possible to change the selections on the fly.

                            Comment


                              Michael, I am out until late this night. Won't be able to react before tomorrow morning.

                              Comment


                                Michael - do you have an expectation when this will be rolled out via the updater?

                                Back in December, I tried the side load option but didn't have any luck... I am currently logging to Influx via Node-Red, which is working for me, but I definitely want to try this out.

                                Comment

                                Working...
                                X