예제 #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
예제 #2
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)
예제 #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
예제 #4
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
예제 #5
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
예제 #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']]
예제 #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
예제 #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
예제 #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
예제 #10
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)

    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:
        add_devices([RoundThermostat(evo_api)])
    except socket.error:
        _LOGGER.error(
            "Connection error logging into the honeywell evohome web service")
        return False
예제 #11
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']))
예제 #12
0
파일: main.py 프로젝트: j0hns/evohome
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"]))
예제 #13
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']))
예제 #14
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']))
예제 #15
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

setpoint = requests.get('http://*****:*****@e.mail', 'somePassword')
client.set_temperature('Room', setpoint.text)
print(setpoint.text)

for device in client.temperatures():
	requests.post('http://localhost:8086/rest/items/CV_Temperature', data=str(device['temp']))
예제 #16
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

client = EvohomeClient('email', 'password')
client.set_status_away()

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']))
예제 #17
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

client = EvohomeClient("email", "password")
client.cancel_temp_override("Kamer")

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"]))
예제 #18
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"],
예제 #19
0
파일: test.py 프로젝트: rjsachse/jarvis
from evohomeclient import EvohomeClient

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

print client.temperatures()
예제 #20
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

client = EvohomeClient('email', 'password')
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']))
예제 #21
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']))
예제 #22
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

client = EvohomeClient('*****@*****.**', 'somePassword')
client.set_status_away()

for device in client.temperatures():
    requests.post('http://localhost:8086/rest/items/CV_Temperature',
                  data=str(device['temp']))
예제 #23
0
#!/usr/bin/python
import sys
import requests
from evohomeclient import EvohomeClient

setpoint = requests.get('http://192.168.1.11:8080/rest/items/CV_Current/state')
client = EvohomeClient('email', 'password')
client.set_temperature('Kamer', setpoint.text)

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']))