Giter Site home page Giter Site logo

lwsrbrts / poshive Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 93 KB

A PowerShell class (supporting Windows PowerShell 5.1 or PowerShell Core 6.0+) to control your British Gas Hive system including the heating, hot water, multi zone, active plugs, sensors and colour bulbs.

PowerShell 96.35% HTML 3.65%

poshive's People

Contributors

lwsrbrts avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

poshive's Issues

Sensors support

Adding sensors support would be somewhat pointless for two reasons.

  1. They monitor and have triggers and in order for the class to see those triggers, we'd need to be bothering the API regularly for updates to the state of the sensor.
  2. There's no method of intercepting a trigger since the trigger likely goes back to the API that is then responsible for performing whatever action is configured.

I'll continue thinking about how it could work but I don't want to write something that ends up being a massive drain on the API causing the entire class to get banned.

SetHeatingMode method doesn't work

Unable to determine the proper API URL to Put to, or there's a problem with the JSON being sent. The JSON is so simple, it shouldn't be a problem.

{"control": "OFF"}

I believe the deviceId value of the Receiver forms part of the URL but I cannot confirm as I've not been able to get the request to work, resulting in either 400 bad request or INVALID parameter, parameter: control responses.

-Uri "$($this.ApiUrl)/users/$($this.Username)/widgets/climate/[Thermostat deviceID]/control"

Help!

Credentials are plain text

A pretty obvious one but credentials are currently stored in the class as plain text. This should of course ideally be a credential object instead to keep it secure.

Need to consider the best method of implementing this or if we're introducing security where none is really needed.

Boost and manual defaults

There *_are *_defaults set for boosting temperature and manual temperature. I'll have to try these out in manual testing to see when they're used.

heating: {
    boost: {
        temperature: 22,
        duration: 60,
        times: [.5, 1, 2, 3, 4, 5, 6],
        timesDisplayMap: ["30 mins", "01 hour", "02 hours", "03 hours", "04 hours", "05 hours", "06 hours"]
    },
    precision: .5,
    minimumTemperature: 5,
    maximumTemperature: 32,
    manualTemperatureDefault: 20,

History of boiler on/off

Hi,

This is a great project, glad BG have left the API all relatively open. I was wondering if you'd come across a way to retrieve history of whether or not the boiler is on/off? On the web page you can see whether or not the boiler has reached its temp (image) or is heating, this I think is controlled by working: true or working: false in the request to https://beekeeper-uk.hivehome.com/1.0/products?after=.

However, it only seems to show what the boiler is currently doing...

Thanks for sharing such clear code!

Active Lights support

It would likely be worthwhile implementing support for Active Lights but I have an personal conflict with adding support in that I personally own a lot of Philips Hue devices (see my PoSHue class!), so buying a Hive Active Light is all but pointless other than to add support for them in PoSHive.

Honestly, I don't think there's enough people using the class for me to be throwing money at devices I wouldn't buy.

If you'd like me to add support, feel free to gift me a bulb on Amazon which I can add support for and then, if you want, I can send it on to you.

Help & Guidance

Hi,
I've been (hobby) working on some macOS/iOS swift code to interface with the Hive API but was stymied by the move to Beekeeper until I found your work. Thank you so much for your clear code.
Beekeeper actually seems easier to deal with than the old API but I wanted to ask : Is there any Beekeeper documentation available and if so where, or did you have to work all the calls out by trial and error?
Thanks again,
MattJohns

Timeout handling

If after twenty minutes, there has been no interaction, the API (their side) deletes the session and the session in PowerShell is orphaned.

If possible, have the code implement a re-login in the event of a not-authorised response and or a timer variable in the class that once a successful method call has taken place, starts counting (Sets Now() then at the next classmethod call, calculates the time difference between first now() and this now() and if it exceeds twenty minutes, re-logs in/notifies the user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.