Strange behavious of thermostate

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
martgreb
Posts: 4
Joined: 11 Feb 2019 09:55

Strange behavious of thermostate

Post by martgreb »

I've uploaded simple thermostate code created with Z-uno shield and on Fibaro HC2 I can't set the setpoint for example 25 or 26 or 27, as it goes back to initial 4C. If I choose 25.5 or 26.6 and so on - everything works fine.
Attachments
Screen Shot 2020-03-27 at 18.22.33.png
Screen Shot 2020-03-27 at 18.22.33.png (97.49 KiB) Viewed 654 times
Screen Shot 2020-03-27 at 18.22.42.png
Screen Shot 2020-03-27 at 18.22.42.png (54.31 KiB) Viewed 654 times
Screen Shot 2020-03-27 at 18.22.55.png
Screen Shot 2020-03-27 at 18.22.55.png (59.1 KiB) Viewed 654 times

User avatar
PoltoS
Posts: 5524
Joined: 26 Jan 2011 19:36

Re: Strange behavious of thermostate

Post by PoltoS »

Please share the code

martgreb
Posts: 4
Joined: 11 Feb 2019 09:55

Re: Strange behavious of thermostate

Post by martgreb »

Code was created with shield cinfigurator.


#include "ZUNO_DS18B20.h"

// Global variables

byte pin6ThermostatModeState = 0;
signed int pin6ThermostatTemperatureState = 0;
signed int pin6ThermostatTemperatureCurrent = 0;

OneWire ow(11);
DS18B20Sensor ds18b20(&ow);

byte addresses[8 * 1 + 8]; // last one for search
byte number_of_sensors; // Number of sensors found (if less than 1 connected)
signed int temperature[1];

// Z-Wave channels
ZUNO_SETUP_CHANNELS(
ZUNO_THERMOSTAT(THERMOSTAT_FLAGS_OFF | THERMOSTAT_FLAGS_HEAT, THERMOSTAT_UNITS_CELSIUS, THERMOSTAT_RANGE_POS, 4, pin6ThermostatModeGetter, pin6ThermostatModeSetter, pin6ThermostatTemperatureGetter, pin6ThermostatTemperatureSetter),
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_ONE_DECIMAL, pin11SensorDS18B20Getter_1)
);

void setup() {
pinMode(6, OUTPUT);

number_of_sensors = ds18b20.findAllSensors(addresses);
}

void loop() {
if (pin6ThermostatModeState) {
pin6ThermostatTemperatureCurrent = temperature[0];
if (pin6ThermostatTemperatureState < pin6ThermostatTemperatureCurrent - 10) {
digitalWrite(6, HIGH);
}
if (pin6ThermostatTemperatureState > pin6ThermostatTemperatureCurrent + 10) {
digitalWrite(6, LOW);
}
}

if (number_of_sensors >= 1) {
temperature[0] = ds18b20.getTempC100(&addresses[8 * 0])/10;
zunoSendReport(2 + 0);
}

delay(20);
}

// Getters and setters

void pin6ThermostatModeSetter(byte value) {
pin6ThermostatModeState = value;
}

byte pin6ThermostatModeGetter() {
return pin6ThermostatModeState;
}

void pin6ThermostatTemperatureSetter(byte mode, signed int value) {
pin6ThermostatTemperatureState = value;
}

signed int pin6ThermostatTemperatureGetter(byte mode) {
return pin6ThermostatTemperatureState;
}

word pin11SensorDS18B20Getter_1() {
return temperature[0];
}

martgreb
Posts: 4
Joined: 11 Feb 2019 09:55

Re: Strange behavious of thermostate

Post by martgreb »

Just checked on other controllers:

Vera working fine.
Home assistant initially working only mode, but after trial to change xml file, set point works with errors. Some numbers are working as 28.5C, but below 25 - result in hundreds C or even negative.

Post Reply