emsesp / EMS-ESP

ESP8266 firmware to read and control EMS and Heatronic compatible equipment such as boilers, thermostats, solar modules, and heat pumps
https://emsesp.github.io/docs
GNU Lesser General Public License v3.0
303 stars 97 forks source link

Two devices... Unable to set temp. Make a primary device selectable? #133

Closed frankhommers closed 5 years ago

frankhommers commented 5 years ago

When I enter devices:

These 2 EMS devices were detected:
 Bosch Easy (DeviceID:0x02 ProductID:206 Version:01.08)
 RC30/Nefit Moduline 400 (DeviceID:0x10 ProductID:78 Version:03.01)

When I change the temp by mqtt:

MQTT topic: thermostat temperature value 11.50
Write not supported for this model Thermostat

Is it possible to make one device primary and allow writing to it? That would solve my problem.

frankhommers commented 5 years ago

Another idea would be to write to the one that allows writing. And if only none of those writable thermostats exist show that error.

proddy commented 5 years ago

The code currently only supports a single thermostat and the device id is stored (see thermostat_type when typing set). I need to think about how logic here, something like

frankhommers commented 5 years ago

I have this setup:

image

I use this to force the Moduline 400 into EMS mode, and that works (without the EMS-ESP).

But EMS-ESP is confused about the thermostat I think, also eventually when reading. I am not sure if 1..n is the right method, in some rare cases the Moduline gets detected first.

Thermostat stats:
  Thermostat: Bosch Easy (ProductID:206 Version:01.08)
  Set room temperature: 0.14 C
  Current room temperature: 2.34 C
  Thermostat time is 00:00:00 0/0/2000
  Mode is set to ?

EMS-ESP system stats:
  System logging set to None
  LED is on, Listen mode is on
  Thermostat is enabled, Boiler is disabled, Shower Timer is disabled, Shower Alert is disabled

EMS Bus stats:
  Bus is connected
  Rx: # successful read requests=4, # CRC errors=1
  Tx: Last poll=2.46 seconds ago, # successful write requests=0

Boiler stats:
  Boiler: <not enabled>
  Hot tap water: off
  Central heating: off
  Warm Water activated: ?
  Warm Water circulation pump available: ?
  Warm Water selected temperature: ? C
  Warm Water desired temperature: ? C
  Warm Water current temperature: ? C
  Warm Water current tap water flow: 2.5 l/min
  Warm Water # starts: 0 times
  Warm Water active time: 0 days 0 hours 0 minutes
  Warm Water 3-way valve: off
  Selected flow temperature: 0 C
  Current flow temperature: 26.0 C
  Return temperature: 26.0 C
  Gas: off
  Boiler pump: off
  Fan: off
  Ignition: off
  Circulation pump: off
  Burner selected max power: 0 %
  Burner current power: 0 %
  Flame current: 0.0 uA
  System pressure: ? bar
  System service code: 0H (0)
  Heating temperature setting on the boiler: ? C
  Boiler circuit pump modulation max power: ? %
  Boiler circuit pump modulation min power: ? %
  Outside temperature: 14.5 C
  Boiler temperature: ? C
  Pump modulation: 0 %
  Burner # starts: 0 times
  Total burner operating time: 0 days 0 hours 0 minutes
  Total heat operating time: 0 days 0 hours 0 minutes

Thermostat stats:
  Thermostat: Bosch Easy (ProductID:206 Version:01.08)
  Set room temperature: 0.14 C
  Current room temperature: 2.35 C
  Thermostat time is 00:00:00 0/0/2000
  Mode is set to ?

The read thermostat temps are wrong, they are divided by 10. Everything else is correct. I do not use warm water/boiler so that's correct.

I have put it in listen_mode because in my opinion writing to the wrong thermostat now is a bad idea.

I would love to be able to use EMS-ESP for this!

proddy commented 5 years ago

Yes, the reason the temps are wrong is because the values of setpoint temp and current temp are overwritten by the RC35 and it renders the values thinking its an Easy. Question: so you have a Bosch or a Nefit Easy?

So not sure what to do here. What solution do you think works?

frankhommers commented 5 years ago

This is my stuff, see pics below, on the label it's Nefit Easy Connect (made by Bosch :-) ).

photo5789690218398462318 photo5789690218398462317 photo5789690218398462319

I am not sure.

The ability to blacklist a specific device would solve the problem. The best way would to be able to filter by these

 uint8_t   src;         // source ID
 uint8_t   dest;        // destination ID

in messages.

proddy commented 5 years ago

ah, I think I know a part of the problem. Your device is an Easy Connect and not an Easy thermostat (like the Moduline Easy). In the ems_devices.h I had it incorrectly classified as a Thermostat with {EMS_MODEL_EASY, 206, 0x02, "Bosch Easy", EMS_THERMOSTAT_WRITE_NO}

when it should be under the Other types like how the Nefit Easy Connect {EMS_MODEL_OTHER, 205, 0x02, "Nefit Moduline Easy Connect"}

I've made the change, not sure if its fixes anything on your side though!

frankhommers commented 5 years ago

That could be a solution as well! Can you please build it and put it on release? That would help me a lot because I don't have the development stack installed.

proddy commented 5 years ago

sure, added to https://github.com/proddy/EMS-ESP/releases/tag/1.8.1

Note if you want to quickly build and upload without having a full dev environment I wrote some instructions on the Wiki here which works with Ubuntu (under Windows or native) and MacOSX.

frankhommers commented 5 years ago

Awesome it works now!

I also had to make a change in the homeassistant config so that the auto/manual/off icons would work.

This is because e.g. the value was set to 'manual' and the mqtt response was 'day'.

mode_state_template: "{{ {'auto':'auto','day':'manual','night':'off','manual':'manual','off':'off'}[value_json.thermostat_mode] | default('unknown') }}"

proddy commented 5 years ago

great! I'll look at the HA config again. Thanks for pointing that out and helping test

proddy commented 5 years ago

@frankhommers I looked into the thermostat MQTT messages (line 728 in ems-esp.cpp). For RC20's I Send low, manual and auto depending on the mode. All other thermostat models send night, day, auto. What should it be for your Moduline 400 so I can fix this in the code?

frankhommers commented 5 years ago

It's actually "auto", "manual" and "frost protection" ;-) So it's seems like that it also would need to be "auto", "manual", "low".

I am not sure "low" (for any thermostat) would be an appropriate value according to Home Assistant.