Autor Thema: ( Geloest) HTTPMOD userreadings  (Gelesen 402 mal)

Offline Wolfgang Hochweller

  • Sr. Member
  • ****
  • Beiträge: 658
( Geloest) HTTPMOD userreadings
« am: 25 Januar 2022, 23:36:53 »
Ich hole mir regelmaessig Daten ueber HTTPMOD :


{"query": "{viewer {homes {currentSubscription {priceInfo {tomorrow {total startsAt }}}}}}" }

Wenn das funktioniert, bekomme ich eine Reihe Readings; jedes dieser Readings wird ueber userreadings weiter verarbeitet.
Wenn es nicht funktioniert, was durchaus vorkommen darf, bleiben die Readings ungesetzt.

Kann bei letzterem die Ausfuehrung der userreadings unterdruecken, ohne bei jedem einzelnen Reading zu checken, ob die Ausfuehrung ueberhaupt Sinn macht  ?
« Letzte Änderung: 26 Januar 2022, 17:02:46 von Wolfgang Hochweller »

Offline rabehd

  • Hero Member
  • *****
  • Beiträge: 1279
Antw:HTTPMOD userreadings
« Antwort #1 am: 26 Januar 2022, 06:22:01 »
Wie triggerst Du denn die Userreadings?
Auch funktionierende Lösungen kann man hinterfragen.

Offline Wolfgang Hochweller

  • Sr. Member
  • ****
  • Beiträge: 658
Antw:HTTPMOD userreadings
« Antwort #2 am: 26 Januar 2022, 10:45:03 »
Das Ergebnis des 'get' :

{
  "data": {
    "viewer": {
      "homes": [
        {
          "currentSubscription": {
            "priceInfo": {
              "current": {
                "total": 1.6888,
                "energy": 1.343,
                "tax": 0.3458,
                "startsAt": "2022-01-26T10:00:00.000+01:00"
              },
              "today": [
                {
                  "total": 1.7034,
                  "energy": 1.3548,
                  "tax": 0.3486,
                  "startsAt": "2022-01-26T00:00:00.000+01:00"
                },
                {
                  "total": 1.6779,
                  "energy": 1.3343,
                  "tax": 0.3436,
                  "startsAt": "2022-01-26T01:00:00.000+01:00"
                },
                {
                  "total": 1.6466,
                  "energy": 1.3093,
                  "tax": 0.3373,
                  "startsAt": "2022-01-26T02:00:00.000+01:00"
                },
                {
                  "total": 1.6127,
                  "energy": 1.2822,
                  "tax": 0.3305,
                  "startsAt": "2022-01-26T03:00:00.000+01:00"
                },
                {
                  "total": 1.6104,
                  "energy": 1.2804,
                  "tax": 0.33,
                  "startsAt": "2022-01-26T04:00:00.000+01:00"
                },
                {
                  "total": 1.6322,
                  "energy": 1.2978,
                  "tax": 0.3344,
                  "startsAt": "2022-01-26T05:00:00.000+01:00"
                },
                {
                  "total": 1.6569,
                  "energy": 1.3175,
                  "tax": 0.3394,
                  "startsAt": "2022-01-26T06:00:00.000+01:00"
                },
                {
                  "total": 1.6976,
                  "energy": 1.3501,
                  "tax": 0.3475,
                  "startsAt": "2022-01-26T07:00:00.000+01:00"
                },
                {
                  "total": 1.7257,
                  "energy": 1.3726,
                  "tax": 0.3531,
                  "startsAt": "2022-01-26T08:00:00.000+01:00"
                },
                {
                  "total": 1.704,
                  "energy": 1.3552,
                  "tax": 0.3488,
                  "startsAt": "2022-01-26T09:00:00.000+01:00"
                },
                {
                  "total": 1.6888,
                  "energy": 1.343,
                  "tax": 0.3458,
                  "startsAt": "2022-01-26T10:00:00.000+01:00"
                },
                {
                  "total": 1.6793,
                  "energy": 1.3354,
                  "tax": 0.3439,
                  "startsAt": "2022-01-26T11:00:00.000+01:00"
                },
                {
                  "total": 1.651,
                  "energy": 1.3128,
                  "tax": 0.3382,
                  "startsAt": "2022-01-26T12:00:00.000+01:00"
                },
                {
                  "total": 1.6375,
                  "energy": 1.302,
                  "tax": 0.3355,
                  "startsAt": "2022-01-26T13:00:00.000+01:00"
                },
                {
                  "total": 1.6375,
                  "energy": 1.302,
                  "tax": 0.3355,
                  "startsAt": "2022-01-26T14:00:00.000+01:00"
                },
                {
                  "total": 1.6388,
                  "energy": 1.303,
                  "tax": 0.3358,
                  "startsAt": "2022-01-26T15:00:00.000+01:00"
                },
                {
                  "total": 1.676,
                  "energy": 1.3328,
                  "tax": 0.3432,
                  "startsAt": "2022-01-26T16:00:00.000+01:00"
                },
                {
                  "total": 1.7187,
                  "energy": 1.367,
                  "tax": 0.3517,
                  "startsAt": "2022-01-26T17:00:00.000+01:00"
                },
                {
                  "total": 1.7117,
                  "energy": 1.3614,
                  "tax": 0.3503,
                  "startsAt": "2022-01-26T18:00:00.000+01:00"
                },
                {
                  "total": 1.6851,
                  "energy": 1.3401,
                  "tax": 0.345,
                  "startsAt": "2022-01-26T19:00:00.000+01:00"
                },
                {
                  "total": 1.6779,
                  "energy": 1.3343,
                  "tax": 0.3436,
                  "startsAt": "2022-01-26T20:00:00.000+01:00"
                },
                {
                  "total": 1.681,
                  "energy": 1.3368,
                  "tax": 0.3442,
                  "startsAt": "2022-01-26T21:00:00.000+01:00"
                },
                {
                  "total": 1.6587,
                  "energy": 1.3189,
                  "tax": 0.3398,
                  "startsAt": "2022-01-26T22:00:00.000+01:00"
                },
                {
                  "total": 1.6163,
                  "energy": 1.285,
                  "tax": 0.3313,
                  "startsAt": "2022-01-26T23:00:00.000+01:00"
                }
              ],
              "tomorrow": []
            }
          }
        }
      ]
    }
  }
}

Obiges ist der Misserfolg, siehe :  "tomorrow": []

Wenn all gut geht, wird 'tomorrow' genauso gefuellt wie 'today'

Das vollstaendige Device-Listing sieht so aus :

Internals:
   BUSY       0
   DEF        https://api.tibber.com/v1-beta/gql 0
   FUUID      5f21e640-f33f-775d-c28f-fd78fa636d9701dc
   Interval   0
   MainURL    https://api.tibber.com/v1-beta/gql
   ModuleVersion 4.1.10 - 6.7.2021
   NAME       TibberStrompreis
   NOTIFYDEV  global
   NR         215
   NTFY_ORDER 50-TibberStrompreis
   STATE      ???
   TYPE       HTTPMOD
   value     
   HttpUtils:
     NAME       
     addr       https://api.tibber.com:443
     auth       0
     code       200
     compress   1
     conn       
     data       {"query": "{viewer {homes {currentSubscription {priceInfo {tomorrow {total startsAt }}}}}}" }
     displayurl https://api.tibber.com/v1-beta/gql
     header     Authorization: Bearer xxxxxxx
Content-Type: application/json
     host       api.tibber.com
     httpheader HTTP/1.1 200 OK
Date: Tue, 25 Jan 2022 22:07:21 GMT
Content-Type: application/json; charset=utf-8
Connection: close
X-Powered-By: Express
Access-Control-Allow-Origin: *
ETag: xxxxxxxx
Vary: Accept-Encoding
Content-Encoding: gzip
     httpversion 1.0
     hu_blocking 0
     hu_filecount 1
     hu_port    443
     hu_portSfx
     ignoreredirects 1
     loglevel   4
     path       /v1-beta/gql
     protocol   https
     redirects  0
     timeout    2
     url        https://api.tibber.com/v1-beta/gql
     sslargs:
   OLDREADINGS:
   QUEUE:
   READINGS:
   REQUEST:
     context    get
     data       {"query": "{viewer {homes {currentSubscription {priceInfo {tomorrow {total startsAt }}}}}}" }
     header     Authorization: Bearer xxxxxxx
Content-Type: application/json
     ignoreredirects 0
     num        01
     retryCount 0
     type       get01
     url        https://api.tibber.com/v1-beta/gql
     value     
   defptr:
     readingBase:
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_total get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_startsAt get
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_total get
     readingNum:
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_total 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_startsAt 01
       data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_total 01
     readingOutdated:
     requestReadings:
       get01:
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_total get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_startsAt get 01
         data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_total get 01
Attributes:
   extractAllJSON 1
   get01Data  {"query": "{viewer {homes {currentSubscription {priceInfo {tomorrow {total startsAt }}}}}}" }
   get01Name  Strompreis
   getHeader1 Authorization: Bearer f019c668342f468335fabd1db52dad0c0c8e0488fda4b89bc099dbf82b3284f6
   getHeader2 Content-Type: application/json
   room       Zentrale
   set01Method POST
   userReadings TibberStrompreisStunde01 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_01_total","20")},TibberStrompreisStunde02 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_02_total","20")},TibberStrompreisStunde03 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_03_total","20")},TibberStrompreisStunde04 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_04_total","20")},TibberStrompreisStunde05 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_05_total","20")},TibberStrompreisStunde06 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_06_total","20")},TibberStrompreisStunde07 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_07_total","20")},TibberStrompreisStunde08 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_08_total","20")},TibberStrompreisStunde09 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_09_total","20")},TibberStrompreisStunde10 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_10_total","20")},TibberStrompreisStunde11 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_11_total","20")},TibberStrompreisStunde12 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_12_total","20")},TibberStrompreisStunde13 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_13_total","20")},TibberStrompreisStunde14 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_14_total","20")},TibberStrompreisStunde15 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_15_total","20")},TibberStrompreisStunde16 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_16_total","20")},TibberStrompreisStunde17 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_17_total","20")},TibberStrompreisStunde18 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_18_total","20")},TibberStrompreisStunde19 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_19_total","20")},TibberStrompreisStunde20 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_20_total","20")},TibberStrompreisStunde21 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_21_total","20")},TibberStrompreisStunde22 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_22_total","20")},TibberStrompreisStunde23 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_23_total","20")},TibberStrompreisStunde24 {ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_startsAt","10") ." ". ReadingsVal("TibberStrompreis","data_viewer_homes_01_currentSubscription_priceInfo_tomorrow_24_total","20")}
   verbose    4


Fuer mich sieht es so aus, dass die userreadings bei jeder Ausfuehrung des 'get' gesetzt werden, egal, ober das 'get' Ergebnisse bringt oder nicht.
So wie meine userreadings formuliert sind, bekomme ich ja sogar etwas, wenn gar keine Readings existieren.

Fuer meine Anwendung ist es sehr kontraproduktiv, wenn
1. Die alten Readings, die ja bei Misserfolg des 'get' nicht ueberschrieben werden, nochmals verwendet werden.
2. Noch nicht existierende Userreadings bei Misserfolg des 'get' angelegt werden.

1. kann ich durch Loeschen der Readings nach Verwendung verhindern.
2. Fuer 2. faellt mir noch nichts ein.

Am liebsten wuerde ich das 'get' unterdruecken, solange fuer 'tomorrow' noch keine Daten vorliegen.
« Letzte Änderung: 26 Januar 2022, 10:52:27 von Wolfgang Hochweller »

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 25340
Antw:HTTPMOD userreadings
« Antwort #3 am: 26 Januar 2022, 10:51:02 »
Zitat
Kann bei letzterem die Ausfuehrung der userreadings unterdruecken, ohne bei jedem einzelnen Reading zu checken, ob die Ausfuehrung ueberhaupt Sinn macht  ?
userreadings werden nach Aktualisierung eines beliebigen Readings des gleichen Geraetes neu berechnet, es sei denn, der Benutzer hat (hinter dem userreading Namen) einen Filter spezifiziert.
Vermutlich kann das Problem durch Setzen solch einer Filter geloest werden.

Offline betateilchen

  • Developer
  • Hero Member
  • ****
  • Beiträge: 17958
  • Stoppt den Unicode-Irrsinn!
Antw:HTTPMOD userreadings
« Antwort #4 am: 26 Januar 2022, 10:53:53 »
Fuer mich sieht es so aus, dass die userreadings bei jeder Ausfuehrung des 'get' gesetzt werden, egal, ober das 'get' Ergebnisse bringt oder nicht.
So wie meine userreadings formuliert sind, bekomme ich ja sogar etwas, wenn gar keine Readings existieren.

Das Verhalten ist doch genau das, was Du im Attribut angegeben hast?
Die Verarbeitung der userReadings erfolgt bei jedem event, der für das device auftritt, da Du keinerlei trigger definiert hast, der dieses Verhalten einschränken würde.

Vielleicht hilft es Dir schon, die Beschreibung zum Thema userReading nochmal zu lesen?

(Außerdem werde ich nie verstehen, warum Anwender sich das Leben durch HTTPMOD so schwer machen, wenn die Daten in JSON vorliegen)
-----------------------
Unaufgeforderte Anfragen per email werden von mir nicht beantwortet. Dafür ist das Forum da.
-----------------------
Lesen gefährdet die Unwissenheit!

Offline Wolfgang Hochweller

  • Sr. Member
  • ****
  • Beiträge: 658
Antw:HTTPMOD userreadings
« Antwort #5 am: 26 Januar 2022, 11:33:14 »
Letzteres war wenig hilfreich - ich gehe immer davon aus, das FHEM genau das tut, was ich angegeben habe .....

Das ist allerdings schon JSON, aber egal.


Das mit dem Filter geht schon eher, mit Einschraenkungen :

Ich kann damit das Fuellen des Readings verhindern, aber offenbar nicht das Reading selbst; das wird angelegt, bleibt aber leer.
Muss mich also um das Triggern kuemmern.

« Letzte Änderung: 26 Januar 2022, 12:34:50 von Wolfgang Hochweller »