Skip to content

Commit

Permalink
Merge pull request #56 from fredericvl/import_changes
Browse files Browse the repository at this point in the history
Import changes from my fork
  • Loading branch information
vincentwolsink authored May 25, 2023
2 parents a13664c + c165afb commit 38496c2
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 48 deletions.
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,42 @@ for device in connection.devices:

Below you can find a table with the app names of the different stove brands and their corresponding customer code and API URL.

| App name or Brand | Customer Code | API URL | Separate login URL (only needed if specified) |
| ----------------------------- | ------------- | -------------------------------------- | ----------------------------------------------------- |
| EvaCalòr - PuntoFuoco | 635987 | https://evastampaggi.agua-iot.com | |
| Elfire Wifi | 402762 | https://elfire.agua-iot.com | |
| Karmek Wifi | 403873 | https://karmekone.agua-iot.com | |
| Easy Connect | 354924 | https://remote.mcz.it | |
| Easy Connect Plus | 746318 | https://remote.mcz.it | |
| Easy Connect Poêle | 354925 | https://remote.mcz.it | |
| Lorflam Home | 121567 | https://lorflam.agua-iot.com | |
| LMX Remote Control | 352678 | https://laminox.agua-iot.com | |
| Boreal Home | 173118 | https://boreal.agua-iot.com | |
| Bronpi Home | 164873 | https://bronpi.agua-iot.com | |
| EOSS WIFI | 326495 | https://solartecnik.agua-iot.com | |
| LAMINOXREM REMOTE CONTROL 2.0 | 352678 | https://laminox.agua-iot.com | |
| Jolly Mec Wi Fi | 732584 | https://jollymec.agua-iot.com | |
| Globe-fire | 634876 | https://globefire.agua-iot.com | |
| TS Smart | 046629 | https://timsistem.agua-iot.com | |
| Stufe a pellet Italia | 015142 | https://stufepelletitalia.agua-iot.com | |
| My Corisit | 101427 | https://mycorisit.agua-iot.com | |
| Fonte Flamme contrôle 1 | 848324 | https://fonteflame.agua-iot.com | |
| Klover Home | 143789 | https://klover.agua-iot.com | |
| Nordic Fire 2.0 | 132678 | https://nordicfire.agua-iot.com | |
| GO HEAT | 859435 | https://amg.agua-iot.com | |
| Wi-Phire | 521228 | https://lineavz.agua-iot.com | |
| Thermoflux | 391278 | https://thermoflux.agua-iot.com | |
| Darwin Evolution | 475219 | https://cola.agua-iot.com | |
| Moretti design | 624813 | https://moretti.agua-iot.com | |
| Fontana Forni | 505912 | https://fontanaforni.agua-iot.com | |
| MyPiazzetta (MySuperior?) | 458632 | https://piazzetta.agua-iot.com | https://piazzetta.iot.web2app.it/api/bridge/endpoint/ |
| Alfaplam | 862148 | https://alfaplam.agua-iot.com | |
| Nina | 999999 | https://micronova.agua-iot.com | |
| Galletti | ? | ? | |
| App name or Brand | Customer Code | API URL | API Version | Separate login URL (only needed if specified) |
| ----------------------------- | ------------- | -------------------------------------- | ----------- | ------------------------------------------------------- |
| Alfaplam | 862148 | https://alfaplam.agua-iot.com | 1.4.4.0 | |
| Boreal Home | 173118 | https://boreal.agua-iot.com | 1.4.1 | |
| Bronpi Home | 164873 | https://bronpi.agua-iot.com | 1.4.1 | |
| Darwin Evolution | 475219 | https://cola.agua-iot.com | 2.1.0.0 | |
| Easy Connect | 354924 | https://remote.mcz.it | 1.5.0.0 | |
| Easy Connect Plus | 746318 | https://remote.mcz.it | 1.5.0.0 | |
| Easy Connect Poêle | 354925 | https://remote.mcz.it | 1.5.0.0 | |
| Elfire Wifi | 402762 | https://elfire.agua-iot.com | 1.4.4.0 | |
| EOSS WIFI | 326495 | https://solartecnik.agua-iot.com | 1.4.4.0 | |
| EvaCalòr - PuntoFuoco | 635987 | https://evastampaggi.agua-iot.com | 1.4.4.0 | |
| Fontana Forni | 505912 | https://fontanaforni.agua-iot.com | 1.4.4.0 | |
| Fonte Flamme contrôle 1 | 848324 | https://fonteflame.agua-iot.com | 1.4.4.0 | |
| Galletti | ? | ? | ? | |
| Globe-fire | 634876 | https://globefire.agua-iot.com | 1.4.4.0 | |
| GO HEAT | 859435 | https://amg.agua-iot.com | 1.4.4.0 | |
| Jolly Mec Wi Fi | 732584 | https://jollymec.agua-iot.com | 2.1.0.0 | |
| Karmek Wifi | 403873 | https://karmekone.agua-iot.com | 1.4.4.0 | |
| Klover Home | 143789 | https://klover.agua-iot.com | 2.1.0.0 | |
| LAMINOXREM REMOTE CONTROL 2.0 | 352678 | https://laminox.agua-iot.com | 1.4.4.0 | |
| LMX Remote Control | 352678 | https://laminox.agua-iot.com | 1.4.4.0 | |
| Lorflam Home | 121567 | https://lorflam.agua-iot.com | 2.1.0.0 | |
| Moretti design | 624813 | https://moretti.agua-iot.com | 1.4.4.0 | |
| My Corisit | 101427 | https://mycorisit.agua-iot.com | 1.4.4.0 | |
| MyPiazzetta (MySuperior?) | 458632 | https://piazzetta.agua-iot.com | 1.5.0.0 | https://piazzetta-iot.app2cloud.it/api/bridge/endpoint/ |
| Nina | 999999 | https://micronova.agua-iot.com | 1.4.4.0 | |
| Nobis-Fi | 700700 | https://nobis.agua-iot.com | 2.1.0.0 | |
| Nordic Fire 2.0 | 132678 | https://nordicfire.agua-iot.com | 2.1.0.0 | |
| Ravelli Wi-Fi | 953712 | https://aico.agua-iot.com | 1.4.1 | |
| Stufe a pellet Italia | 015142 | https://stufepelletitalia.agua-iot.com | 1.4.4.0 | |
| Thermoflux | 391278 | https://thermoflux.agua-iot.com | 1.4.4.0 | |
| TS Smart | 046629 | https://timsistem.agua-iot.com | 1.4.4.0 | |
| Wi-Phire | 521228 | https://lineavz.agua-iot.com | 1.4.4.0 | |

Version info and API documentation could be found at API swagger URL for each brand. Swager is accessible at /api-docs (example: https://nobis.agua-iot.com/api-docs).
If you happen to know any extra or missing customer codes and API URL's, please feel free to open a pull request and add them to the table above.

## Other examples
Expand Down
5 changes: 4 additions & 1 deletion examples/home-assistant/custom_components/aguaiot/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
CONF_BRAND_ID,
CONF_CUSTOMER_CODE,
CONF_LOGIN_API_URL,
CONF_API_LOGIN_APPLICATION_VERSION,
CONF_UUID,
DOMAIN,
AGUA_STATUS_CLEANING,
Expand Down Expand Up @@ -67,9 +68,11 @@ async def async_setup_entry(hass, entry, async_add_entities):
password = entry.data[CONF_PASSWORD]
gen_uuid = entry.data[CONF_UUID]
login_api_url = entry.data.get(CONF_LOGIN_API_URL) if entry.data.get(CONF_LOGIN_API_URL) != "" else None
api_login_application_version= entry.data.get(CONF_API_LOGIN_APPLICATION_VERSION) if entry.data.get(CONF_API_LOGIN_APPLICATION_VERSION) != "" else "1.6.0"

try:
agua = await hass.async_add_executor_job(agua_iot, api_url, customer_code, email, password, gen_uuid, login_api_url, brand_id)
debug = False
agua = await hass.async_add_executor_job(agua_iot, api_url, customer_code, email, password, gen_uuid, login_api_url, brand_id, debug, api_login_application_version)
device = agua.devices[0]
except UnauthorizedError:
_LOGGER.error("Wrong credentials for Agua IOT")
Expand Down
13 changes: 10 additions & 3 deletions examples/home-assistant/custom_components/aguaiot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .const import (
CONF_API_URL,
CONF_BRAND_ID,
CONF_API_LOGIN_APPLICATION_VERSION,
CONF_CUSTOMER_CODE,
CONF_LOGIN_API_URL,
CONF_UUID,
Expand Down Expand Up @@ -58,13 +59,15 @@ async def async_step_user(self, user_input=None):
customer_code = user_input[CONF_CUSTOMER_CODE]
brand_id = user_input[CONF_BRAND_ID]
login_api_url = user_input.get(CONF_LOGIN_API_URL) if user_input.get(CONF_LOGIN_API_URL) != "" else None
api_login_application_version = user_input.get(CONF_API_LOGIN_APPLICATION_VERSION)

if self._entry_in_configuration_exists(user_input):
return self.async_abort(reason="device_already_configured")

try:
gen_uuid = str(uuid.uuid1())
await self.hass.async_add_executor_job(agua_iot, api_url, customer_code, email, password, gen_uuid, login_api_url, brand_id)
debug=False
await self.hass.async_add_executor_job(agua_iot, api_url, customer_code, email, password, gen_uuid, login_api_url, brand_id, debug, api_login_application_version)
except UnauthorizedError:
errors["base"] = "unauthorized"
except ConnectionError:
Expand All @@ -82,7 +85,8 @@ async def async_step_user(self, user_input=None):
CONF_API_URL: api_url,
CONF_CUSTOMER_CODE: customer_code,
CONF_BRAND_ID: brand_id,
CONF_LOGIN_API_URL: login_api_url
CONF_LOGIN_API_URL: login_api_url,
CONF_API_LOGIN_APPLICATION_VERSION: api_login_application_version
},
)
else:
Expand All @@ -100,7 +104,10 @@ async def async_step_user(self, user_input=None):
default=user_input.get(CONF_CUSTOMER_CODE))
] = str
data_schema[
vol.Required(CONF_BRAND_ID, default=1)
vol.Required(CONF_BRAND_ID, default="1")
] = str
data_schema[
vol.Required(CONF_API_LOGIN_APPLICATION_VERSION, default="1.6.0")
] = str
data_schema[
vol.Required(CONF_EMAIL, default=user_input.get(CONF_EMAIL))
Expand Down
1 change: 1 addition & 0 deletions examples/home-assistant/custom_components/aguaiot/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

CONF_API_URL = "api_url"
CONF_BRAND_ID = "brand_id"
CONF_API_LOGIN_APPLICATION_VERSION = "api_login_application_version"
CONF_CUSTOMER_CODE = "customer_code"
CONF_LOGIN_API_URL = "login_api_url"
CONF_UUID = "uuid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"domain": "aguaiot",
"name": "Micronova Agua IOT",
"documentation": "https://github.com/fredericvl/py-agua-iot/tree/master/examples/home-assistant",
"version": "0.0.7",
"requirements": ["py-agua-iot==0.0.7"],
"version": "0.0.8",
"requirements": ["py-agua-iot==0.0.8"],
"dependencies": [],
"codeowners": ["@fredericvl"],
"config_flow": true
Expand Down
18 changes: 13 additions & 5 deletions py_agua_iot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ class agua_iot(object):

statusTranslated = {
0: "OFF", 1: "START", 2: "LOAD PELLETS", 3: "FLAME LIGHT", 4: "ON",
5: "CLEANING FIRE-POT", 6: "CLEANING FINAL", 7: "ECO-STOP", 8: "?",
9: "NO PELLETS", 10: "?", 11: "?", 12: "?", 13: "?", 14: "?", 15: "?",
5: "CLEANING FIRE-POT", 6: "CLEANING FINAL", 7: "ECO-STOP", 8: "PELLETS DEPLETED",
9: "IGNITION FAILED", 10: "?", 11: "?", 12: "?", 13: "?", 14: "?", 15: "?",
16: "?", 17: "?", 18: "?", 19: "?"
}

def __init__(self, api_url, customer_code, email, password, unique_id, login_api_url=None, brand_id=1, debug=False):
def __init__(self, api_url, customer_code, email, password, unique_id, login_api_url=None, brand_id=1, debug=False, api_login_application_version=API_LOGIN_APPLICATION_VERSION):
"""agua_iot object constructor"""
if debug is True:
_LOGGER.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -82,6 +82,7 @@ def __init__(self, api_url, customer_code, email, password, unique_id, login_api
self.unique_id = unique_id
self.brand_id = str(brand_id)
self.login_api_url = login_api_url
self.api_login_application_version = api_login_application_version

self.token = None
self.token_expires = None
Expand Down Expand Up @@ -159,7 +160,7 @@ def login(self):

if self.login_api_url is not None:
extra_login_headers = {
'applicationversion': API_LOGIN_APPLICATION_VERSION,
'applicationversion': self.api_login_application_version,
'url': API_PATH_LOGIN.lstrip("/")
}
headers.update(extra_login_headers)
Expand Down Expand Up @@ -580,7 +581,14 @@ def max_temp(self):

@property
def air_temperature(self):
return float(self.__get_information_item('temp_air_get'))
try:
return float(self.__get_information_item('temp_air_get'))
except Exception as err:
return float(self.__get_information_item('temp_air2_get'))

@property
def air2_temperature(self):
return float(self.__get_information_item('temp_air2_get'))

@property
def set_air_temperature(self):
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PyJWT==2.1.0
requests==2.25.1
PyJWT>=2.1.0
requests>=2.25.1
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="py-agua-iot",
version="0.0.8",
version="0.0.11",
author="Frederic Van Linthoudt",
author_email="[email protected]",
description="py-agua-iot provides controlling heating devices connected via the IOT Agua platform of Micronova",
Expand All @@ -19,7 +19,7 @@
"Operating System :: OS Independent",
],
install_requires=[
"PyJWT==2.1.0",
"requests==2.25.1",
"PyJWT>=2.1.0",
"requests>=2.25.1",
],
)

0 comments on commit 38496c2

Please sign in to comment.