Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prise en charge Thermor Riviera2 #502

Open
tthma opened this issue Dec 15, 2023 · 1 comment
Open

Prise en charge Thermor Riviera2 #502

tthma opened this issue Dec 15, 2023 · 1 comment
Labels

Comments

@tthma
Copy link

tthma commented Dec 15, 2023

Bonjour

J'ai ajouté une sous class ts 'AtlanticElectricalTowelDryer_IC3_IOComponent'.
parce que j'ai remarqué que le serveur m'envoyais "AtlanticElectricalTowelDryer" mais aussi un sous element "AtlanticElectricalTowelDryer_IC3_IOComponent" u coup j'ai eu l'idée de crer cette sous class pour que le mapper fonctionne
Capture d'écran 2023-12-15 170857

comme ca le mapper me bascule sur ma sous class avec les bonnes commande pour piloter mon riviera.
Il est ajouté sur tahomalink mais il est pas pris en charge et est tout bugé. ( je comprend pas pourquoi ils nous laissent le mettre si c'est pas pris en charge d'ailleur).

Donc jusqu'a maintenant j'avais fait tout un system avec un dummy thermostat et node-red et des requette http pour pouvoir quand même le controler avec homebridge et de ce fait homekit.

Après je me suis dit pourquoi pas bidouiller les codes source de ce super plugin qui me sert au quotidien.

du coup voila je sais pas si vous l'implementerez un jour et a defaut comment je fais pour l'impletmenter uniquement pour moi ?

voici la class :
`import { Characteristics, Services } from '../../../Platform';
import { Characteristic } from 'homebridge';
import { Command, ExecutionState } from 'overkiz-client';
import HeatingSystem from '../../HeatingSystem';

export default class AtlanticElectricalTowelDryer_IC3_IOComponent extends HeatingSystem {
protected THERMOSTAT_CHARACTERISTICS = ['prog'];
protected MIN_TEMP = 7;
protected MAX_TEMP = 28;
protected TARGET_MODES = [
Characteristics.TargetHeatingCoolingState.HEAT,
Characteristics.TargetHeatingCoolingState.OFF,
];

protected drying: Characteristic | undefined;

protected registerServices() {
    const services = super.registerServices();
    if (this.device.hasCommand('setHeatingLevelWithTimer')) {
        const boost = this.registerSwitchService('boost');         
        services.push(boost);
    }
      
    return services;
}

 


protected getTargetTemperatureCommands(value): Command | Array<Command> | undefined {
    if (this.prog?.value) {
        return new Command('setDerogatedTargetTemperature', value);
    } else {
        return new Command('setTargetTemperature', value);
    }
}



protected getTargetStateCommands(value): Command | Array<Command> {
    
    switch (value) {
        case Characteristics.TargetHeatingCoolingState.HEAT:
            return new Command('setHeatingLevel', 'comfort' ); 
        case Characteristics.TargetHeatingCoolingState.OFF:                
            return new Command('setHeatingLevel', 'frostprotection' );                
    }
    return [];
}

 
protected getOnCommands(value): Command | Array<Command> {
    const commands = new Array<Command>();
   
    if (value) {
        const param = new Array(2);
        param[0]='boost';
        param[1]= 60;
        commands.push(new Command('setHeatingLevelWithTimer', param));
    }else{
        commands.push(new Command('cancelHeatingLevel', 'boost'));
    }
    return commands;
}



protected onStateChanged(name: string, value) {
    switch (name) {
        case 'core:TemperatureState':
            this.onTemperatureUpdate(value);
            break;
        case 'io:EffectiveTemperatureSetpointState':
        case 'core:TargetTemperatureState':
        case 'core:ComfortRoomTemperatureState':
        case 'io:TargetHeatingLevelState':
        case 'core:OperatingModeState':
            this.postpone(this.computeStates);
            break;

        default:
            super.onStateChanged(name, value);
            break;
    }
}

protected computeStates() {
    let targetState;
    let targetTemperature;
    targetState = Characteristics.TargetHeatingCoolingState.OFF;
    const value =this.device.get('io:TargetHeatingLevelState');
    switch (value) {
        case 'off':
        case 'frostprotection':
        case 'standby':
            targetState = Characteristics.TargetHeatingCoolingState.OFF;
            this.currentState?.updateValue(Characteristics.CurrentHeatingCoolingState.OFF);
            targetTemperature = this.device.get('core:TargetTemperatureState');
            break;
        case 'boost':
        case 'comfort':
        case 'eco':
            this.on?.updateValue(value === 'boost');
            targetState = Characteristics.TargetHeatingCoolingState.HEAT;
            this.currentState?.updateValue(Characteristics.CurrentHeatingCoolingState.HEAT);
            targetTemperature = this.device.get('core:TargetTemperatureState');
            break; 
    }

    if (this.targetTemperature !== undefined && targetTemperature !== undefined && targetTemperature !== null) {
        this.targetTemperature.updateValue(targetTemperature);
    }

    if (this.targetState !== undefined && targetState !== undefined && this.isIdle) {
        this.targetState.updateValue(targetState);
    }
}

}`

Copy link

There hasn't been any activity on this issue recently.
Please make sure to update to the latest Homebridge TaHoma version to see if that solves the issue.
This issue will be closed in case of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant