claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heat and OFF button doesn't work

dieuvolkanos opened this issue · comments

Hi,

I installed the Sinope Neviweb130 GT130 for my new thermostat TH1124WF. I don't have the GT130 gateway, but the thermostat control for the temperature work fine at Auto mode. When I tried to turn Off or Heat with HomeAssistant, I have a glitch and return to Auto. If I use the NeviWeb on my mobile and turn off or Heat mode, I see the modification in HA for the mode.

Why the Heat and Off button doesn't work? This is the debug when I click on heat and off.

2022-02-22 16:04:07 DEBUG (SyncWorker_5) [custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat (0.766 sec): {'roomSetpoint': 18, 'outputPercentDisplay': {'percent': 100, 'sourceType': 'heating'}, 'roomTemperature': {'value': 19.78, 'error': None}, 'roomSetpointMin': 15, 'roomSetpointMax': 25, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1913, 'loadWatt': 1913, 'wifiRssi': -38, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'autoBypass', 'occupancyMode': 'home', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 18}
2022-02-22 16:04:49 DEBUG (SyncWorker_9) [custom_components.neviweb130] Data = {'systemMode': 'heat'}
2022-02-22 16:04:49 DEBUG (SyncWorker_9) [custom_components.neviweb130] Request response = 200
2022-02-22 16:04:49 DEBUG (SyncWorker_9) [custom_components.neviweb130] Json Data received= {}
2022-02-22 16:04:49 DEBUG (SyncWorker_9) [custom_components.neviweb130] Content = b'{}'
2022-02-22 16:04:49 DEBUG (SyncWorker_9) [custom_components.neviweb130] Text = {}
2022-02-22 16:04:50 DEBUG (SyncWorker_9) [custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat (0.734 sec): {'roomSetpoint': 18, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 19.78, 'error': None}, 'roomSetpointMin': 15, 'roomSetpointMax': 25, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1913, 'loadWatt': 1913, 'wifiRssi': -38, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'autoBypass', 'occupancyMode': 'home', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 18}
2022-02-22 16:05:14 DEBUG (SyncWorker_4) [custom_components.neviweb130] Data = {'systemMode': 'off'}
2022-02-22 16:05:14 DEBUG (SyncWorker_4) [custom_components.neviweb130] Request response = 200
2022-02-22 16:05:14 DEBUG (SyncWorker_4) [custom_components.neviweb130] Json Data received= {}
2022-02-22 16:05:14 DEBUG (SyncWorker_4) [custom_components.neviweb130] Content = b'{}'
2022-02-22 16:05:14 DEBUG (SyncWorker_4) [custom_components.neviweb130] Text = {}
2022-02-22 16:05:15 DEBUG (SyncWorker_9) [custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat (0.771 sec): {'roomSetpoint': 18, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 19.75, 'error': None}, 'roomSetpointMin': 15, 'roomSetpointMax': 25, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1913, 'loadWatt': 1913, 'wifiRssi': -38, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'autoBypass', 'occupancyMode': 'home', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 18}

configuration.yml

neviweb130:
  username: !secret thermostat_user
  password: !secret thermostat_password
  scan_interval: 300

logger:
  default: warning
  logs:
    custom_components.neviweb130: debug
    homeassistant.service: debug
    homeassistant.config_entries: debug

Home Assistant 2022.2.9
Sinope Neviweb130 v1.1.5

Thanks,
DieuVolkanos

Hi first do you have more then one location on Neviweb ? if yes you need to tel neviweb130 which one contain the wifi thermostats. If no, then we need to find out why Neviweb do not respond to what you send. Which browser do you use. Can you open dev console to see which parameter is used when you turn off or heat your thermostat

On my side I just have zigbee thermostat on neviweb130 and it look like this
2022-02-22 17:24:06 DEBUG (SyncWorker_7) [custom_components.neviweb130] Data = {'systemMode': 'off'}
2022-02-22 17:24:06 DEBUG (SyncWorker_7) [custom_components.neviweb130] Request response = 200
2022-02-22 17:24:06 DEBUG (SyncWorker_7) [custom_components.neviweb130] Json Data received= {'systemMode': 'off'}
2022-02-22 17:24:06 DEBUG (SyncWorker_7) [custom_components.neviweb130] Content = b'{"systemMode":"off"}'
2022-02-22 17:24:06 DEBUG (SyncWorker_7) [custom_components.neviweb130] Text = {"systemMode":"off"}

In your case you send the wright parameter to Neviweb and receive a Request response = 200
This tell you that Neviweb received correctly your request. But then it return Json Data received= {}
In your log do you have something like this: DVCACTNSPTD

I think that systemMode attribute does not exist for wifi thermostats.
Can you go on Neviweb and put your thermostat to heat or off. Then chech your HA log for
[custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat....
and send me that line so I can find what is the correct attribute to put your thermostat to Off or Heat or auto. I think it is setpointMode but you need to confirm that. Then I'll be able to change neviweb130 so it support that for wifi thermostats

Hi @claudegel ,

Here the information from my WifI thermostat (1st line is Neviweb dev console log, and 2nd one is HA log for the 3 modes) :

`{"setpointMode":"manual","roomSetpoint":21,"roomTemperatureDisplay":{"value":20.5,"status":"on"},"outputPercentDisplay":{"percent":60,"sourceType":"heating"},"occupancyMode":"none"}
2022-02-23 07:52:42 DEBUG (SyncWorker_4) [custom_components.neviweb130.climate] Updating neviweb130 climate Bureau Eric (0.699 sec): {'roomSetpoint': 21, 'outputPercentDisplay': {'percent': 80, 'sourceType': 'heating'}, 'roomTemperature': {'value': 20.44, 'error': None}, 'roomSetpointMin': 5, 'roomSetpointMax': 30, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1199, 'loadWatt': 1199, 'wifiRssi': -61, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'manual', 'occupancyMode': 'none', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20.5, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 15}

{"setpointMode":"off","roomSetpoint":21,"roomTemperatureDisplay":{"value":20,"status":"on"},"outputPercentDisplay":{"percent":80,"sourceType":"heating"},"occupancyMode":"none"}
2022-02-23 07:47:42 DEBUG (SyncWorker_2) [custom_components.neviweb130.climate] Updating neviweb130 climate Bureau Eric (0.661 sec): {'roomSetpoint': 21, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 20.52, 'error': None}, 'roomSetpointMin': 5, 'roomSetpointMax': 30, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1199, 'loadWatt': 1199, 'wifiRssi': -61, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'off', 'occupancyMode': 'none', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20.5, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 15}

{"setpointMode":"auto","roomSetpoint":21,"roomTemperatureDisplay":{"value":20.5,"status":"on"},"outputPercentDisplay":{"percent":0,"sourceType":"heating"},"occupancyMode":"none"}
2022-02-23 08:02:42 DEBUG (SyncWorker_4) [custom_components.neviweb130.climate] Updating neviweb130 climate Bureau Eric (0.689 sec): {'roomSetpoint': 16, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 21.04, 'error': None}, 'roomSetpointMin': 5, 'roomSetpointMax': 30, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1199, 'loadWatt': 1199, 'wifiRssi': -61, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'auto', 'occupancyMode': 'none', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 21, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 15}
`

Hi,

I just have one location, just 1 Sinope thermostat.
Try with Firefox and HA mobile app.
No DVCACTNSPTD in my log.

This is what I get:

off
2022-02-23 10:42:05 DEBUG (SyncWorker_12) [custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat (0.778 sec): {'roomSetpoint': 18, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 20.09, 'error': None}, 'roomSetpointMin': 15, 'roomSetpointMax': 25, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1913, 'loadWatt': 1913, 'wifiRssi': -37, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'off', 'occupancyMode': 'home', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 18}

manual
2022-02-23 10:47:05 DEBUG (SyncWorker_8) [custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat (0.752 sec): {'roomSetpoint': 18, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 19.92, 'error': None}, 'roomSetpointMin': 15, 'roomSetpointMax': 25, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1913, 'loadWatt': 1913, 'wifiRssi': -37, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'manual', 'occupancyMode': 'home', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 18}

Thanks

For wifi thermostat we should replace systemMode by setpointMode. I'll make a patch today so you can test. I'll let you know when it is ready

Thanks! :)

Ok I've created a new branch Support-homekit. The patch is there for setpointMode and also another to fix a bug for those who are using homekit with neviweb130. For homekit I've added a new optionnal configuration parameter «homekit_mode» which is set to False by default. If set to True it will make some change to enable a better compatibility with homekit whitout any effect to thos who use only neviweb130.
Please test this branch. It work ok for the zigbee devices on my side

Auto and OFF work fine now, but no success with the heat mode. I don't really need this mode (heat) because I can overight the temp command in auto mode and OFF mode is useful for the summer.

Let me know if you want result or test, I can test it for the heat mode

Merci!

Probably the good setpointMode is not heat but manual

2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Data = {'setpointMode': 'heat'}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Request response = 200
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Json Data received= {'error': {'code': 'VALINVLD', 'data': {'value': 'heat', 'name': 'setpointMode'}}}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Content = b'{"error":{"code":"VALINVLD","data":{"value":"heat","name":"setpointMode"}}}'
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Text = {"error":{"code":"VALINVLD","data":{"value":"heat","name":"setpointMode"}}}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Service error received: {'error': {'code': 'VALINVLD', 'data': {'value': 'heat', 'name': 'setpointMode'}}}, resending request 2
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Data = {'setpointMode': 'heat'}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Request response = 200
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Json Data received= {'error': {'code': 'VALINVLD', 'data': {'value': 'heat', 'name': 'setpointMode'}}}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Content = b'{"error":{"code":"VALINVLD","data":{"value":"heat","name":"setpointMode"}}}'
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Text = {"error":{"code":"VALINVLD","data":{"value":"heat","name":"setpointMode"}}}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Service error received: {'error': {'code': 'VALINVLD', 'data': {'value': 'heat', 'name': 'setpointMode'}}}, resending request 3
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Data = {'setpointMode': 'heat'}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Request response = 200
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Json Data received= {'error': {'code': 'VALINVLD', 'data': {'value': 'heat', 'name': 'setpointMode'}}}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Content = b'{"error":{"code":"VALINVLD","data":{"value":"heat","name":"setpointMode"}}}'
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Text = {"error":{"code":"VALINVLD","data":{"value":"heat","name":"setpointMode"}}}
2022-02-23 16:02:18 DEBUG (SyncWorker_2) [custom_components.neviweb130] Service error received: {'error': {'code': 'VALINVLD', 'data': {'value': 'heat', 'name': 'setpointMode'}}}, resending request 4
2022-02-23 16:02:19 DEBUG (SyncWorker_9) [custom_components.neviweb130.climate] Updating neviweb130 climate Thermostat (0.933 sec): {'roomSetpoint': 18, 'outputPercentDisplay': {'percent': 0, 'sourceType': 'heating'}, 'roomTemperature': {'value': 20.47, 'error': None}, 'roomSetpointMin': 15, 'roomSetpointMax': 25, 'timeFormat': '24h', 'temperatureFormat': 'celsius', 'drStatus': {'drActive': 'off', 'optOut': 'off', 'setpoint': 'off', 'powerAbsolute': 'off', 'powerRelative': 'off'}, 'drSetpoint': {'status': 'off', 'value': None}, 'loadWattOutput1': 1913, 'loadWatt': 1913, 'wifiRssi': -39, 'keyboardLock': 'unlock', 'config2ndDisplay': 'default', 'setpointMode': 'autoBypass', 'occupancyMode': 'home', 'backlightAutoDim': 'alwaysOn', 'roomTemperatureDisplay': {'value': 20.5, 'status': 'on'}, 'earlyStartCfg': 'off', 'roomSetpointAway': 18}

Ha yes it is manual not heat. I'll do the changes

I tested quickly :) with manual and ok

def set_hvac_mode(self, hvac_mode):
        """Set new hvac mode."""
        if hvac_mode == HVAC_MODE_OFF:
            self._client.set_setpoint_mode(self._id, HVAC_MODE_OFF, self._is_wifi)
        elif hvac_mode == HVAC_MODE_HEAT:
            self._client.set_setpoint_mode(self._id, "manual", self._is_wifi)

HA = heat
Sinope = manual

I've update the branch please test for mode manual

init.py and climate.py have been updated

I doesn't have the heat button or manual button in HA.

Need to modify climate.py to have heat button and manual for Neviweb.

line 156 change to HVAC_MODE_HEAT

SUPPORTED_HVAC_WIFI_MODES = [
    HVAC_MODE_OFF,
    HVAC_MODE_AUTO,
    HVAC_MODE_HEAT,
]

line 854 put in comment

    def hvac_mode(self):
        """Return current operation"""
        if self._operation_mode == HVAC_MODE_OFF:
            return HVAC_MODE_OFF
        elif self._operation_mode in [HVAC_MODE_AUTO, MODE_AUTO_BYPASS]:
            if self._is_wifi:
                return self._operation_mode
            else:
                return HVAC_MODE_AUTO
        else:
#            if self._is_wifi:
#                return MODE_MANUAL
#            else:
            return HVAC_MODE_HEAT

line 896 put in comment

def hvac_action(self):
      """Return current HVAC action."""
      if self._operation_mode == HVAC_MODE_OFF:
          return CURRENT_HVAC_OFF
      elif not HOMEKIT_MODE:
          if self._operation_mode == MODE_AUTO_BYPASS:
              return MODE_AUTO_BYPASS
      elif self._heat_level == 0:
          return CURRENT_HVAC_IDLE
      else:
#            if self._is_wifi:
#                return MODE_MANUAL
#            else:
          return CURRENT_HVAC_HEAT

I don't understand why you send this climate.py. What changes have you done?

Sorry I tried something but doesn't work with git. Not familiar to push code on public git.

I make a cleanup see above

What do you have in Neviweb for thermostat operation: off, heat and auto or you have off, manual, auto

I've done the changes. But could you tell me Manual do not appear anywhere ? hvac mode is off, heat and auto plus autoBypass

Neviweb app = manual/auto/off

Probably it's in HA, the thermostat card doesn't know manual. Need to link heat (HA) to manual (neviweb). That what I understand.

Effectively there is no HVAC_MODE_MANUAL and no HVAC_MODE AUTO_BYPASS in HA
That's why I've put MODE_MANUAL to show on the card like what is in Neviweb for wifi thermostats.
This way you have on the card for operations: off, manual and auto

In init.py for wifi I catch both manual and heat mode and send manual to Neviweb
from Neviweb I receive manual for wifi thermostat and I can leave it like this in HA or translate it to heat
The last version of climate.py translate manual to heat for operations (hvac_mode): off, heat, auto
and for current operation (hvac_action): off, idle, heat, autoBypass
Is it ok like this?

Or we can put hvac_mode = off, manual, auto, like in Neviweb
and hvac_action = off, idle, heat and autoBypass

The last version works fine :).

Merci beaucoup !!!

Not a big deal, all works fine also the autoBypass. But I think in the pass version the thermostat card showing autoBypass in the State: (when you modify the auto temperature). I think is showing something like that: Auto (autoBypass). Not sure. The actual version is awesome!

Merci!

Ok I'll push new release today. Thank you for your help

Merges and push to release 1.2.0 thank you.