@cathoderay that maybe the case, although in my case its all physically connected to an ESP right now so it'd be a rewiring job to move it into the HA machine to be able to use anything like that python. but lets not get hung up on the how of what flavour of coding gets used to get there 🙂 . I don't have the skills to write C++ lambdas , not a hope in hell - I wasn't suggesting that I'd write one - just musing that that might be the way out of that particular branch of the modbus cave...
there's different things going on here that don't add up: TomC has stated (I think) that he is able to change LWT but we don't have the detail of how. GlynHudson's github code says that changes to LWT using instrument.writeregister (same as yours) don't work. Derek thinks that target LWT isn't a writable parameter. some debate as to what mode the ASHP needs to be in to allow modbus to take control. too many unknowns at the moment.
My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs
Posted by: @cathoderayComplexity, dear boy, complexity! You'll be dancing with the three legged one eyed unicorn before you know it! Basic python plus minimalmodbus can do it far more simply:
minimalmodbus requires full-fat Python, ESP can only run MicroPython. This snippet you've added doesn't touch Home Assistant so isn't a fair comparison with regards to complexity.
Posted by: @iancalderbankif you've used the number method to successfully change the DHW temp, that proves that write does work for a number method from an esp
ESPHome can absolutely perform modbus writes, I expect the part in the modbus controller docs needs an update. The modbus number controller docs states the following (and is proven to work):
When the Number is updated a modbus write command is created sent to the device.
Posted by: @stevenESPHome can absolutely perform modbus writes, I expect the part in the modbus controller docs needs an update. The modbus number controller docs states the following (and is proven to work):
When the Number is updated a modbus write command is created sent to the device.
thanks and sorry if any offence given. I honestly thought that your original suggestion to try an ESP "number" was on the basis of "I think this might work, why not give it a go" rather than "I've used these before, I know how these things work".
I think the clue I need is from @tomc, what needs to be written to effect a change in LWT in his setup.
My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs
Posted by: @iancalderbank@cathoderay that maybe the case, although in my case its all physically connected to an ESP right now so it'd be a rewiring job to move it into the HA machine to be able to use anything like that python. but lets not get hung up on the how of what flavour of coding gets used to get there 🙂 . I don't have the skills to write C++ lambdas , not a hope in hell - I wasn't suggesting that I'd write one - just musing that that might be the way out of that particular branch of the modbus cave...
there's different things going on here that don't add up: TomC has stated (I think) that he is able to change LWT but we don't have the detail of how. GlynHudson's github code says that changes to LWT using instrument.writeregister (same as yours) don't work. Derek thinks that target LWT isn't a writable parameter. some debate as to what mode the ASHP needs to be in to allow modbus to take control. too many unknowns at the moment.
Having given more thought as to what may be happening inside a heat pump controller, the following may be possible.
When operating in WC mode, the target LWT is calculated by the processor, based upon the outside temperature and the slope of the WC curve. The result of this calculation is being written repeatedly into the specified address register, so therefore cannot be changed from an external signal. CR's method of changing the WC slope may possibly work.
When operating in fixed LWT mode, the LWT can be changed via the HMI, so it would appear that the WC mode calculation is no longer being written to the specified address. It may therefore be possible to write to this address (68) to change the target LWT. If that does not work then look for the address that is changed by the HMI when the fixed LWT value is changed.
Posted by: @derek-mTo help make the setback and boost possibly more efficient, you could ramp up the temperature over several hours.
Once I've got the read side of things sorted, I will start experimenting with set back and boost, but it may have to wait until next autumn/winter, as the weather is becoming increasingly milder now.
Posted by: @iancalderbankI don't have the skills to write C++ lambdas , not a hope in hell - I wasn't suggesting that I'd write one - just musing that that might be the way out of that particular branch of the modbus cave...
there's different things going on here that don't add up
This is absolutely typical of HA hell. It's forum is chock a block with things that don't add up, incoherent and unexplained claims and more than enough illiteracy to make George Orwell explode.
This is why I am making the case for basic python. If you've got modbus over RS-485, you only need one very simple bi-directional RS-485/USB converter, plug it in to something that can run python, and write simple easy to construct code that makes sense. I'm just underlining @derek-m's pro-KISS approach.
Posted by: @stevenminimalmodbus requires full-fat Python, ESP can only run MicroPython. This snippet you've added doesn't touch Home Assistant so isn't a fair comparison with regards to complexity.
Not sure about full fat python. Can you also get semi-skimmed python? Perhaps Waitrose or M&S sell it, alongside the ostrich steaks.
My snippet isn't meant to touch HA, it's meant to avoid it, and demonstrate that code doesn't have to be complex. I think the comparison achieves that. The code is concise and easily understood, ie near perfect programming, compared HA coding, which is coding hell, overlong, packed with ludicrous complexity and often totally unreadable let alone maintainable. Numerous posts both here and and on HA's own forum amply establish that.
Midea 14kW (for now...) ASHP heating both building and DHW
@derek-m thats exactly what I did. I knew that having the WC (WL as samsung calls it) running would be constantly overwriting any LWT that I might try to set. So I put the system into fixed LWT mode using the HMI. I changed the target LWT using the HMI. I observed that register 68 "target LWT" changed (reading that register over modbus using HA via an ESP) to match that value. And, that this (eventually, once the system had run a bit) had the expected effect on actual LWT.
I then try to write to that register using modbus. thats the bit that fails. it always goes immediately back to the value set on the HMI.
My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs
Posted by: @iancalderbank@derek-m thats exactly what I did. I knew that having the WC (WL as samsung calls it) running would be constantly overwriting any LWT that I might try to set. So I put the system into fixed LWT mode using the HMI. I changed the target LWT using the HMI. I observed that register 68 "target LWT" changed (reading that register over modbus using HA via an ESP) to match that value. And, that this (eventually, once the system had run a bit) had the expected effect on actual LWT.
I then try to write to that register using modbus. thats the bit that fails. it always goes immediately back to the value set on the HMI.
I suspect that address 68 is just an 'output' and is being updated by the processor, either from the WC calculation, or directly from the HMI.
You need to discover which 'set LWT' 'input' is being changed by the HMI, which in turns causes address 68 to be changed.
Posted by: @stevenDid you try it with something simple like DWH temperature first? I just added the code I pasted the other day and it changed the DWH temperature successfully.
If that works for you, then perhaps it's to do with the pump controller configuration rejecting the LWT change. I've got it set up for weather comp / water law so it doesn't let me change LWT (reg 68). I don't have time at the moment to go and change the controller settings, but I might be able to later on.
I've enabled DHW and tried the same test, it fails for me:
[13:41:03][D][number:012]: 'DHW Target Temperature': Sending state 50.000000 << value on Wired controller [13:41:03][D][modbus_controller.sensor:025]: Sensor new state: 704.00 [13:41:03][D][sensor:126]: 'DHW Temperature': Sending state 70.40000 ºC with 1 decimals of accuracy [13:41:03][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [13:41:03][D][sensor:126]: 'Flow Rate': Sending state 0.00000 lpm with 1 decimals of accuracy [13:41:10][D][number:054]: 'DHW Target Temperature' - Setting number value [13:41:10][D][number:113]: New number value: 49.000000 <<< I Change it in HA [13:41:10][D][modbus.number:059]: Updating register: connected Sensor=DHW Target Temperature start address=0x48 register count=1 new value=49.00 (val=490.00) [13:41:10][D][number:012]: 'DHW Target Temperature': Sending state 49.000000 [13:41:10][D][number:012]: 'DHW Target Temperature': Sending state 49.000000 [13:41:12][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [13:41:12][D][sensor:126]: 'Compressor Frequency': Sending state 0.00000 Hz with 0 decimals of accuracy [13:41:12][D][modbus_controller.sensor:025]: Sensor new state: 147.00 [13:41:12][D][sensor:126]: 'Outdoor Temperature': Sending state 14.70000 ºC with 1 decimals of accuracy [13:41:12][D][modbus.number:023]: Number new state : 16.00 [13:41:12][D][number:012]: 'Target Indoor Temperature': Sending state 16.000000 [13:41:12][D][modbus_controller.sensor:025]: Sensor new state: 223.00 [13:41:12][D][sensor:126]: 'Return Temperature': Sending state 22.30000 ºC with 1 decimals of accuracy [13:41:12][D][modbus_controller.sensor:025]: Sensor new state: 231.00 [13:41:12][D][sensor:126]: 'Flow Temperature': Sending state 23.10000 ºC with 1 decimals of accuracy [13:41:13][D][modbus.number:023]: Number new state : 26.00 [13:41:13][D][number:012]: 'Target Flow Temperature': Sending state 26.000000 [13:41:13][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [13:41:13][D][sensor:126]: 'DHW Status': Sending state 0.00000 with 0 decimals of accuracy [13:41:13][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [13:41:13][D][sensor:126]: 'DHW Mode': Sending state 0.00000 with 0 decimals of accuracy [13:41:13][D][modbus.number:023]: Number new state : 50.00 << it resets back [13:41:13][D][number:012]: 'DHW Target Temperature': Sending state 50.000000 [13:41:13][D][modbus_controller.sensor:025]: Sensor new state: 704.00
my ESP config:
number: - platform: modbus_controller modbus_controller_id: ashp_modbus name: "DHW Target Temperature" id: dhw_target_temperature register_type: holding address: 74 unit_of_measurement: "ºC" device_class: "temperature" value_type: U_WORD lambda: "return x * 0.1; " write_lambda: "return x * 10.0; "
My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs
I would suggest that you check the following:-
'Restrictions on the remote control' in address 64. If it is set to anything other than 0x0000: No Restriction, then this may be prevent you from writing to the memory locations.
I would also suggest that you perform a 'read' of all address register from 1 to 100, noting the value found in each. The values can then be compared with the Modbus map, to ascertain how your system has been set up.
Reading addresses in, or not in, the present list should not have any detrimental affect.
So what did you find in address register 64?
@derek-m give me a min I was just typing the answer.... I did need to do some actual paid work this afternoon!
'Restrictions on the remote control" 64, is reading zero. I'm already reading most of the registers that the manual says are present on the EHS system (whether normal or "hidden", whether R or R/W) , using steven's code, and I am getting the expected value from all of them - the installer of the HP system is me so I know what the expected values are. you can see a snapshot of them in previous messages.
I'm just testing the most basic and of R/W attributes, which ought not to have any automated control loops competing with me to change its value. an on/off switch for "quiet mode" at register 78. that refuses to stay in the state I ask it to as well 🙁
[17:19:55][D][switch:013]: 'Quiet Status' Turning ON. << I TURN IT ON MANUALLY [17:19:55][D][switch:056]: 'Quiet Status': Sending state ON [17:19:56][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [17:19:56][D][sensor:126]: 'Compressor Frequency': Sending state 0.00000 Hz with 0 decimals of accuracy [17:19:56][D][modbus_controller.sensor:025]: Sensor new state: 96.00 [17:19:56][D][sensor:126]: 'Outdoor Temperature': Sending state 9.60000 ºC with 1 decimals of accuracy [17:19:56][D][modbus.number:023]: Number new state : 16.00 [17:19:56][D][number:012]: 'Target Indoor Temperature': Sending state 16.000000 [17:19:56][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [17:19:56][D][sensor:126]: 'Restrictions': Sending state 0.00000 with 0 decimals of accuracy [17:19:56][D][modbus_controller.sensor:025]: Sensor new state: 156.00 [17:19:56][D][sensor:126]: 'Return Temperature': Sending state 15.60000 ºC with 1 decimals of accuracy [17:19:56][D][modbus_controller.sensor:025]: Sensor new state: 166.00 [17:19:56][D][sensor:126]: 'Flow Temperature': Sending state 16.60000 ºC with 1 decimals of accuracy [17:19:56][D][modbus.number:023]: Number new state : 26.00 [17:19:56][D][number:012]: 'Target Flow Temperature': Sending state 26.000000 [17:19:57][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [17:19:57][D][sensor:126]: 'DHW Status': Sending state 0.00000 with 0 decimals of accuracy [17:19:57][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [17:19:57][D][sensor:126]: 'DHW Mode': Sending state 0.00000 with 0 decimals of accuracy [17:19:57][D][modbus.number:023]: Number new state : 50.00 [17:19:57][D][number:012]: 'DHW Target Temperature': Sending state 50.000000 [17:19:57][D][modbus_controller.sensor:025]: Sensor new state: 704.00 [17:19:57][D][sensor:126]: 'DHW Temperature': Sending state 70.40000 ºC with 1 decimals of accuracy [17:19:57][D][switch:056]: 'Quiet Status': Sending state OFF << TURNS ITSELF OFF [17:19:57][D][modbus_controller.sensor:025]: Sensor new state: 0.00 [17:19:57][D][sensor:126]: 'Flow Rate': Sending state 0.00000 lpm with 1 decimals of accuracy
is there a possible cause of all this that the modbus Write commands that I think I am sending to the ASHP are not actually getting there? I know the device whose job it is to construct and send them is doing something (that is the log above) but I mean actually onto the wire , received and succefully dealt with by the receiving end. The only successful data that I have is from ASHP to my device. Zero in the other direction. Can modbus have working comms one way but not the other? I know data comms protocols extremely well (my job) but never touched modbus before last week.
My octopus signup link https://share.octopus.energy/ebony-deer-230
210m2 house, Samsung 16kw Gen6 ASHP Self installed: Single circulation loop , PWM modulating pump.
My public ASHP stats: https://heatpumpmonitor.org/system/view?id=45
11.9kWp of PV
41kWh of Battery storage (3x Powerwall 2)
2x BEVs
- 22 Forums
- 2,062 Topics
- 45.1 K Posts
- 73 Online
- 3,330 Members
Join Us!
Trusted Installers
Struggling to find a reliable heat pump installer? A poor installation can lead to inefficiencies and high running costs. We now connect homeowners with top-rated installers who deliver quality work and excellent service.
✅ Verified, trusted & experienced installers
✅ Nationwide coverage expanding
✅ Special offers available
Latest Posts
-
RE: Getting the best out of a heat pump - is Homely a possible answer?
Isn't the easiest way to do all this, register as an in...
By Johnmo , 22 minutes ago
-
RE: Say hello and introduce yourself
@cathoderay Ah yes, that’s the name! The Heat Pimp, It’...
By Toodles , 2 hours ago
-
RE: Planning Update: 1 Metre Boundary Rule for Heat Pumps Has Been Scrapped
@editor Do you know what the current regulations are f...
By Old_Scientist , 8 hours ago
-
RE: Jokes and fun posts about heat pumps and renewables
@editor Oh come on…. it’ll only take him 10 or 15 minut...
By Toodles , 1 day ago
-
RE: Vaillant & OVO partner up to offer Heat Pump Plus
@westkent My present Cosy Tariff is as follows: NB....
By Toodles , 2 days ago
-
By the way, I also think our industry need to get on bo...
By ASHP-BOBBA , 2 days ago
-
RE: Ripped Off: How UK Homeowners Are Paying Gas Prices for Wind Energy
That's a curious conclusion with which I am struggling,...
By JamesPa , 3 days ago
-
RE: Rate the quality of your heat pump design and installation
Cool sounds good
By Johnmo , 3 days ago
-
RE: Grant Aerona3 - Home Assistant control via Modbus
That's interesting, @grantmethestrength. I'm a little s...
By Majordennisbloodnok , 3 days ago
-
@allyfish That's impressive. We are on a similar journe...
By ChandyKris , 3 days ago
-
RE: Enabling WiFi: Samsung ASHP on Smart Things App
Hi, good to hear. To be honest, I've given up with the ...
By Profzarkov , 3 days ago
-
RE: Solar Power Output – Let’s Compare Generation Figures
I feel like a record is on it's way this month. Scotlan...
By Andris , 4 days ago
-
RE: Discharging battery to grid whilst charging EV
@majordennisbloodnok Well, I tried it and nothing burne...
By AndrewJ , 4 days ago
-
RE: Using AI to optimise your system
@marvinator80 Two of the best resources on Youtube that...
By Grantmethestrength , 4 days ago
-
RE: Renewables & Heat Pumps in the News
@johnmo Ours is powered from solar energy (with grid ba...
By Toodles , 5 days ago
-
RE: Heat Pump Manufacturers Recommending Buffer Tanks
I'm curious who you think are the reluctant ears. Cert...
By JamesPa , 6 days ago
-
RE: Commencing on an ASHP Installation Process
If that is the case then I would add to my earlier post...
By JamesPa , 6 days ago
-
RE: Battery sizing - How low can you go!
The second 6.5 kWh Growatt battery was installed today....
By ChandyKris , 7 days ago
-
RE: IVT Greenline high pressure switch and electrical cassette errors
Your system seems to be more modern than mine, mine was...
By abbote , 1 week ago