home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.7k stars 28.85k forks source link

"Heating offset climate system 1" does not accept negative values #101774

Open m-wo opened 8 months ago

m-wo commented 8 months ago

The problem

"Heating offset climate system 1" or respectively "number.heating_offset_climate_system_1_40031" comes with a slider that allows values from -10 to 10.

If I set any value below 0 to -10 it always sets the heatpumpt to just 0, it does not use negative values.

What version of Home Assistant Core has the issue?

core-2023.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Nibe Heat Pump

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nibe_heatpump/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 8 months ago

Hey there @elupus, mind taking a look at this issue as it has been labeled with an integration (nibe_heatpump) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nibe_heatpump` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nibe_heatpump` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nibe_heatpump documentation nibe_heatpump source (message by IssueLinks)

elupus commented 8 months ago

If you set a negative value on the pump itself, is that reflected properly in HA?

jake404 commented 8 months ago

I have the same problem.

If I set the offset to a negative value on the pump (S320) itself, the entity reflects the change.

m-wo commented 8 months ago

Yes, setting it on my s320 directly or via myuplink works to be correctly reflected. Thanks for looking into it @elupus !

moorgrove commented 8 months ago

It's the same issue with "external_adjustment_climate_system_1_40052". The negative values is not set in the pump but zero and positive values works as expected.

timpea-splat commented 8 months ago

I am also unable to set the degree minutes to a negative value on a Nibe S1255. When trying to change the value to -45 it sets it to 0. It works correctly setting it to a positive value.

elupus commented 8 months ago

I wonder if its a bug with out modbus client. Can any of you test with some other modbus client?

moserd commented 8 months ago

hi, its working if i write the value direct via modbus client or if i set it on the heat pump itself. so it seems it's an integration problem.

thanks for your help.

m-wo commented 8 months ago

Ok what would that mean then, shall I open the bug for the modbus component?

elupus commented 8 months ago

Ok what would that mean then, shall I open the bug for the modbus component?

It just mean we have some hidden bug in this component. I've tried to add test cases, but so far no luck in figuring out what goes wrong

timpea-splat commented 8 months ago

@elupus not sure if this helps, but saw this comment about negative values https://community.home-assistant.io/t/how-do-i-config-modbus-tcp-for-nibe-s1255/353874/61

elupus commented 8 months ago

We already do that. Ive added some tests for negative numbers too and looks like we call the modbus library with correct values. But there might be some bug lower down.

Hmm. A Wireshark capture from the hass computer might help. tcpdump can be used. That way we can look at the raw tcp frames.

dillonfi commented 8 months ago

I reproduced the issue using the python library and did a Wireshark capture when trying to set 'heating-offset-climate-system-1-40031' to -1 on a S1255 pump.

The test code used is below and capture in attachment. Hope this helps

nibe_dump.zip

import asyncio
import logging

from nibe.coil import CoilData
from nibe.connection.modbus import Modbus
from nibe.heatpump import HeatPump, Model

logger = logging.getLogger("nibe").getChild(__name__)
logger.setLevel(10)

def on_coil_update(coil_data: CoilData):
    logger.debug(f"on_coil_update: {coil_data}")

async def main():
    heatpump = HeatPump(Model.S1255)
    # heatpump.word_swap = False  # uncomment if you have word swap disabled in 5.3.11 service menu
    await heatpump.initialize()

    heatpump.subscribe(HeatPump.COIL_UPDATE_EVENT, on_coil_update)

    connection = Modbus(heatpump=heatpump, url="tcp://192.168.1.78:502", slave_id=1)

    coil = heatpump.get_coil_by_name('heating-offset-climate-system-1-40031')
    data = CoilData(coil, -1)
    logger.debug(f"data: {data}")
#    coil_data = await connection.read_coil(coil)
    coil_data = await connection.write_coil(data)

    logger.debug(f"main: {coil_data}")

if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.run_forever()
dillonfi commented 8 months ago

@elupus

From the WS dump its clear that the issue is in the handling of the negative numbers. At least in the test case it's sending uint8 values when the register is uint16.

elupus commented 8 months ago

@elupus

From the WS dump its clear that the issue is in the handling of the negative numbers. At least in the test case it's sending uint8 values when the register is uint16.

Right. Yea that explains the problems. Thanx for the repro case.

elupus commented 7 months ago

@dillonfi Are you able to test https://github.com/yozik04/nibe/pull/128 would be nice to get tests for a few types of registers.

dillonfi commented 7 months ago

@elupus Tested your pr quickly. At least setting heating-offset-climate-system-1-40031 and degree-minutes-40012 to negative both works as expected.

Hoffsn commented 7 months ago

I am also unable to set the degree minutes to a negative value on a Nibe S1255. When trying to change the value to -45 it sets it to 0. It works correctly setting it to a positive value.

me to with the Nibe S320, would love to have fix for this

elupus commented 7 months ago

You guys can try the beta of home assistant if you want. It should be fixed there for heating offset. It might not be fixed for degree minutes.

timpea-splat commented 6 months ago

New beta homeassistant is working for setting the offset to a negative number. @elupus you are correct, if I set the degree minutes to a anything postive or negative it resets to 0.

Hoffsn commented 6 months ago

I´ve just checked it on the new update which came out today and it works for DM (both, pos. and neg. values) :) Thank you so much!

elupus commented 6 months ago

@Hoffsn what pump are you running?

Hoffsn commented 6 months ago

@elupus I run a VVM S320 with a F2040-6 outdoor unit

moorgrove commented 6 months ago

I can confirm that external adjustment and heating offset works with negative and positive values on S1255 with firmware 2.21.12 on HA 2023.12. But adjusting the degree minutes does not work, it just resets to 0 when I try to set a value.

Hoffsn commented 6 months ago

I need to correct my last post. As I tried setting the DM to -200 today, they jumped straight back to 0. I don´t really know why it was working the other day

timpea-splat commented 6 months ago

Anybody had any joy in setting degree minutes?

Or any ideas on how to quickly ramp up the heating when electricity prices are negative? I am changing the mode to “additional heat only” and changing the offset to 10, but it still takes 20+ minutes for the DM to drop enough for it to kick in.

issue-triage-workflows[bot] commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

footwalker commented 3 months ago

Setting degree minutes is still not working: I tried to set DM from 100 to 50 --> 10seconds later it is set to 0DM

System: Core 2024.3.3 Supervisor 2024.03.1 Operating System 12.1 Frontend 20240307.0

issue-triage-workflows[bot] commented 2 days ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.