flopp999 / Tibber-Domoticz

Script to communicate with Tibber. Help me with a buy-me-a-coffee
https://www.buymeacoffee.com/flopp999
GNU General Public License v3.0
8 stars 4 forks source link

more than 1 house #22

Closed flopp999 closed 3 years ago

flopp999 commented 3 years ago

Great work!

sorry, change HomeID in plugin.py. I will add this ass a text field in the stable version

You can get the HomeID with:


{
  viewer {
    homes {
      id
    }
  }
}

So the user does not need to add it manually.

Btw, it is also important to close the websocket connection when Domoticz exits, since you can have max 3 open connections to Tibber.

Regards Daniel (author of the Tibber integration in Home Assistant)

More than one house I have a house and a cabin, both with power from Tibber. Would be nice to be able to input home ID or address in order to select the location of interest. As it is now, it apears that the first house in houses is selected

Sugestion: Allow for home ID as optional input

If no home ID is given:
    Find home ID of first house in houses
else:
    Find the house in houses with the given home ID
    Use the house found

Originally posted by @eirikman in https://github.com/flopp999/Tibber-Domoticz/issues/14#issuecomment-804809021

flopp999 commented 3 years ago

@eirikman

flopp999 commented 3 years ago

Please go to this address https://developer.tibber.com/explorer Login, and open API Explorer In the window where your write the "query" please put in this

{
  viewer {
    homes {
      id
    }
  }
}

do you get two IDs?

DO NOT POST THEM HERE

eirikman commented 3 years ago

Yes, I get two IDS:

{
  "data": {
    "viewer": {
      "homes": [
        {
          "id": "xxx"
        },
        {
          "id": "yyy"
        }
      ]
    }
  }
}
flopp999 commented 3 years ago

Great, then I know how I can do.

Do you think it is a good idea to add both houses to Domoticz?

eirikman commented 3 years ago

And it is possible to refer to a spesific house with replacing houses with house(id: "xxx") like this:

{
  viewer {
    home(id: "xxx") {
      currentSubscription {
        priceInfo {
          current {
            total
          }
        }
      }
    }
  }
}
eirikman commented 3 years ago

I think the best solution is to chose house, and then make one hardware entry for each house. I believe it is cleaner that way.

Godd job with this plugin by the way! Thanks for the effort.

flopp999 commented 3 years ago

And it is possible to refer to a spesific house with replacing houses with house(id: "xxx") like this:

{
  viewer {
    home(id: "xxx") {
      currentSubscription {
        priceInfo {
          current {
            total
          }
        }
      }
    }
  }
}

yes, this will work

flopp999 commented 3 years ago

Note: if two Hardware are used, they will use the same log file Create one log file for each house or have one hardware with all houses?

eirikman commented 3 years ago

From an endpoint users perspective I believe it is the cleanest and best way to have one hardware for each house, and live with more logfiles.

Houses can come, and houses can go. Easy to add or remove with one hardware for each house.

flopp999 commented 3 years ago

@eirikman do you use Domoticz forum, please contact me there if you use it. https://www.domoticz.com/forum/memberlist.php?mode=viewprofile&u=8270