Announcement

Collapse
No announcement yet.

PLugin request/ help to scrape data from British gas Hive

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

  • #31
    Originally posted by ben pownall View Post
    HI, just a follow-up. I have spotted that the log in is getting there but there seems to be a long period between getting a new key. See log below.
    Apr-10 18:09:17 Hive 3P HIVE New API Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTg1NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.usby5xk_3QMHwKVUAq0m_xVazXdS5Hfw3ZYfYhQ8tw8
    Apr-10 18:09:17 Hive 3P Getting New API Key For HIVE...Old Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA
    Apr-10 18:03:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA Command: 3
    Apr-10 18:03:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA Command: 3
    Apr-10 17:57:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA Command: 3
    Apr-10 17:57:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA Command: 3
    Apr-10 17:51:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA Command: 3
    Apr-10 17:51:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA Command: 3
    Apr-10 17:09:18 Hive 3P HIVE New API Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTQ5NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.jd3_6HvEDaCkVXyc4AkvN_We3YzKeyYVDcoqgsEKhXA
    Apr-10 17:09:17 Hive 3P Getting New API Key For HIVE...Old Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io
    Apr-10 17:03:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io Command: 3
    Apr-10 17:03:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io Command: 3
    Apr-10 16:57:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io Command: 3
    Apr-10 16:57:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io Command: 3
    Apr-10 16:51:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io Command: 3
    Apr-10 16:51:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io Command: 3
    Apr-10 16:09:17 Hive 3P HIVE New API Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MTEzNTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.2j74KjvfYXNm_l6E7liQwzPCtz-RaJZkAGr-3FcM8Io
    Apr-10 16:09:17 Hive 3P Getting New API Key For HIVE...Old Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw
    Apr-10 16:03:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    Apr-10 16:03:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    Apr-10 15:57:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    Apr-10 15:57:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    Apr-10 15:51:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    Apr-10 15:51:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    Apr-10 15:09:18 Hive 3P Hive Web Exception: The remote server returned an error: (401) Unauthorized. Key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJob25leWNvbWI iLCJleHAiOjE1NTQ5MDc3NTQsInV1aWQiOiIxM2Q5ODI5ZS1kZGM5LTRhOWM tOWZhMi0zNDliYzM3ZGYyYTEiLCJ1c2VybmFtZSI6ImJlbl9wb3duYWxsQGh vdG1haWwuY29tIn0.YrwZvNt6lP7k95abN0cTutKIaX7_zZ_BX2WyOkGXAtw Command: 3
    I'll have to check the code to see what the refresh interval I have set is, the issues may be at the British Gas end as they may have lowered their token time out to deal with people who try and use their system in this way. I'll perhaps add an INI setting to lower the refresh interval which would be of use for the future in case it happens again.
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #32
      Originally posted by mrhappy View Post

      I'll have to check the code to see what the refresh interval I have set is, the issues may be at the British Gas end as they may have lowered their token time out to deal with people who try and use their system in this way. I'll perhaps add an INI setting to lower the refresh interval which would be of use for the future in case it happens again.
      Looks like I already added a timer interval into the code to refresh the API key, it is set to one hour by default.

      Can you open the Hive3P.ini file, look under the [Settings] key and see if there is an APITimerInterval value. If there is change it, if not amend it. I'd suggest setting it to 15 minutes as a start which will be 900000. Save the file.

      That value is only checked on startup so you would need to restart the plugin for it to take effect, check the log when it is starting to see whether the entry 'Found Timer Intervals' correctly reports 900000.

      If you leave that running then the new API key entry should now be every 15 minutes, I'm interested whether or not the 401 errors disappear.
      My Plugins:

      Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
      Yeelight 3P | Nanoleaf 3P

      Comment


      • #33
        OK, nice one. I will change it to 900000 and see how it goes. Will let you know.

        Regards

        Comment

        Working...
        X