AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.68k stars 414 forks source link

NSPanel: Error while setting temperature in a Home Assistant scene #1043

Open zanna1972 opened 1 year ago

zanna1972 commented 1 year ago

Hi, this is the scene I created in Home Assistant:

- name: test_sonoff_temp22
    entities:
      climate.termostato_cameretta:
        state: 'heat'
        temperature: 22

When I activate the scene I get this error in the log:

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/core/ewelink/cloud.py:286
Integration: Sonoff ([documentation](https://github.com/AlexxIT/SonoffLAN), [issues](http://192.168.3.51:8123/api/sonoff/1bfcedf5-a307-4188-963a-b5efbfefc056))
First occurred: 10:07:31 AM (1 occurrences)
Last logged: 10:07:31 AM

Cloud ERROR: {'error': 400, 'deviceid': '100156adce', 'apikey': '647f9a26-a71f-4250-934c-e28e8f3d2c39', 'sequence': '1669367251000', 'uid': '647f9a26-a71f-4250-934c-e28e8f3d2c39'}

I have two other scenes perfectly running to turn on and off the NSPanel:

- name: test_sonoff_on
    entities:
      climate.termostato_cameretta:
        state: 'heat'
- name: test_sonoff_off
    entities:
      climate.termostato_cameretta:
        state: 'off'

I think the problem could be the "temperature" line in the scene. Is there another syntax to set the temperature?

Thanks in advance.

zanna1972 commented 1 year ago

Hi, this morning I have made some further test on Sonoff NS panel EU within Home Assistant (last version). I give you my feedback and I hope this could be interesting for you.

Test 1: turn off the thermostat from HA using climate control I click on the OFF option from the combobox called Operation (the combobox contains these values: AUTO, HEAT, OFF) The thermostat turns off. The operation's combobox has the value: HEAT (wrong).

Test 2: turn on the thermostat from HA using climate control I click on the AUTO option from the combobox called Operation. The thermostat turns on. It's in AUTO mode in Ewelink. The operation's combobox has the value: HEAT (wrong). There isn't a way to set the thermostat in mode MANUAL using Home Assistant

Test 3: change desired temperature in thermostat I click the up and down arrow but nothing happens on the thermostat.

Test 4: turn off the thermostat when it's heating I click the OFF option as told before, the thermostat turns off, but it still continue heating. I mean the switch connected to the heat-valve is still in ON state. I don't know if it's correct or not, but in my mind when I turn-off the thermostat, I want to stop heating.

Colclusions: The first problem is that it's not possible to set the desired temperature in the thermostat. I mean the attribute called: temperature. The second problem is that there isn't an attribute for the status of the thermostat. For "status" I mean: heating or idle. This is very simple to calculate... if current_temperature(room) >= desired_temperature --> idle else heating. The third problem is that when I change the mode of the thermostat within the three values: AUTO, MANUAL (better then HEAT)), OFF, the combocox still remain on HEAT value.

I'm at your disposal for any test or feedback you need. Don't esistate to contact me. Many thanks in advance.

AlexxIT commented 1 year ago

I can't fix this bug without device. You can collect more logs. We need to know exact command that generate error 400.