fredericvl / py-agua-iot

py-agua-iot provides controlling heating devices connected via the IOT Agua platform of Micronova
Apache License 2.0
31 stars 16 forks source link

My registers map #5

Closed KarlB59 closed 3 years ago

KarlB59 commented 3 years ago

Hi @fredericvl,

This thread is not for bug or question, but only if you want complete your code. With your last version 0.0.6, the debug mod give a register map, and i can see more command, i think, if you want, you can add a little information useful for have more command on your code.

My evacalor is : i-dea-2-frontale website : https://jm-poeles.com/product/i-dea-2-frontale/

And the register map is :

{'alarms_get': {'reg_type': 'GET', 'offset': 93, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'calendar_day_set': {'reg_type': 'SET', 'offset': 33019, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 1, 'set_max': 31, 'mask': 65535},
 'calendar_day_week_set': {'reg_type': 'SET', 'offset': 33016, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 1, 'set_max': 7, 'mask': 65535},
 'calendar_month_set': {'reg_type': 'SET', 'offset': 33020, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 1, 'set_max': 12, 'mask': 65535},
 'calendar_year_set': {'reg_type': 'SET', 'offset': 33021, 'formula': '#+2000', 'formula_inverse': '#-2000', 'format_string': '{0}', 'set_min': 15, 'set_max': 50, 'mask': 65535},
 'canalization_1_enable': {'reg_type': 'ENABLE', 'offset': 32853, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 1},
 'canalization_1_set': {'reg_type': 'SET', 'offset': 32974, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 2, 'mask': 65535},
 'canalization_1_temp_air_enable': {'reg_type': 'ENABLE', 'offset': 32853, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'canalization_1_temp_air_set': {'reg_type': 'SET', 'offset': 32973, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}°C', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'Canalization_1_vent_enable': {'reg_type': 'ENABLE', 'offset': 32853, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 65535, 'mask': 65535},
 'Canalization_1_vent_set': {'reg_type': 'SET', 'offset': 32975, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535, 'value_off': 0},
 'canalization_2_enable': {'reg_type': 'ENABLE', 'offset': 32853, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 1},
 'canalization_2_set': {'reg_type': 'SET', 'offset': 32977, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 2, 'mask': 65535},
 'canalization_2_temp_air_enable': {'reg_type': 'ENABLE', 'offset': 32853, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'canalization_2_temp_air_set': {'reg_type': 'SET', 'offset': 32979, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}°C', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'canalization_2_vent_enable': {'reg_type': 'ENABLE', 'offset': 32853, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 65535, 'mask': 65535},
 'canalization_2_vent_set': {'reg_type': 'SET', 'offset': 32978, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535, 'value_off': 0},
 'chrono_general_enable_set': {'reg_type': 'SET', 'offset': 32894, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_friday_set': {'reg_type': 'SET', 'offset': 32919, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_monday_set': {'reg_type': 'SET', 'offset': 32915, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_saturday_set': {'reg_type': 'SET', 'offset': 32920, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_sunday_set': {'reg_type': 'SET', 'offset': 32921, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_thursday_set': {'reg_type': 'SET', 'offset': 32918, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_tuesday_set': {'reg_type': 'SET', 'offset': 32916, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_day_wednesday_set': {'reg_type': 'SET', 'offset': 32917, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p1_power_set': {'reg_type': 'SET', 'offset': 32913, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535},
 'chrono_p1_start_set': {'reg_type': 'SET', 'offset': 32911, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p1_stop_set': {'reg_type': 'SET', 'offset': 32912, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p1_temperature_set': {'reg_type': 'SET', 'offset': 32914, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'chrono_p2_day_friday_set': {'reg_type': 'SET', 'offset': 32930, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_day_monday_set': {'reg_type': 'SET', 'offset': 32926, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_day_saturday_set': {'reg_type': 'SET', 'offset': 32931, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_day_sunday_set': {'reg_type': 'SET', 'offset': 32932, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_day_thursday_set': {'reg_type': 'SET', 'offset': 32929, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_day_tuesday_set': {'reg_type': 'SET', 'offset': 32927, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_day_wednesday_set': {'reg_type': 'SET', 'offset': 32928, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p2_power_set': {'reg_type': 'SET', 'offset': 32924, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535},
 'chrono_p2_start_set': {'reg_type': 'SET', 'offset': 32922, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p2_stop_set': {'reg_type': 'SET', 'offset': 32923, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p2_temperature_set': {'reg_type': 'SET', 'offset': 32925, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'chrono_p3_day_friday_set': {'reg_type': 'SET', 'offset': 32941, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_day_monday_set': {'reg_type': 'SET', 'offset': 32937, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_day_saturday_set': {'reg_type': 'SET', 'offset': 32942, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_day_sunday_set': {'reg_type': 'SET', 'offset': 32943, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_day_thursday_set': {'reg_type': 'SET', 'offset': 32940, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_day_tuesday_set': {'reg_type': 'SET', 'offset': 32938, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_day_wednesday_set': {'reg_type': 'SET', 'offset': 32939, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p3_power_set': {'reg_type': 'SET', 'offset': 32935, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535},
 'chrono_p3_start_set': {'reg_type': 'SET', 'offset': 32933, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p3_stop_set': {'reg_type': 'SET', 'offset': 32934, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p3_temperature_set': {'reg_type': 'SET', 'offset': 32936, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'chrono_p4_day_friday_set': {'reg_type': 'SET', 'offset': 32952, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_day_monday_set': {'reg_type': 'SET', 'offset': 32948, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_day_saturday_set': {'reg_type': 'SET', 'offset': 32953, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_day_sunday_set': {'reg_type': 'SET', 'offset': 32954, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_day_thursday_set': {'reg_type': 'SET', 'offset': 32951, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_day_tuesday_set': {'reg_type': 'SET', 'offset': 32949, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_day_wednesday_set': {'reg_type': 'SET', 'offset': 32950, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'chrono_p4_power_set': {'reg_type': 'SET', 'offset': 32946, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535},
 'chrono_p4_start_set': {'reg_type': 'SET', 'offset': 32944, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p4_stop_set': {'reg_type': 'SET', 'offset': 32945, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'chrono_p4_temperature_set': {'reg_type': 'SET', 'offset': 32947, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'chrono_week_enable_set': {'reg_type': 'SET', 'offset': 32910, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535},
 'clock_hour_set': {'reg_type': 'SET', 'offset': 33017, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 1, 'set_max': 23, 'mask': 65535},
 'clock_minute_set': {'reg_type': 'SET', 'offset': 33018, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 1, 'set_max': 59, 'mask': 65535},
 'power_set': {'reg_type': 'SET', 'offset': 32976, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 65535},
 'real_power_get': {'reg_type': 'GET', 'offset': 69, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 5, 'mask': 255},
 'standby_get': {'reg_type': 'GET', 'offset': 33095, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535, 'value_off': 0, 'value_on': 1},
 'standby_set': {'reg_type': 'SET', 'offset': 33095, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 65535, 'value_off': 0, 'value_on': 1},
 'status_get': {'reg_type': 'GET', 'offset': 33, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 50, 'mask': 65535, 'value_off': 0},
 'status_managed_get': {'reg_type': 'GET', 'offset': 232, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 255, 'mask': 65535, 'value_on': 85, 'value_off': 170},
 'status_managed_off_enable': {'reg_type': 'ENABLE', 'offset': 33, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 65535, 'mask': 65535},
 'status_managed_on_enable': {'reg_type': 'ENABLE', 'offset': 33, 'formula': '#', 'formula_inverse': '#', 'format_string': '{0}', 'set_min': 0, 'set_max': 65535, 'mask': 65535},
 'temp_air_get': {'reg_type': 'GET', 'offset': 20, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}°C', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'temp_air_set': {'reg_type': 'SET', 'offset': 32875, 'formula': '#/2', 'formula_inverse': '#*2', 'format_string': '{0}°C', 'set_min': 7, 'set_max': 40, 'mask': 65535},
 'temp_gas_flue_get': {'reg_type': 'GET', 'offset': 2, 'formula': '#+30', 'formula_inverse': '#-30', 'format_string': '{0}°C', 'set_min': 0, 'set_max': 255, 'mask': 65535},
 'w_p_braciere_enable': {'reg_type': 'ENABLE', 'offset': 784, 'formula': '#/4', 'formula_inverse': '#*4', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 4},
 'w_p_braciere_get': {'reg_type': 'GET', 'offset': 784, 'formula': '#/4', 'formula_inverse': '#*4', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 4},
 'w_spegnimento_enable': {'reg_type': 'ENABLE', 'offset': 784, 'formula': '#/8', 'formula_inverse': '#*8', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 8},
 'w_spegnimento_get': {'reg_type': 'GET', 'offset': 784, 'formula': '#/8', 'formula_inverse': '#*8', 'format_string': '{0}', 'set_min': 0, 'set_max': 1, 'mask': 8}}

Your code are very nice write and i think is easy to add. per example :

    @property
    def standby(self):
        return int(self.__get_information_item('standby_get'))

    @property
    def w_p_braciere(self):
        return int(self.__get_information_item('w_p_braciere_get'))

    @property
    def w_spegnimento(self):
        return int(self.__get_information_item('w_spegnimento_get'))

    @property
    def temp_gas_flue(self):
        return int(self.__get_information_item('temp_gas_flue_get'))
fredericvl commented 3 years ago

Hi @KarlB59

First of all thanks for your contribution!

I'm aware of the fact that there are more reg types available to query or to set via the API but my intention was to create an abstract Python module to be able to read and set basic functionality like temperature and power. Of course it would be nice to add extra functionalities but to keep the module abstract we then have to know what w_p_braciere means for example. In this way you don't have to understand how it works in the background.

Also something extra that I've recently discovered and that is involved, is that not every stove has the same reg types available and I've not found a way yet to detect which reg type to use in which case. Ideally we don't want to expose properties in the module that don't work, so adding extra ones that are not compatible for everyone is not the best way to go in my opinion.

But if you want to experiment and get more out of this module in the meantime, feel free to fork of course and adjust where you want to fit it to your needs.

Grtz!