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
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)
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
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
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']]
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
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
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
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
#!/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']))
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"]))
#!/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']))
#!/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']))
#!/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']))
#!/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"]))
#!/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"],
from evohomeclient import EvohomeClient client = EvohomeClient("*****@*****.**", "s4v6sI9eutuF") print client.temperatures()
#!/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']))
#!/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']))
#!/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']))