Example #1
0
def _setup_round(username, password, config, add_devices):
    """Setup rounding function."""
    from evohomeclient import EvohomeClient

    try:
        away_temp = float(config.get(CONF_AWAY_TEMP, DEFAULT_AWAY_TEMP))
    except ValueError:
        _LOGGER.error("value entered for item %s should convert to a number",
                      CONF_AWAY_TEMP)
        return False

    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_devices([RoundThermostat(evo_api,
                                         zone['id'],
                                         i == 0,
                                         away_temp)])
    except socket.error:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service"
        )
        return False
    return True
Example #2
0
def _setup_round(username, password, config, add_devices):
    """Setup rounding function."""
    from evohomeclient import EvohomeClient

    try:
        away_temp = float(config.get(CONF_AWAY_TEMP, DEFAULT_AWAY_TEMP))
    except ValueError:
        _LOGGER.error("value entered for item %s should convert to a number",
                      CONF_AWAY_TEMP)
        return False

    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_devices([RoundThermostat(evo_api,
                                         zone['id'],
                                         i == 0,
                                         away_temp)])
    except socket.error:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service"
        )
        return False
    return True
Example #3
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the honeywel thermostat. """
    from evohomeclient import EvohomeClient

    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    try:
        away_temp = float(config.get(CONF_AWAY_TEMP, 16))
    except ValueError:
        _LOGGER.error("value entered for item %s should convert to a number",
                      CONF_AWAY_TEMP)
        return False
    if username is None or password is None:
        _LOGGER.error("Missing required configuration items %s or %s",
                      CONF_USERNAME, CONF_PASSWORD)
        return False

    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_devices([RoundThermostat(evo_api,
                                         zone['id'],
                                         i == 0,
                                         away_temp)])
    except socket.error:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service"
        )
        return False
Example #4
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the honeywel thermostat. """
    from evohomeclient import EvohomeClient

    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    try:
        away_temp = float(config.get(CONF_AWAY_TEMP, 16))
    except ValueError:
        _LOGGER.error("value entered for item %s should convert to a number",
                      CONF_AWAY_TEMP)
        return False
    if username is None or password is None:
        _LOGGER.error("Missing required configuration items %s or %s",
                      CONF_USERNAME, CONF_PASSWORD)
        return False

    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_devices(
                [RoundThermostat(evo_api, zone['id'], i == 0, away_temp)])
    except socket.error:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service")
        return False
Example #5
0
    def getCurrentValues(self):
        ec = EvohomeClient(self.login, self.password)
        temperatures = []
        weather = None
        for device in ec.temperatures():
            temperatures.append({
                'name': device['name'],
                'temperature': device['temp']
            })
        if self.extemp == "True":
            import pyowm
            owm = pyowm.OWM(self.apikey)
            observation = owm.weather_at_place(self.city)
            w = observation.get_weather()
            weather = {}
            weather['temperature'] = w.get_temperature('celsius')['temp']
            weather['min'] = w.get_temperature('celsius')['temp_min']
            weather['max'] = w.get_temperature('celsius')['temp_max']
            weather['rain'] = w.get_rain()
            weather['cloud'] = w.get_clouds()
            weather['wind'] = w.get_wind()
            weather['humidity'] = w.get_humidity()
            weather['pressure'] = w.get_pressure()
            weather['status'] = w.get_detailed_status()
            weather[
                'icon'] = 'https://openweathermap.org/img/w/' + w.get_weather_icon_name(
                ) + '.png'
            sunrise = datetime.datetime.fromtimestamp(
                w.get_sunrise_time()).strftime("%Hh%M")
            weather['sunrise'] = sunrise
            sunset = datetime.datetime.fromtimestamp(
                w.get_sunset_time()).strftime("%Hh%M")
            weather['sunset'] = sunset

        return (temperatures, weather)
Example #6
0
def get_honeywell_temps():
    client = EvohomeClient(HONEYWELL_USERNAME, HONEYWELL_PASSWORD)
    temperature = list(client.temperatures(force_refresh=True))[0]
    now = datetime.now()
    data = pd.DataFrame(temperature, index=[0])
    data = data.rename(columns={
        'temp': 'Temperature',
        'name': 'Name',
        'setpoint': 'Setpoint'
    })
    data['Datetime'] = now
    data['Type'] = 'Honeywell'
    return data[['Datetime', 'Type', 'Name', 'Temperature', 'Setpoint']]
Example #7
0
def _setup_round(username, password, config, add_devices):
    """Setup rounding function."""
    from evohomeclient import EvohomeClient

    away_temp = config.get(CONF_AWAY_TEMPERATURE)
    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_devices([RoundThermostat(evo_api, zone["id"], i == 0, away_temp)])
    except socket.error:
        _LOGGER.error("Connection error logging into the honeywell evohome web service")
        return False
    return True
Example #8
0
def _setup_round(username, password, config, add_devices):
    """Setup rounding function."""
    from evohomeclient import EvohomeClient

    away_temp = config.get(CONF_AWAY_TEMPERATURE)
    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_devices(
                [RoundThermostat(evo_api, zone['id'], i == 0, away_temp)])
    except socket.error:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service")
        return False
    return True
Example #9
0
def _setup_round(username, password, config, add_entities):
    """Set up the rounding function."""
    from evohomeclient import EvohomeClient

    away_temp = config.get(CONF_AWAY_TEMPERATURE)
    evo_api = EvohomeClient(username, password)

    try:
        zones = evo_api.temperatures(force_refresh=True)
        for i, zone in enumerate(zones):
            add_entities(
                [RoundThermostat(evo_api, zone['id'], i == 0, away_temp)],
                True
            )
    except requests.exceptions.RequestException as err:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service, "
            "hint: %s", err)
        return False
    return True
Example #10
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

client = EvohomeClient('email', 'password')
client.cancel_temp_override('Kamer')
client.set_status_normal()

for device in client.temperatures():
	requests.put('http://localhost:8080/rest/items/CV_Temperature/state', data=str(device['temp']))
	requests.put('http://localhost:8080/rest/items/CV_Setpoint/state', data=str(device['setpoint']))
Example #11
0
#!/usr/bin/python
import sys
#from influxdb import InfluxDBClient
from evohomeclient import EvohomeClient

#client = InfluxDBClient('192.168.1.204',8086,'root','root','telegraf')

evoclient = EvohomeClient('*****@*****.**', 'Val1n0rho')
print(evoclient.temperatures())
sys.exit()
jsonbody = []
#time = int(time.time())
for device in evoclient.temperatures():

    if device["thermostat"] == "DOMESTIC_HOT_WATER":
        m = {
            "measurement": "temperature",
            "tags": {
                "room": "Hot water",
                "sensor": "1"
            },
            "fields": {
                "value": device["temp"]
            },
        }
        jsonbody.append(m)
    else:
        m = {
            "measurement": "temperature",
            "tags": {
                "room": device["name"],
Example #12
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

client = EvohomeClient('*****@*****.**', 'somePassword')
client.cancel_temp_override('Room')

for device in client.temperatures():
    requests.post('http://localhost:8086/rest/items/CV_Temperature',
                  data=str(device['temp']))
Example #13
0
from evohomeclient import EvohomeClient
import datetime

client = EvohomeClient('xxx', 'xxxx')

for device in client.temperatures(force_refresh=True):
    print(datetime.datetime.now().isoformat() + "," + device["name"] + "," +
          str(device["setpoint"]) + "," + str(device["temp"]))
Example #14
0
from evohomeclient import EvohomeClient

client = EvohomeClient("*****@*****.**", "s4v6sI9eutuF")

print client.temperatures()