Giter Site home page Giter Site logo

haanna's Introduction

This repository is no longer used - @bouwew and @compatech now maintain Plugwise-Smile

Sometime (soon)[home-assistant/core#33691] after HA-core 0.109 this module will not be used by HA-core's plugwise component!

Haanna (HA Anna)

A Python API made for use in conjunction with the Home Assistant Anna component, but this API can also be used in other projects.

Installation

pip install haanna

Usage

from haanna import haanna

# Create the API
api = haanna.Haanna('smile', 'short_id', '192.168.1.60', 80, False)
#'False' must be changed to 'True' for a legacy Anna

# Fetch the direct objects
direct_objects = api.get_direct_objects()

# Fetch the domain objects
domain_objects = api.get_domain_objects()

# Set the temperature
temperature = api.set_temperature(domain_objects, 22.50)
print(temperature)

# Get the current room temperature
temperature = api.get_current_temperature(domain_objects)
print(temperature)

# Get the temperature setting of the selected schema
temperature = api.get_schedule_temperature
print(temperature)

# Get the outdoor temperature
temperature = api.get_outdoor_temperature(domain_objects)
print(temperature)

# Get the target temperature
temperature = api.get_target_temperature(domain_objects)
print(temperature)

# Get the thermostat temperature
temperature = api.get_thermostat_temperature(domain_objects)
print(temperature)

# Get the available presets
presets = api.get_presets(domain_objects)
print(presets)

# Get the current active preset, can also be 'none'
current_preset = api.get_current_preset(domain_objects)
print(current_preset)

# Set a preset, e.g. 'away'
preset = api.set_preset(domain_objects, 'away')
print(preset)

# Get operation mode (true = active schedule, false = no active schedules)
# it 'walks' all schedules and sends true if one is active
mode = api.get_mode(domain_objects)
print(mode)

# Get boiler status (true = boiler is on, flame-icon on Anna display), when available
boiler = api.get_boiler_status(direct_objects)
print(boiler)

# Get heating status (true = heating is on, flame-icon on Anna display), when available
heating = api.get_heating_status(direct_objects)
print(heating)

# Get cooling status (true = cooling is on, fan-icon on Anna display), when available
cooling = api.get_cooling_status(direct_objects)
print(cooling)

# Get domestic hot water status (true = water is being heated, tap-icon on Anna display), when available
hot_water = api.get_domestic_hot_water_status(direct_objects)
print(hot_water)

# Get the illuminance value
illuminance = api.get_illuminance(domain_objects)
print(illuminance)

# Get the current boiler temperature
boiler_temp = api.get_boiler_temperature(domain_objects)
print(boiler_temp)

# Get the current boiler pressure
pressure = api.get_water_pressure(domain_objects)
print(pressure)

# Get schemas or schedules available on the device.
schemas = get_schema_names(domain_objects)
print(schemas)

# Sends a set request to the schema with the given name
set_schema_state(domain_objects, schema=None, state)

# Get active schema or determine last modified.
schema = get_active_schema_name(domain_objects)
print(schemas)

# Gets the mode the thermostat is in (active schedule true or false)
state = get_schema_state(domain_objects)
print(state)

Please note: when the requested info/data is not available on your Anna, the function will return None. When you encouter an error, please report this via an Issue on this github or on the Home Assistant github.

To do:

  • Optimize fetching of domain objects
  • Add support for custom port mapping

haanna's People

Contributors

bouwew avatar compatech avatar laetificat avatar

Stargazers

Maarten Bremer avatar  avatar Maarten van Gompel avatar Erik-jan Riemers avatar  avatar

Watchers

Maarten van Gompel avatar James Cloos avatar  avatar  avatar Frank Hommers avatar

haanna's Issues

anna -> adam support?

Hi there fellow leidenaar :)

I bought some plugwise equipment and it works pretty nice. Then noticed there was no component for it :( then i saw your hanna component and i was 'hey this might work'.

Only to find out that adam is a bit different since it allows for more zones (uses toms for radiators, lisa's for thermostat screens and floors for floor heating)

Is there anyway we can incooperate this too? haadam or haaplugheat? Don't mind to show my face since your in the same city ๐Ÿ‘

HA interface not not showing the selected preset state

following a discussion on https://community.home-assistant.io/t/advice-how-to-load-sensor-info-from-plugwise-anna-thermostat-web-interface-xml/87801/132?u=mariusthvdb please let me create this issue for the HA interface not showing the selected preset state.

Not sure how to post more than in the dicsussion, but bottom line is the HA app can endup in a manual override situation (as described in the community post) while the thermostat in fact is in a automode (preset configuration), set in the App.

HA doesn't follow that change, and stays is manual override

Only way to have that reflected again in the HA interface then is 3 fold: click the flame (to yet again set to manual mode), click the calendar icon (to have it enter sleep ode in my setting) and then again click calendar, to finally arrive in the auto mode.....

If both HA and the Anna app command the thermostat in that situation, it is mixing signals which can't be good...

let me know if you need more to investigate/debug

I use the native integration in HA 102.2

update
maybe it is a bug in the Anna app..... selecting a preset after a manual override on the app,doesnt show on the Anna thermostat itself either. One needs to click 2 or 3 times before it is displayed.

seems only touching the top of the thermostat works as is supposed to?
please let me know if you see this too.

Please update PyPi asap (0.10.2 and latest (0.11.x at time of writing))

Hi @laetificat,

As requested earlier in the PRs (#13 & #14), but please update PyPi. I've merged the PRs now to keep things going, but we really do need you to update PyPi.

If you have less time available I'd suggest you add @bouwew as author and at least myself to PyPi to be able to update (sam username). Otherwise, just indicate and we'll unfortunately have to create another module on PyPi.

Kind regards,

Tom

Handle preset finding in XML better

Modify (and test!) if searching for "a rule that has a template_id tag containing zone_setpoint_and_state_based_on_preset and has active set to true" instead of what is currently implemented in haanna.py (lines 62/63):

            rule_id = self.get_rule_id_by_name(root,
                                               'Thermostat presets')

As reported in home-assistant/core#26520

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.