mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-14 21:56:31 +03:00
39
CHANGELOG.md
39
CHANGELOG.md
@@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [3.6.4] November 24 2023
|
||||
|
||||
## **IMPORTANT! BREAKING CHANGES**
|
||||
|
||||
Writeable Text entities have moved from type `sensor` to `text` in Home Assistant to make them also editable within an HA dashboard. Examples are `datetime`, `holidays`, `switchtime`, `vacations`, `maintenancedate`... You will need to manually remove any old discovery topics from your MQTT broker using an application like MQTT Explorer.
|
||||
|
||||
## Added
|
||||
|
||||
- humidity for ventilation devices
|
||||
- telegrams for RC100H, hc2, etc. (seen on discord, not tested)
|
||||
- names for BC400, GB192i.2, read temperatures for low loss header and heatblock [#1317](https://github.com/emsesp/EMS-ESP32/discussions/1317)
|
||||
- option for `forceheatingoff` [#1262](https://github.com/emsesp/EMS-ESP32/issues/1262)
|
||||
- remote thermostat emulation RC100H for RC3xx [#1278](https://github.com/emsesp/EMS-ESP32/discussions/1278)
|
||||
- shower_data MQTT payload contains the timestamp [#1329](https://github.com/emsesp/EMS-ESP32/issues/1329)
|
||||
- HA discovery for writeable text entities [#1337](https://github.com/emsesp/EMS-ESP32/pull/1377)
|
||||
- autodetect board_profile, store in nvs, add telnet command option, add E32V2
|
||||
- heat pump high res energy counters [#1348, #1349. #1350](https://github.com/emsesp/EMS-ESP32/issues/1348)
|
||||
- optional bssid in network settings
|
||||
- extension module EM100 [#1315](https://github.com/emsesp/EMS-ESP32/discussions/1315)
|
||||
- digital_out with new options for polarity and startup state
|
||||
- added 'system allvalues' command that dumps all the EMS device values, plus sensors and any custom entities
|
||||
|
||||
## Fixed
|
||||
|
||||
- remove command `remoteseltemp`, thermostat accept it only from remote thermostat
|
||||
- shower_data MQTT payload contains the timestamp [#1329](https://github.com/emsesp/EMS-ESP32/issues/1329)
|
||||
- fixed helper text in Web Device Entity dialog box for numerical ranges
|
||||
- MQTT base with paths not working in HA [#1393](https://github.com/emsesp/EMS-ESP32/issues/1393)
|
||||
- set/read thermostat mode for RC100-RC300, [#1440](https://github.com/emsesp/EMS-ESP32/issues/1440) [#1442](https://github.com/emsesp/EMS-ESP32/issues/1442)
|
||||
- some setting commands for ems-boiler have used wrong ems+ telegram in 3.6.3
|
||||
|
||||
## Changed
|
||||
|
||||
- update to platform 6.4.0, arduino 2.0.14 / idf 4.4.6
|
||||
- small changes for arduino 3.0.0 / idf 5.1 compatibility (not backward compatible to platform 6.3.2 and before)
|
||||
- AP start after 10 sec, stay until station/eth connected
|
||||
- tested wifi-all-channel-scan (3.6.3-dev4 a-e), removed again because of connect issues
|
||||
- mqtt disconnect stops queue
|
||||
|
||||
## [3.6.2] October 1 2023
|
||||
|
||||
## **IMPORTANT! BREAKING CHANGES**
|
||||
|
||||
@@ -1,38 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## [3.6.3]
|
||||
## [3.6.5]
|
||||
|
||||
## **IMPORTANT! BREAKING CHANGES**
|
||||
|
||||
Writeable Text entities have moved from type `sensor` to `text` in Home Assistant to make them also editable within an HA dashboard. Examples are `datetime`, `holidays`, `switchtime`, `vacations`, `maintenancedate`... You will need to manually remove any old discovery topics from your MQTT broker using an application like MQTT Explorer.
|
||||
- new device WATER shows dhw entities from MM100 and SM100 in dhw setting
|
||||
|
||||
## Added
|
||||
|
||||
- humidity for ventilation devices
|
||||
- telegrams for RC100H, hc2, etc. (seen on discord, not tested)
|
||||
- names for BC400, GB192i.2, read temperatures for low loss header and heatblock [#1317](https://github.com/emsesp/EMS-ESP32/discussions/1317)
|
||||
- option for `forceheatingoff` [#1262](https://github.com/emsesp/EMS-ESP32/issues/1262)
|
||||
- remote thermostat emulation RC100H for RC3xx [#1278](https://github.com/emsesp/EMS-ESP32/discussions/1278)
|
||||
- shower_data MQTT payload contains the timestamp [#1329](https://github.com/emsesp/EMS-ESP32/issues/1329)
|
||||
- HA discovery for writeable text entities [#1337](https://github.com/emsesp/EMS-ESP32/pull/1377)
|
||||
- autodetect board_profile, store in nvs, add telnet command option, add E32V2
|
||||
- heatpump high res energy counters [#1348, #1349. #1350](https://github.com/emsesp/EMS-ESP32/issues/1348)
|
||||
- optional bssid in network settings
|
||||
- extension module EM100 [#1315](https://github.com/emsesp/EMS-ESP32/discussions/1315)
|
||||
- digital_out with new options for polarity and startup state
|
||||
- added 'system allvalues' command that dumps all the EMS device values, plus sensors and any custom entities
|
||||
- some more entities for dhw with SM100 module
|
||||
- thermostat boost mode and boost time [#1446](https://github.com/emsesp/EMS-ESP32/issues/1446)
|
||||
- heatpump energy meters [#1463](https://github.com/emsesp/EMS-ESP32/issues/1463)
|
||||
- heatpump max power [#1475](https://github.com/emsesp/EMS-ESP32/issues/1475)
|
||||
- checkbox for MQTT-TLS enable [#1474](https://github.com/emsesp/EMS-ESP32/issues/1474)
|
||||
|
||||
## Fixed
|
||||
|
||||
- remove command `remoteseltemp`, thermostat accept it only from remote thermostat
|
||||
- shower_data MQTT payload contains the timestamp [#1329](https://github.com/emsesp/EMS-ESP32/issues/1329)
|
||||
- fixed helper text in Web Device Entity dialog box for numerical ranges
|
||||
- MQTT base with paths not working in HA [#1393](https://github.com/emsesp/EMS-ESP32/issues/1393)
|
||||
- exhaust temperature for some boilers
|
||||
- add back boil2hyst [#1477](https://github.com/emsesp/EMS-ESP32/issues/1477)
|
||||
|
||||
## Changed
|
||||
|
||||
- update to platform 6.4.0, arduino 2.0.14 / idf 4.4.6
|
||||
- small changes for arduino 3.0.0 / idf 5.1 compatibility (not backward compatible to platform 6.3.2 and before)
|
||||
- AP start after 10 sec, stay until station/eth connected
|
||||
- tested wifi-all-channel-scan (3.6.3-dev4 a-e), removed again because of connect issues
|
||||
- mqtt disconnect stops queue
|
||||
- use flag for BC400 compatible thermostats, manage different mode settings
|
||||
- HA don't set entity_category to Diagnostic/Configuration for EMS entities [#1459](https://github.com/emsesp/EMS-ESP32/discussions/1459)
|
||||
|
||||
2
Makefile
2
Makefile
@@ -42,7 +42,7 @@ DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DAR
|
||||
DEFINES += -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -D__linux__ -DEMC_RX_BUFFER_SIZE=1500
|
||||
DEFINES += $(ARGS)
|
||||
|
||||
DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.0-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
||||
DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.4-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Sources & Files
|
||||
|
||||
2320
dump_entities.csv
2320
dump_entities.csv
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "EMS-ESP",
|
||||
"version": "3.6.3",
|
||||
"version": "3.6.5",
|
||||
"description": "build EMS-ESP WebUI",
|
||||
"homepage": "https://emsesp.github.io/docs",
|
||||
"author": "proddy",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
@@ -20,19 +21,19 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@alova/adapter-xhr": "^1.0.1",
|
||||
"@babel/core": "^7.23.3",
|
||||
"@babel/core": "^7.23.5",
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@mui/icons-material": "^5.14.18",
|
||||
"@mui/material": "^5.14.18",
|
||||
"@mui/icons-material": "^5.14.19",
|
||||
"@mui/material": "^5.14.19",
|
||||
"@table-library/react-table-library": "4.1.7",
|
||||
"@types/imagemin": "^8.0.4",
|
||||
"@types/lodash-es": "^4.17.11",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "^18.2.37",
|
||||
"@types/react-dom": "^18.2.15",
|
||||
"@types/imagemin": "^8.0.5",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^20.10.3",
|
||||
"@types/react": "^18.2.41",
|
||||
"@types/react-dom": "^18.2.17",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"alova": "^2.13.1",
|
||||
"alova": "^2.15.0",
|
||||
"async-validator": "^4.2.5",
|
||||
"history": "^5.3.0",
|
||||
"jwt-decode": "^4.0.0",
|
||||
@@ -42,22 +43,22 @@
|
||||
"react-dom": "latest",
|
||||
"react-dropzone": "^14.2.3",
|
||||
"react-icons": "^4.12.0",
|
||||
"react-router-dom": "^6.18.0",
|
||||
"react-router-dom": "^6.20.1",
|
||||
"react-toastify": "^9.1.3",
|
||||
"sockette": "^2.0.6",
|
||||
"typesafe-i18n": "^5.26.2",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@preact/compat": "^17.1.2",
|
||||
"@preact/preset-vite": "^2.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
||||
"@typescript-eslint/parser": "^6.11.0",
|
||||
"@preact/preset-vite": "^2.7.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||
"@typescript-eslint/parser": "^6.13.1",
|
||||
"concurrently": "^8.2.2",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-airbnb-typescript": "^17.1.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-autofix": "^1.1.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
@@ -67,9 +68,9 @@
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"preact": "^10.19.2",
|
||||
"prettier": "^3.1.0",
|
||||
"rollup-plugin-visualizer": "^5.9.2",
|
||||
"terser": "^5.24.0",
|
||||
"vite": "^4.5.0",
|
||||
"rollup-plugin-visualizer": "^5.10.0",
|
||||
"terser": "^5.25.0",
|
||||
"vite": "^5.0.5",
|
||||
"vite-plugin-imagemin": "^0.6.1",
|
||||
"vite-tsconfig-paths": "^4.2.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { readdirSync, existsSync, unlinkSync, readFileSync, createWriteStream } = require('fs');
|
||||
const { resolve, relative, sep } = require('path');
|
||||
var zlib = require('zlib');
|
||||
var mime = require('mime-types');
|
||||
import { readdirSync, existsSync, unlinkSync, readFileSync, createWriteStream } from 'fs';
|
||||
import { resolve, relative, sep } from 'path';
|
||||
import zlib from 'zlib';
|
||||
import mime from 'mime-types';
|
||||
|
||||
const ARDUINO_INCLUDES = '#include <Arduino.h>\n\n';
|
||||
const INDENT = ' ';
|
||||
|
||||
@@ -498,8 +498,8 @@ function createStructureReader(structure, firstId) {
|
||||
key === '__proto__'
|
||||
? '__proto_:r()'
|
||||
: validName.test(key)
|
||||
? key + ':r()'
|
||||
: '[' + JSON.stringify(key) + ']:r()'
|
||||
? key + ':r()'
|
||||
: '[' + JSON.stringify(key) + ']:r()'
|
||||
)
|
||||
.join(',') +
|
||||
'})}'
|
||||
|
||||
@@ -14,7 +14,7 @@ const RouterTabs: FC<RouterTabsProps> = ({ value, children }) => {
|
||||
const theme = useTheme();
|
||||
const smallDown = useMediaQuery(theme.breakpoints.down('sm'));
|
||||
|
||||
const handleTabChange = (event: React.ChangeEvent<HTMLInputElement>, path: string) => {
|
||||
const handleTabChange = (_event: any, path: string) => {
|
||||
navigate(path);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { useMatch, useResolvedPath } from 'react-router-dom';
|
||||
|
||||
export const useRouterTab = () => {
|
||||
// const loc = useLocation().pathname;
|
||||
// const routerTab = loc.substring(0, loc.lastIndexOf('/')) ? loc : false;
|
||||
|
||||
const routerTabPath = useResolvedPath(':tab');
|
||||
const routerTabPathMatch = useMatch(routerTabPath.pathname);
|
||||
|
||||
const routerTab = routerTabPathMatch?.params?.tab || false;
|
||||
|
||||
return { routerTab } as const;
|
||||
};
|
||||
|
||||
@@ -168,20 +168,24 @@ const MqttSettingsForm: FC = () => {
|
||||
<MenuItem value={2}>2</MenuItem>
|
||||
</TextField>
|
||||
</Grid>
|
||||
{data.rootCA !== undefined && (
|
||||
<Grid item xs={12} sm={6}>
|
||||
<ValidatedPasswordField
|
||||
name="rootCA"
|
||||
label={LL.CERT()}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={data.rootCA}
|
||||
onChange={updateFormValue}
|
||||
margin="normal"
|
||||
/>
|
||||
</Grid>
|
||||
)}
|
||||
</Grid>
|
||||
{data.enableTLS !== undefined && (
|
||||
<BlockFormControlLabel
|
||||
control={<Checkbox name="enableTLS" checked={data.enableTLS} onChange={updateFormValue} />}
|
||||
label={LL.ENABLE_TLS()}
|
||||
/>
|
||||
)}
|
||||
{data.enableTLS === true && (
|
||||
<ValidatedPasswordField
|
||||
name="rootCA"
|
||||
label={LL.CERT()}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={data.rootCA}
|
||||
onChange={updateFormValue}
|
||||
margin="normal"
|
||||
/>
|
||||
)}
|
||||
|
||||
<BlockFormControlLabel
|
||||
control={<Checkbox name="clean_session" checked={data.clean_session} onChange={updateFormValue} />}
|
||||
@@ -382,6 +386,21 @@ const MqttSettingsForm: FC = () => {
|
||||
margin="normal"
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6} md={4}>
|
||||
<TextField
|
||||
name="publish_time_water"
|
||||
label={LL.MQTT_INT_WATER()}
|
||||
InputProps={{
|
||||
endAdornment: <InputAdornment position="end">{LL.SECONDS()}</InputAdornment>
|
||||
}}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={numberValue(data.publish_time_water)}
|
||||
type="number"
|
||||
onChange={updateFormValue}
|
||||
margin="normal"
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6} md={4}>
|
||||
<TextField
|
||||
name="publish_time_sensor"
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-li
|
||||
import { useTheme } from '@table-library/react-table-library/theme';
|
||||
import { useContext, useState } from 'react';
|
||||
|
||||
import { unstable_useBlocker as useBlocker } from 'react-router-dom';
|
||||
import { useBlocker } from 'react-router-dom';
|
||||
import GenerateToken from './GenerateToken';
|
||||
import UserForm from './UserForm';
|
||||
import type { FC } from 'react';
|
||||
|
||||
@@ -246,6 +246,7 @@ const de: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Thermostate',
|
||||
MQTT_INT_SOLAR: 'Solarmodule',
|
||||
MQTT_INT_MIXER: 'Mischermodule',
|
||||
MQTT_INT_WATER: 'Warmwassermodule',
|
||||
MQTT_QUEUE: 'MQTT Queue',
|
||||
DEFAULT: 'Standard',
|
||||
MQTT_ENTITY_FORMAT: 'Entitäts-ID Format',
|
||||
@@ -323,7 +324,8 @@ const de: Translation = {
|
||||
WRITEABLE: 'Schreibbar',
|
||||
SHOWING: 'Anzeigen von',
|
||||
SEARCH: 'Suche',
|
||||
CERT: 'TLS Zertifikat (Freilassen um TLS zu deaktivieren)',
|
||||
CERT: 'TLS Zertifikat (Freilassen für unsichere Verbindung)',
|
||||
ENABLE_TLS: 'Aktiviere TLS',
|
||||
ON: 'An',
|
||||
OFF: 'Aus',
|
||||
POLARITY: 'Polarität',
|
||||
|
||||
@@ -246,6 +246,7 @@ const en: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Thermostats',
|
||||
MQTT_INT_SOLAR: 'Solar Modules',
|
||||
MQTT_INT_MIXER: 'Mixer Modules',
|
||||
MQTT_INT_WATER: 'Water Modules',
|
||||
MQTT_QUEUE: 'MQTT Queue',
|
||||
DEFAULT: 'Default',
|
||||
MQTT_ENTITY_FORMAT: 'Entity ID format',
|
||||
@@ -323,7 +324,8 @@ const en: Translation = {
|
||||
WRITEABLE: 'Writeable',
|
||||
SHOWING: 'Showing',
|
||||
SEARCH: 'Search',
|
||||
CERT: 'TLS root certificate (leave blank to disable TLS)',
|
||||
CERT: 'TLS root certificate (leave blank for insecure)',
|
||||
ENABLE_TLS: 'Enable TLS',
|
||||
ON: 'On',
|
||||
OFF: 'Off',
|
||||
POLARITY: 'Polarity',
|
||||
|
||||
@@ -246,6 +246,7 @@ const fr: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Thermostats',
|
||||
MQTT_INT_SOLAR: 'Modules solaires',
|
||||
MQTT_INT_MIXER: 'Modules mélangeurs',
|
||||
MQTT_INT_WATER: 'Modules eau',
|
||||
MQTT_QUEUE: 'Queue MQTT',
|
||||
DEFAULT: 'Défaut',
|
||||
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO translate
|
||||
@@ -323,7 +324,8 @@ const fr: Translation = {
|
||||
WRITEABLE: 'Writeable', // TODO translate
|
||||
SHOWING: 'Showing', // TODO translate
|
||||
SEARCH: 'Search', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank to disable TLS)', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank for insecure)', // TODO translate
|
||||
ENABLE_TLS: 'Activer TLS',
|
||||
ON: 'On', // TODO translate
|
||||
OFF: 'Off', // TODO translate
|
||||
POLARITY: 'Polarity', // TODO translate
|
||||
|
||||
@@ -248,6 +248,7 @@ const it: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Termostati',
|
||||
MQTT_INT_SOLAR: 'Moduli solari',
|
||||
MQTT_INT_MIXER: 'Moduli Mixer',
|
||||
MQTT_INT_WATER: 'Moduli Acqua',
|
||||
MQTT_QUEUE: 'Coda MQTT',
|
||||
DEFAULT: 'Predefinito',
|
||||
MQTT_ENTITY_FORMAT: 'Formato ID entità',
|
||||
@@ -325,7 +326,8 @@ const it: Translation = {
|
||||
WRITEABLE: 'Scrivibile',
|
||||
SHOWING: 'Visualizza',
|
||||
SEARCH: 'Ricerca',
|
||||
CERT: 'TLS root certificate (leave blank to disable TLS)', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank for insecure)', // TODO translate
|
||||
ENABLE_TLS: 'Abilita TLS',
|
||||
ON: 'On', // TODO translate
|
||||
OFF: 'Off', // TODO translate
|
||||
POLARITY: 'Polarity', // TODO translate
|
||||
|
||||
@@ -246,6 +246,7 @@ const nl: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Thermostaten',
|
||||
MQTT_INT_SOLAR: 'Solar Modules',
|
||||
MQTT_INT_MIXER: 'Mixer Modules',
|
||||
MQTT_INT_WATER: 'Water Modules',
|
||||
MQTT_QUEUE: 'MQTT Queue',
|
||||
DEFAULT: 'Default',
|
||||
MQTT_ENTITY_FORMAT: 'Entity ID formaat',
|
||||
@@ -323,7 +324,8 @@ const nl: Translation = {
|
||||
WRITEABLE: 'Beschrijfbare',
|
||||
SHOWING: 'Tonen',
|
||||
SEARCH: 'Zoek',
|
||||
CERT: 'TLS rootcertificaat (laat leeg om TLS uit te schakelen)',
|
||||
CERT: 'TLS rootcertificaat (laat leeg om TLS-insecure)', // TODO translate
|
||||
ENABLE_TLS: 'Activeer TLS',
|
||||
ON: 'On', // TODO translate
|
||||
OFF: 'Off', // TODO translate
|
||||
POLARITY: 'Polarity', // TODO translate
|
||||
|
||||
@@ -246,6 +246,7 @@ const no: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Termostat',
|
||||
MQTT_INT_SOLAR: 'Solpaneler',
|
||||
MQTT_INT_MIXER: 'Blandeventil',
|
||||
MQTT_INT_WATER: 'Water Modules', // TODO translate
|
||||
MQTT_QUEUE: 'MQTT Queue',
|
||||
DEFAULT: 'Standard',
|
||||
MQTT_ENTITY_FORMAT: 'Enhets ID format',
|
||||
@@ -323,7 +324,8 @@ const no: Translation = {
|
||||
WRITEABLE: 'Writeable', // TODO translate
|
||||
SHOWING: 'Showing', // TODO translate
|
||||
SEARCH: 'Search', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank to disable TLS)', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank for insecure)', // TODO translate
|
||||
ENABLE_TLS: 'Aktiviser TLS',
|
||||
ON: 'On', // TODO translate
|
||||
OFF: 'Off', // TODO translate
|
||||
POLARITY: 'Polarity', // TODO translate
|
||||
|
||||
@@ -246,6 +246,7 @@ const pl: BaseTranslation = {
|
||||
MQTT_INT_THERMOSTATS: 'Termostaty',
|
||||
MQTT_INT_SOLAR: 'Panele solarne',
|
||||
MQTT_INT_MIXER: 'Mieszacze',
|
||||
MQTT_INT_WATER: 'Woda',
|
||||
MQTT_QUEUE: 'Kolejka MQTT',
|
||||
DEFAULT: '{{Pozostałe|Domyślna|}}',
|
||||
MQTT_ENTITY_FORMAT: 'Format "Entity ID"',
|
||||
@@ -323,7 +324,8 @@ const pl: BaseTranslation = {
|
||||
WRITEABLE: 'zapisywalna',
|
||||
SHOWING: 'Wyświetlane',
|
||||
SEARCH: 'Szukaj',
|
||||
CERT: 'Certyfikat główny TLS (pozostaw puste zby wyłączyć TLS)',
|
||||
CERT: 'Certyfikat główny TLS (pozostaw puste zby wyłączyć TLS-insecure)',
|
||||
ENABLE_TLS: 'Włącz wsparcie dla TLS',
|
||||
ON: 'włączony',
|
||||
OFF: 'wyłączony',
|
||||
POLARITY: 'Typ przekaźnika',
|
||||
|
||||
@@ -246,6 +246,7 @@ const sv: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Termostater',
|
||||
MQTT_INT_SOLAR: 'Solpaneler',
|
||||
MQTT_INT_MIXER: 'Blandningsventiler',
|
||||
MQTT_INT_WATER: 'Water Modules', // TODO translate
|
||||
MQTT_QUEUE: 'MQTT-kö',
|
||||
DEFAULT: 'Standard',
|
||||
MQTT_ENTITY_FORMAT: 'Entitets-ID format',
|
||||
@@ -323,7 +324,8 @@ const sv: Translation = {
|
||||
WRITEABLE: 'Writeable', // TODO translate
|
||||
SHOWING: 'Showing', // TODO translate
|
||||
SEARCH: 'Search', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank to disable TLS)', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank for insecure)', // TODO translate
|
||||
ENABLE_TLS: 'Aktivera TLS',
|
||||
ON: 'On', // TODO translate
|
||||
OFF: 'Off', // TODO translate
|
||||
POLARITY: 'Polarity', // TODO translate
|
||||
|
||||
@@ -246,6 +246,7 @@ const tr: Translation = {
|
||||
MQTT_INT_THERMOSTATS: 'Termostatlar',
|
||||
MQTT_INT_SOLAR: 'Güneş Enerjisi Modülleri',
|
||||
MQTT_INT_MIXER: 'Karışım Modülleri',
|
||||
MQTT_INT_WATER: 'Water Modules', // TODO translate
|
||||
MQTT_QUEUE: 'MQTT Sırası',
|
||||
DEFAULT: 'Varsayılan',
|
||||
MQTT_ENTITY_FORMAT: 'Varlık Kimlik biçimi',
|
||||
@@ -323,7 +324,8 @@ const tr: Translation = {
|
||||
WRITEABLE: 'Writeable', // TODO translate
|
||||
SHOWING: 'Showing', // TODO translate
|
||||
SEARCH: 'Search', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank to disable TLS)', // TODO translate
|
||||
CERT: 'TLS root certificate (leave blank for insecure)',
|
||||
ENABLE_TLS: 'TLS deveye al',
|
||||
ON: 'On', // TODO translate
|
||||
OFF: 'Off', // TODO translate
|
||||
POLARITY: 'Polarity', // TODO translate
|
||||
|
||||
@@ -2,8 +2,8 @@ import { AiOutlineControl, AiOutlineGateway, AiOutlineAlert } from 'react-icons/
|
||||
import { CgSmartHomeBoiler } from 'react-icons/cg';
|
||||
|
||||
import { FaSolarPanel } from 'react-icons/fa';
|
||||
import { GiHeatHaze } from 'react-icons/gi';
|
||||
import { MdThermostatAuto, MdOutlineSensors, MdOutlineExtension, MdOutlineDevices } from 'react-icons/md';
|
||||
import { GiHeatHaze, GiTap } from 'react-icons/gi';
|
||||
import { MdThermostatAuto, MdOutlineSensors, MdOutlineExtension, MdOutlineDevices, MdOutlinePool } from 'react-icons/md';
|
||||
import { TiFlowSwitch } from 'react-icons/ti';
|
||||
import { VscVmConnect } from 'react-icons/vsc';
|
||||
import { DeviceType } from './types';
|
||||
@@ -40,6 +40,10 @@ const DeviceIcon: FC<DeviceIconProps> = ({ type_id }) => {
|
||||
return <AiOutlineAlert />;
|
||||
case DeviceType.EXTENSION:
|
||||
return <MdOutlineDevices />;
|
||||
case DeviceType.WATER:
|
||||
return <GiTap />;
|
||||
case DeviceType.POOL:
|
||||
return <MdOutlinePool />;
|
||||
case DeviceType.CUSTOM:
|
||||
return <MdOutlineExtension />;
|
||||
default:
|
||||
|
||||
@@ -1,28 +1,83 @@
|
||||
import { Tab } from '@mui/material';
|
||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||
import HelpInformation from './HelpInformation';
|
||||
import CommentIcon from '@mui/icons-material/CommentTwoTone';
|
||||
import EastIcon from '@mui/icons-material/East';
|
||||
import GitHubIcon from '@mui/icons-material/GitHub';
|
||||
import MenuBookIcon from '@mui/icons-material/MenuBookTwoTone';
|
||||
import { Box, List, ListItem, ListItemAvatar, ListItemText, Link, Typography } from '@mui/material';
|
||||
import type { FC } from 'react';
|
||||
|
||||
import { RouterTabs, useRouterTab, useLayoutTitle } from 'components';
|
||||
|
||||
import { SectionContent, useLayoutTitle } from 'components';
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
|
||||
const Help: FC = () => {
|
||||
const { LL } = useI18nContext();
|
||||
const { routerTab } = useRouterTab();
|
||||
|
||||
useLayoutTitle(LL.HELP_OF(''));
|
||||
|
||||
const uploadURL = window.location.origin + '/system/upload';
|
||||
|
||||
return (
|
||||
<>
|
||||
<RouterTabs value={routerTab}>
|
||||
<Tab value="information" label={LL.HELP_OF('EMS-ESP')} />
|
||||
</RouterTabs>
|
||||
<Routes>
|
||||
<Route path="information" element={<HelpInformation />} />
|
||||
<Route path="/*" element={<Navigate replace to="information" />} />
|
||||
</Routes>
|
||||
</>
|
||||
<SectionContent title={LL.SUPPORT_INFORMATION()} titleGutter>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<MenuBookIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{LL.HELP_INFORMATION_1()}
|
||||
<EastIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
|
||||
<Link target="_blank" href="https://emsesp.github.io/docs" color="primary">
|
||||
{LL.CLICK_HERE()}
|
||||
</Link>
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<CommentIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{LL.HELP_INFORMATION_2()}
|
||||
<EastIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
|
||||
<Link target="_blank" href="https://discord.gg/3J3GgnzpyT" color="primary">
|
||||
{LL.CLICK_HERE()}
|
||||
</Link>
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<GitHubIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{LL.HELP_INFORMATION_3()}
|
||||
<EastIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
<Link target="_blank" href="https://github.com/emsesp/EMS-ESP32/issues/new/choose" color="primary">
|
||||
{LL.CLICK_HERE()}
|
||||
</Link>
|
||||
<br />
|
||||
<i>({LL.HELP_INFORMATION_4()}</i>
|
||||
<Link href={uploadURL} color="primary">
|
||||
{LL.UPLOAD()}
|
||||
</Link>
|
||||
)
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
||||
<Box border={1} p={1} mt={4} color="orange">
|
||||
<Typography align="center" variant="subtitle1" color="orange">
|
||||
<b>{LL.HELP_INFORMATION_5()}</b>
|
||||
</Typography>
|
||||
<Typography align="center">
|
||||
<Link target="_blank" href="https://github.com/emsesp/EMS-ESP32" color="primary">
|
||||
{'github.com/emsesp/EMS-ESP32'}
|
||||
</Link>
|
||||
</Typography>
|
||||
<Typography color="white" align="center">
|
||||
@proddy @MichaelDvP
|
||||
</Typography>
|
||||
</Box>
|
||||
</SectionContent>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
import CommentIcon from '@mui/icons-material/CommentTwoTone';
|
||||
import EastIcon from '@mui/icons-material/East';
|
||||
import GitHubIcon from '@mui/icons-material/GitHub';
|
||||
import MenuBookIcon from '@mui/icons-material/MenuBookTwoTone';
|
||||
import { Typography, Box, List, ListItem, ListItemText, Link, ListItemAvatar } from '@mui/material';
|
||||
import type { FC } from 'react';
|
||||
|
||||
import { SectionContent } from 'components';
|
||||
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
|
||||
const HelpInformation: FC = () => {
|
||||
const { LL } = useI18nContext();
|
||||
|
||||
const uploadURL = window.location.origin + '/system/upload';
|
||||
|
||||
return (
|
||||
<SectionContent title={LL.SUPPORT_INFORMATION()} titleGutter>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<MenuBookIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{LL.HELP_INFORMATION_1()}
|
||||
<EastIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
|
||||
<Link target="_blank" href="https://emsesp.github.io/docs" color="primary">
|
||||
{LL.CLICK_HERE()}
|
||||
</Link>
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<CommentIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{LL.HELP_INFORMATION_2()}
|
||||
<EastIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
|
||||
<Link target="_blank" href="https://discord.gg/3J3GgnzpyT" color="primary">
|
||||
{LL.CLICK_HERE()}
|
||||
</Link>
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<GitHubIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{LL.HELP_INFORMATION_3()}
|
||||
<EastIcon style={{ fontSize: 24, color: 'lightblue', verticalAlign: 'middle' }} />
|
||||
<Link target="_blank" href="https://github.com/emsesp/EMS-ESP32/issues/new/choose" color="primary">
|
||||
{LL.CLICK_HERE()}
|
||||
</Link>
|
||||
<br />
|
||||
<i>({LL.HELP_INFORMATION_4()}</i>
|
||||
<Link href={uploadURL} color="primary">
|
||||
{LL.UPLOAD()}
|
||||
</Link>
|
||||
)
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
||||
<Box border={1} p={1} mt={4} color="orange">
|
||||
<Typography align="center" variant="subtitle1" color="orange">
|
||||
<b>{LL.HELP_INFORMATION_5()}</b>
|
||||
</Typography>
|
||||
<Typography align="center">
|
||||
<Link target="_blank" href="https://github.com/emsesp/EMS-ESP32" color="primary">
|
||||
{'github.com/emsesp/EMS-ESP32'}
|
||||
</Link>
|
||||
</Typography>
|
||||
<Typography color="white" align="center">
|
||||
@proddy @MichaelDvP
|
||||
</Typography>
|
||||
</Box>
|
||||
</SectionContent>
|
||||
);
|
||||
};
|
||||
|
||||
export default HelpInformation;
|
||||
@@ -23,7 +23,7 @@ import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-li
|
||||
import { useTheme } from '@table-library/react-table-library/theme';
|
||||
import { useRequest } from 'alova';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { unstable_useBlocker as useBlocker, useLocation } from 'react-router-dom';
|
||||
import { useBlocker, useLocation } from 'react-router-dom';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
import EntityMaskToggle from './EntityMaskToggle';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useTheme } from '@table-library/react-table-library/theme';
|
||||
// eslint-disable-next-line import/named
|
||||
import { updateState, useRequest } from 'alova';
|
||||
import { useState, useCallback } from 'react';
|
||||
import { unstable_useBlocker as useBlocker } from 'react-router-dom';
|
||||
import { useBlocker } from 'react-router-dom';
|
||||
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
@@ -189,8 +189,8 @@ const SettingsEntities: FC = () => {
|
||||
return value === undefined || uom === undefined
|
||||
? ''
|
||||
: typeof value === 'number'
|
||||
? new Intl.NumberFormat().format(value) + (uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom])
|
||||
: value;
|
||||
? new Intl.NumberFormat().format(value) + (uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom])
|
||||
: value;
|
||||
}
|
||||
|
||||
function showHex(value: number, digit: number) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useTheme } from '@table-library/react-table-library/theme';
|
||||
// eslint-disable-next-line import/named
|
||||
import { updateState, useRequest } from 'alova';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { unstable_useBlocker as useBlocker } from 'react-router-dom';
|
||||
import { useBlocker } from 'react-router-dom';
|
||||
import { toast } from 'react-toastify';
|
||||
import SettingsSchedulerDialog from './SettingsSchedulerDialog';
|
||||
import * as EMSESP from './api';
|
||||
|
||||
@@ -130,7 +130,7 @@ export interface DeviceValue {
|
||||
c?: string; // command, optional
|
||||
l?: string[]; // list, optional
|
||||
h?: string; // help text, optional
|
||||
s?: number; // steps for up/down, optional
|
||||
s?: string; // steps for up/down, optional
|
||||
m?: number; // min, optional
|
||||
x?: number; // max, optional
|
||||
}
|
||||
@@ -355,6 +355,7 @@ export const enum DeviceType {
|
||||
TEMPERATURESENSOR,
|
||||
ANALOGSENSOR,
|
||||
SCHEDULER,
|
||||
CUSTOM,
|
||||
BOILER,
|
||||
THERMOSTAT,
|
||||
MIXER,
|
||||
@@ -368,7 +369,9 @@ export const enum DeviceType {
|
||||
EXTENSION,
|
||||
GENERIC,
|
||||
HEATSOURCE,
|
||||
CUSTOM,
|
||||
VENTILATION,
|
||||
WATER,
|
||||
POOL,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface MqttSettings {
|
||||
port: number;
|
||||
base: string;
|
||||
rootCA?: string;
|
||||
enableTLS?: boolean;
|
||||
username: string;
|
||||
password: string;
|
||||
client_id: string;
|
||||
@@ -35,6 +36,7 @@ export interface MqttSettings {
|
||||
publish_time_thermostat: number;
|
||||
publish_time_solar: number;
|
||||
publish_time_mixer: number;
|
||||
publish_time_water: number;
|
||||
publish_time_other: number;
|
||||
publish_time_sensor: number;
|
||||
publish_time_heartbeat: number;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useRequest, type Method } from 'alova';
|
||||
import { useState } from 'react';
|
||||
import { unstable_useBlocker as useBlocker } from 'react-router-dom';
|
||||
import { useBlocker } from 'react-router-dom';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
|
||||
@@ -5,7 +5,6 @@ import viteImagemin from 'vite-plugin-imagemin';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
// standalone build for development - runs the server
|
||||
if (command === 'serve') {
|
||||
console.log('Preparing for standalone build with server, mode=' + mode);
|
||||
return {
|
||||
@@ -30,9 +29,17 @@ export default defineConfig(({ command, mode }) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (command === 'build' && mode === 'hosted') {
|
||||
return {
|
||||
plugins: [preact(), viteTsconfigPaths()],
|
||||
build: {
|
||||
chunkSizeWarningLimit: 1024
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// production build, both for hosted and building the firmware
|
||||
if (command === 'build') {
|
||||
console.log('Preparing for production build, mode is ' + mode);
|
||||
return {
|
||||
plugins: [
|
||||
preact(),
|
||||
@@ -79,11 +86,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
|
||||
build: {
|
||||
// target: 'es2022',
|
||||
outDir: 'dist',
|
||||
reportCompressedSize: false,
|
||||
chunkSizeWarningLimit: 1024,
|
||||
sourcemap: false,
|
||||
manifest: false,
|
||||
minify: 'terser',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
@@ -109,16 +112,6 @@ export default defineConfig(({ command, mode }) => {
|
||||
nameCache: null,
|
||||
safari10: false,
|
||||
toplevel: false
|
||||
},
|
||||
|
||||
rollupOptions: {
|
||||
// Ignore "use client" waning since we are not using SSR
|
||||
onwarn(warning, warn) {
|
||||
if (warning.code === 'MODULE_LEVEL_DIRECTIVE' && warning.message.includes(`"use client"`)) {
|
||||
return;
|
||||
}
|
||||
warn(warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,10 @@ the LICENSE file.
|
||||
#define EMC_TASK_STACK_SIZE 5120
|
||||
#endif
|
||||
|
||||
#ifndef EMC_MULTIPLE_CALLBACKS
|
||||
#define EMC_MULTIPLE_CALLBACKS 0
|
||||
#endif
|
||||
|
||||
#ifndef EMC_USE_WATCHDOG
|
||||
#define EMC_USE_WATCHDOG 0
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,11 @@ the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#include "MqttClient.h"
|
||||
|
||||
template <typename T>
|
||||
@@ -73,36 +78,128 @@ class MqttClientSetup : public MqttClient {
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& onConnect(espMqttClientTypes::OnConnectCallback callback) {
|
||||
T& onConnect(espMqttClientTypes::OnConnectCallback callback, uint32_t id = 0) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onConnectCallbacks.emplace_back(callback, id);
|
||||
#else
|
||||
(void) id;
|
||||
_onConnectCallback = callback;
|
||||
#endif
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& onDisconnect(espMqttClientTypes::OnDisconnectCallback callback) {
|
||||
T& onDisconnect(espMqttClientTypes::OnDisconnectCallback callback, uint32_t id = 0) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onDisconnectCallbacks.emplace_back(callback, id);
|
||||
#else
|
||||
(void) id;
|
||||
_onDisconnectCallback = callback;
|
||||
#endif
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& onSubscribe(espMqttClientTypes::OnSubscribeCallback callback) {
|
||||
T& onSubscribe(espMqttClientTypes::OnSubscribeCallback callback, uint32_t id = 0) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onSubscribeCallbacks.emplace_back(callback, id);
|
||||
#else
|
||||
(void) id;
|
||||
_onSubscribeCallback = callback;
|
||||
#endif
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& onUnsubscribe(espMqttClientTypes::OnUnsubscribeCallback callback) {
|
||||
T& onUnsubscribe(espMqttClientTypes::OnUnsubscribeCallback callback, uint32_t id = 0) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onUnsubscribeCallbacks.emplace_back(callback, id);
|
||||
#else
|
||||
(void) id;
|
||||
_onUnsubscribeCallback = callback;
|
||||
#endif
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& onMessage(espMqttClientTypes::OnMessageCallback callback) {
|
||||
T& onMessage(espMqttClientTypes::OnMessageCallback callback, uint32_t id = 0) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onMessageCallbacks.emplace_back(callback, id);
|
||||
#else
|
||||
(void) id;
|
||||
_onMessageCallback = callback;
|
||||
#endif
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& onPublish(espMqttClientTypes::OnPublishCallback callback) {
|
||||
T& onPublish(espMqttClientTypes::OnPublishCallback callback, uint32_t id = 0) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onPublishCallbacks.emplace_back(callback, id);
|
||||
#else
|
||||
(void) id;
|
||||
_onPublishCallback = callback;
|
||||
#endif
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
T& removeOnConnect(uint32_t id) {
|
||||
for (auto it = _onConnectCallbacks.begin(); it != _onConnectCallbacks.end(); ++it) {
|
||||
if (it->second == id) {
|
||||
_onConnectCallbacks.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& removeOnDisconnect(uint32_t id) {
|
||||
for (auto it = _onDisconnectCallbacks.begin(); it != _onDisconnectCallbacks.end(); ++it) {
|
||||
if (it->second == id) {
|
||||
_onDisconnectCallbacks.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& removeOnSubscribe(uint32_t id) {
|
||||
for (auto it = _onSubscribeCallbacks.begin(); it != _onSubscribeCallbacks.end(); ++it) {
|
||||
if (it->second == id) {
|
||||
_onSubscribeCallbacks.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& removeOnUnsubscribe(uint32_t id) {
|
||||
for (auto it = _onUnsubscribeCallbacks.begin(); it != _onUnsubscribeCallbacks.end(); ++it) {
|
||||
if (it->second == id) {
|
||||
_onUnsubscribeCallbacks.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& removeOnMessage(uint32_t id) {
|
||||
for (auto it = _onMessageCallbacks.begin(); it != _onMessageCallbacks.end(); ++it) {
|
||||
if (it->second == id) {
|
||||
_onMessageCallbacks.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
|
||||
T& removeOnPublish(uint32_t id) {
|
||||
for (auto it = _onPublishCallbacks.begin(); it != _onPublishCallbacks.end(); ++it) {
|
||||
if (it->second == id) {
|
||||
_onPublishCallbacks.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return static_cast<T&>(*this);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
T& onError(espMqttClientTypes::OnErrorCallback callback) {
|
||||
_onErrorCallback = callback;
|
||||
@@ -112,5 +209,37 @@ class MqttClientSetup : public MqttClient {
|
||||
|
||||
protected:
|
||||
explicit MqttClientSetup(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority = 1, uint8_t core = 1)
|
||||
: MqttClient(useInternalTask, priority, core) {}
|
||||
: MqttClient(useInternalTask, priority, core) {
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
_onConnectCallback = [this](bool sessionPresent) {
|
||||
for (auto callback : _onConnectCallbacks) if (callback.first) callback.first(sessionPresent);
|
||||
};
|
||||
_onDisconnectCallback = [this](espMqttClientTypes::DisconnectReason reason) {
|
||||
for (auto callback : _onDisconnectCallbacks) if (callback.first) callback.first(reason);
|
||||
};
|
||||
_onSubscribeCallback = [this](uint16_t packetId, const espMqttClientTypes::SubscribeReturncode* returncodes, size_t len) {
|
||||
for (auto callback : _onSubscribeCallbacks) if (callback.first) callback.first(packetId, returncodes, len);
|
||||
};
|
||||
_onUnsubscribeCallback = [this](int16_t packetId) {
|
||||
for (auto callback : _onUnsubscribeCallbacks) if (callback.first) callback.first(packetId);
|
||||
};
|
||||
_onMessageCallback = [this](const espMqttClientTypes::MessageProperties& properties, const char* topic, const uint8_t* payload, size_t len, size_t index, size_t total) {
|
||||
for (auto callback : _onMessageCallbacks) if (callback.first) callback.first(properties, topic, payload, len, index, total);
|
||||
};
|
||||
_onPublishCallback = [this](uint16_t packetId) {
|
||||
for (auto callback : _onPublishCallbacks) if (callback.first) callback.first(packetId);
|
||||
};
|
||||
#else
|
||||
// empty
|
||||
#endif
|
||||
}
|
||||
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
std::list<std::pair<espMqttClientTypes::OnConnectCallback, uint32_t>> _onConnectCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnDisconnectCallback, uint32_t>> _onDisconnectCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnSubscribeCallback, uint32_t>> _onSubscribeCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnUnsubscribeCallback, uint32_t>> _onUnsubscribeCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnMessageCallback, uint32_t>> _onMessageCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnPublishCallback, uint32_t>> _onPublishCallbacks;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -51,13 +51,13 @@ void MqttSettingsService::startClient() {
|
||||
static bool isSecure = false;
|
||||
if (_mqttClient != nullptr) {
|
||||
// do we need to change the client?
|
||||
if ((isSecure && _state.rootCA.length() > 0) || (!isSecure && _state.rootCA.length() == 0)) {
|
||||
if ((isSecure && _state.enableTLS) || (!isSecure && _state.enableTLS)) {
|
||||
return;
|
||||
}
|
||||
delete _mqttClient;
|
||||
}
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
if (_state.rootCA.length() > 0) {
|
||||
if (_state.enableTLS) {
|
||||
isSecure = true;
|
||||
_mqttClient = static_cast<MqttClient *>(new espMqttClientSecure(espMqttClientTypes::UseInternalTask::NO));
|
||||
if (_state.rootCA == "insecure") {
|
||||
@@ -100,7 +100,7 @@ const char * MqttSettingsService::getClientId() {
|
||||
|
||||
void MqttSettingsService::setWill(const char * topic) {
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
if (_state.rootCA.length() > 0) {
|
||||
if (_state.enableTLS) {
|
||||
static_cast<espMqttClientSecure *>(_mqttClient)->setWill(topic, 1, true, "offline");
|
||||
return;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void MqttSettingsService::setWill(const char * topic) {
|
||||
|
||||
void MqttSettingsService::onMessage(espMqttClientTypes::OnMessageCallback callback) {
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
if (_state.rootCA.length() > 0) {
|
||||
if (_state.enableTLS) {
|
||||
static_cast<espMqttClientSecure *>(_mqttClient)->onMessage(callback);
|
||||
return;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ bool MqttSettingsService::configureMqtt() {
|
||||
if (_state.enabled && emsesp::EMSESP::system_.network_connected() && !_state.host.isEmpty()) {
|
||||
_reconfigureMqtt = false;
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
if (_state.rootCA.length() > 0) {
|
||||
if (_state.enableTLS) {
|
||||
// emsesp::EMSESP::logger().info("Start secure MQTT with rootCA");
|
||||
static_cast<espMqttClientSecure *>(_mqttClient)->setServer(retainCstr(_state.host.c_str(), &_retainedHost), _state.port);
|
||||
if (_state.username.length() > 0) {
|
||||
@@ -217,7 +217,8 @@ bool MqttSettingsService::configureMqtt() {
|
||||
|
||||
void MqttSettings::read(MqttSettings & settings, JsonObject & root) {
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
root["rootCA"] = settings.rootCA;
|
||||
root["enableTLS"] = settings.enableTLS;
|
||||
root["rootCA"] = settings.rootCA;
|
||||
#endif
|
||||
root["enabled"] = settings.enabled;
|
||||
root["host"] = settings.host;
|
||||
@@ -234,6 +235,7 @@ void MqttSettings::read(MqttSettings & settings, JsonObject & root) {
|
||||
root["publish_time_thermostat"] = settings.publish_time_thermostat;
|
||||
root["publish_time_solar"] = settings.publish_time_solar;
|
||||
root["publish_time_mixer"] = settings.publish_time_mixer;
|
||||
root["publish_time_water"] = settings.publish_time_water;
|
||||
root["publish_time_other"] = settings.publish_time_other;
|
||||
root["publish_time_sensor"] = settings.publish_time_sensor;
|
||||
root["publish_time_heartbeat"] = settings.publish_time_heartbeat;
|
||||
@@ -253,7 +255,8 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting
|
||||
bool changed = false;
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
newSettings.rootCA = root["rootCA"] | "";
|
||||
newSettings.enableTLS = root["enableTLS"] | false;
|
||||
newSettings.rootCA = root["rootCA"] | "";
|
||||
#endif
|
||||
newSettings.enabled = root["enabled"] | FACTORY_MQTT_ENABLED;
|
||||
newSettings.host = root["host"] | FACTORY_MQTT_HOST;
|
||||
@@ -271,6 +274,7 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting
|
||||
newSettings.publish_time_thermostat = root["publish_time_thermostat"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_solar = root["publish_time_solar"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_mixer = root["publish_time_mixer"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_water = root["publish_time_water"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_other = root["publish_time_other"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_sensor = root["publish_time_sensor"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_heartbeat = root["publish_time_heartbeat"] | EMSESP_DEFAULT_PUBLISH_HEARTBEAT;
|
||||
@@ -358,6 +362,10 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting
|
||||
emsesp::EMSESP::mqtt_.set_publish_time_mixer(newSettings.publish_time_mixer);
|
||||
}
|
||||
|
||||
if (newSettings.publish_time_water != settings.publish_time_water) {
|
||||
emsesp::EMSESP::mqtt_.set_publish_time_water(newSettings.publish_time_water);
|
||||
}
|
||||
|
||||
if (newSettings.publish_time_other != settings.publish_time_other) {
|
||||
emsesp::EMSESP::mqtt_.set_publish_time_other(newSettings.publish_time_other);
|
||||
}
|
||||
@@ -377,10 +385,10 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting
|
||||
newSettings.rootCA.replace("-----BEGIN CERTIFICATE-----", "");
|
||||
newSettings.rootCA.replace("-----END CERTIFICATE-----", "");
|
||||
newSettings.rootCA.replace(" ", "");
|
||||
if (newSettings.rootCA.length() == 0 && newSettings.port > 8800) {
|
||||
if (newSettings.rootCA.length() == 0 && newSettings.enableTLS) {
|
||||
newSettings.rootCA = "insecure";
|
||||
}
|
||||
if (newSettings.rootCA != settings.rootCA) {
|
||||
if (newSettings.enableTLS != settings.enableTLS || newSettings.rootCA != settings.rootCA) {
|
||||
changed = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -64,6 +64,7 @@ class MqttSettings {
|
||||
String host;
|
||||
uint16_t port;
|
||||
String rootCA;
|
||||
bool enableTLS;
|
||||
|
||||
// username and password
|
||||
String username;
|
||||
@@ -82,6 +83,7 @@ class MqttSettings {
|
||||
uint16_t publish_time_thermostat;
|
||||
uint16_t publish_time_solar;
|
||||
uint16_t publish_time_mixer;
|
||||
uint16_t publish_time_water;
|
||||
uint16_t publish_time_other;
|
||||
uint16_t publish_time_sensor;
|
||||
uint16_t publish_time_heartbeat;
|
||||
|
||||
@@ -42,7 +42,7 @@ class Preferences {
|
||||
}
|
||||
|
||||
double getDouble(const char * key, double defaultValue = NAN) {
|
||||
return NAN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t putString(const char * key, const char * value) {
|
||||
|
||||
@@ -324,7 +324,7 @@ security_settings = {
|
||||
]
|
||||
};
|
||||
const features = {
|
||||
version: 'v3.6.0-demo',
|
||||
version: 'v3.6-demo',
|
||||
// platform: 'ESP32'
|
||||
platform: 'ESP32-S3'
|
||||
};
|
||||
@@ -353,6 +353,54 @@ const EMSESP_RESET_CUSTOMIZATIONS_ENDPOINT = REST_ENDPOINT_ROOT + 'resetCustomiz
|
||||
const EMSESP_WRITE_SCHEDULE_ENDPOINT = REST_ENDPOINT_ROOT + 'schedule';
|
||||
const EMSESP_WRITE_ENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'entities';
|
||||
|
||||
const emsesp_info = {
|
||||
System: {
|
||||
version: '3.6.5',
|
||||
uptime: '001+06:40:34.018',
|
||||
'uptime (seconds)': 110434,
|
||||
freemem: 131,
|
||||
'reset reason': 'Software reset CPU / Software reset CPU',
|
||||
'Sensor sensors': 3
|
||||
},
|
||||
Network: {
|
||||
connection: 'Ethernet',
|
||||
hostname: 'ems-esp',
|
||||
MAC: 'A8:03:2A:62:64:CF',
|
||||
'IPv4 address': '192.168.1.134/255.255.255.0',
|
||||
'IPv4 gateway': '192.168.1.1',
|
||||
'IPv4 nameserver': '192.168.1.1'
|
||||
},
|
||||
Status: {
|
||||
'bus status': 'connected',
|
||||
'bus protocol': 'Buderus',
|
||||
'telegrams received': 84986,
|
||||
'read requests sent': 14748,
|
||||
'write requests sent': 3,
|
||||
'incomplete telegrams': 8,
|
||||
'tx fails': 0,
|
||||
'rx line quality': 100,
|
||||
'tx line quality': 100,
|
||||
MQTT: 'connected',
|
||||
'MQTT publishes': 46336,
|
||||
'MQTT publish fails': 0,
|
||||
'Sensor reads': 22086,
|
||||
'Sensor fails': 0
|
||||
},
|
||||
Devices: [
|
||||
{
|
||||
type: 'Boiler',
|
||||
name: 'Nefit GBx72/Trendline/Cerapur/Greenstar Si/27i (DeviceID:0x08 ProductID:123, Version:06.01)',
|
||||
handlers:
|
||||
'0x10 0x11 0xC2 0x14 0x15 0x1C 0x18 0x19 0x1A 0x35 0x16 0x33 0x34 0x26 0x2A 0xD1 0xE3 0xE4 0xE5 0xE6 0xE9 0xEA'
|
||||
},
|
||||
{
|
||||
type: 'Thermostat',
|
||||
name: 'RC20/Moduline 300 (DeviceID:0x17, ProductID:77, Version:03.03)',
|
||||
handlers: '0xA3 0x06 0xA2 0x12 0x91 0xA8'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
settings = {
|
||||
locale: 'en',
|
||||
tx_mode: 4,
|
||||
@@ -2638,53 +2686,6 @@ rest_server.get(EMSESP_BOARDPROFILE_ENDPOINT, (req, res) => {
|
||||
});
|
||||
|
||||
// EMS-ESP API specific
|
||||
const emsesp_info = {
|
||||
System: {
|
||||
version: '3.6.2',
|
||||
uptime: '001+06:40:34.018',
|
||||
'uptime (seconds)': 110434,
|
||||
freemem: 131,
|
||||
'reset reason': 'Software reset CPU / Software reset CPU',
|
||||
'Sensor sensors': 3
|
||||
},
|
||||
Network: {
|
||||
connection: 'Ethernet',
|
||||
hostname: 'ems-esp',
|
||||
MAC: 'A8:03:2A:62:64:CF',
|
||||
'IPv4 address': '192.168.1.134/255.255.255.0',
|
||||
'IPv4 gateway': '192.168.1.1',
|
||||
'IPv4 nameserver': '192.168.1.1'
|
||||
},
|
||||
Status: {
|
||||
'bus status': 'connected',
|
||||
'bus protocol': 'Buderus',
|
||||
'telegrams received': 84986,
|
||||
'read requests sent': 14748,
|
||||
'write requests sent': 3,
|
||||
'incomplete telegrams': 8,
|
||||
'tx fails': 0,
|
||||
'rx line quality': 100,
|
||||
'tx line quality': 100,
|
||||
MQTT: 'connected',
|
||||
'MQTT publishes': 46336,
|
||||
'MQTT publish fails': 0,
|
||||
'Sensor reads': 22086,
|
||||
'Sensor fails': 0
|
||||
},
|
||||
Devices: [
|
||||
{
|
||||
type: 'Boiler',
|
||||
name: 'Nefit GBx72/Trendline/Cerapur/Greenstar Si/27i (DeviceID:0x08 ProductID:123, Version:06.01)',
|
||||
handlers:
|
||||
'0x10 0x11 0xC2 0x14 0x15 0x1C 0x18 0x19 0x1A 0x35 0x16 0x33 0x34 0x26 0x2A 0xD1 0xE3 0xE4 0xE5 0xE6 0xE9 0xEA'
|
||||
},
|
||||
{
|
||||
type: 'Thermostat',
|
||||
name: 'RC20/Moduline 300 (DeviceID:0x17, ProductID:77, Version:03.03)',
|
||||
handlers: '0xA3 0x06 0xA2 0x12 0x91 0xA8'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
rest_server.post(API_ENDPOINT_ROOT, (req, res) => {
|
||||
console.log('Generic API POST');
|
||||
|
||||
@@ -83,8 +83,8 @@ extra_scripts = scripts/rename_fw.py
|
||||
board = esp32dev
|
||||
board_build.partitions = esp32_partition_4M.csv
|
||||
board_build.extra_flags = -DBOARD_HAS_PSRAM
|
||||
build_flags = ${common.build_flags}
|
||||
build_unflags = ${common.unbuild_flags}
|
||||
build_flags = ${common.build_flags}
|
||||
|
||||
[env:ci_s3]
|
||||
extends = espressi32_base
|
||||
@@ -93,10 +93,11 @@ board = lolin_s3
|
||||
board_build.f_cpu = 240000000L
|
||||
board_upload.flash_size = 16MB
|
||||
board_build.partitions = esp32_partition_16M.csv
|
||||
build_unflags = ${common.unbuild_flags}
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
-O2
|
||||
build_unflags = ${common.unbuild_flags}
|
||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"'
|
||||
|
||||
[env:esp32_4M]
|
||||
extends = espressi32_base_tasmota
|
||||
@@ -129,7 +130,7 @@ board_upload.flash_size = 4MB
|
||||
board_build.partitions = esp32_partition_4M.csv
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
-DEMSESP_DEFAULT_BOARD_PROFILE = "C3MINI"
|
||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="C3MINI"'
|
||||
|
||||
; lolin C3 mini v1 needs special wifi init.
|
||||
; https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
||||
@@ -141,7 +142,7 @@ board_build.partitions = esp32_partition_4M.csv
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
-DBOARD_C3_MINI_V1
|
||||
-DEMSESP_DEFAULT_BOARD_PROFILE = "C3MINI"
|
||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="C3MINI"'
|
||||
|
||||
[env:lolin_s2_mini]
|
||||
extends = espressi32_base_tasmota
|
||||
@@ -150,7 +151,7 @@ board_upload.flash_size = 4MB
|
||||
board_build.partitions = esp32_partition_4M.csv
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
-DEMSESP_DEFAULT_BOARD_PROFILE = "S2MINI"
|
||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="S2MINI"'
|
||||
|
||||
[env:lolin_s3]
|
||||
extends = espressi32_base
|
||||
@@ -163,7 +164,7 @@ board_upload.wait_for_upload_port = false
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
-O2
|
||||
-DEMSESP_DEFAULT_BOARD_PROFILE = "S32S3"
|
||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"'
|
||||
|
||||
; to build and run: pio run -e standalone -t exec
|
||||
[env:standalone]
|
||||
@@ -171,7 +172,7 @@ platform = native
|
||||
build_flags =
|
||||
-DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0
|
||||
-DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -D__linux__
|
||||
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.0-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
||||
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.4-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
||||
-lpthread
|
||||
-std=gnu++11 -Og -ggdb
|
||||
build_src_flags =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
sonar.organization=emsesp
|
||||
sonar.projectKey=emsesp_EMS-ESP32
|
||||
sonar.projectName=EMS-ESP32
|
||||
sonar.projectVersion=3.6.0
|
||||
sonar.projectVersion=3.6.5
|
||||
sonar.sources=./src
|
||||
sonar.cfamily.build-wrapper-output=bw-output
|
||||
sonar.sourceEncoding=UTF-8
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{203, DeviceType::THERMOSTAT, "EasyControl/CT200", DeviceFlags::EMS_DEVICE_FLAG_EASY | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
|
||||
// Thermostat - Buderus/Nefit/Bosch specific - 0x17 / 0x10 / 0x18 / 0x19-0x1B for hc2-4 / 0x38
|
||||
{ 4, DeviceType::THERMOSTAT, "UI800/BC400", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{ 4, DeviceType::THERMOSTAT, "UI800/BC400", DeviceFlags::EMS_DEVICE_FLAG_BC400}, // 0x10
|
||||
{ 65, DeviceType::THERMOSTAT, "RC10", DeviceFlags::EMS_DEVICE_FLAG_RC20_N},// 0x17
|
||||
{ 67, DeviceType::THERMOSTAT, "RC30", DeviceFlags::EMS_DEVICE_FLAG_RC30_N},// 0x10 - based on RC35
|
||||
{ 77, DeviceType::THERMOSTAT, "RC20/Moduline 300", DeviceFlags::EMS_DEVICE_FLAG_RC20},// 0x17
|
||||
@@ -101,7 +101,7 @@
|
||||
{215, DeviceType::THERMOSTAT, "Comfort RF", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{216, DeviceType::THERMOSTAT, "CRF200S", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{246, DeviceType::THERMOSTAT, "Comfort+2RF", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{253, DeviceType::THERMOSTAT, "Rego 3000/UI800/WSW196i/BC400", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{253, DeviceType::THERMOSTAT, "Rego 3000/UI800/WSW196i/BC400", DeviceFlags::EMS_DEVICE_FLAG_BC400}, // 0x10
|
||||
|
||||
// Thermostat - Sieger - 0x10 / 0x17
|
||||
{ 66, DeviceType::THERMOSTAT, "ES72/RC20", DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17 or remote
|
||||
@@ -142,7 +142,7 @@
|
||||
{160, DeviceType::MIXER, "MM100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{161, DeviceType::MIXER, "MM200", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{193, DeviceType::MIXER, "MZ100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{204, DeviceType::MIXER, "MP100", DeviceFlags::EMS_DEVICE_FLAG_MP}, // pool
|
||||
{204, DeviceType::POOL, "MP100", DeviceFlags::EMS_DEVICE_FLAG_MP}, // pool
|
||||
|
||||
// Heat Pumps - 0x38? This is a thermostat like RC100H
|
||||
// also prod-id of wifi module and wireless base
|
||||
|
||||
@@ -179,7 +179,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
DeviceValueUOM::DEGREES);
|
||||
|
||||
// exclude burner related entities from heatpump and HIU
|
||||
if (model() != EMS_DEVICE_FLAG_HEATPUMP && model() != EMS_DEVICE_FLAG_HIU) {
|
||||
if (model() != EMSdevice::EMS_DEVICE_FLAG_HEATPUMP && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&exhaustTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
@@ -230,6 +230,16 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &boilHystOn_, DeviceValueType::INT, FL_(boilHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst_on), -20, 0);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &boilHystOff_, DeviceValueType::INT, FL_(boilHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst_off), 0, 20);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &boil2HystOn_, DeviceValueType::INT, FL_(boil2HystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_hyst2_on), -20, 0);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&boil2HystOff_,
|
||||
DeviceValueType::INT,
|
||||
FL_(boil2HystOff),
|
||||
DeviceValueUOM::DEGREES_R,
|
||||
MAKE_CF_CB(set_hyst2_off),
|
||||
0,
|
||||
20);
|
||||
}
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatingActivated_,
|
||||
@@ -367,7 +377,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
*/
|
||||
|
||||
// heatpump info
|
||||
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_HEATPUMP) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&nrgTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
@@ -399,6 +409,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||
FL_(meterEHeat),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&meterHeat_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||
FL_(meterHeat),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&upTimeTotal_,
|
||||
DeviceValueType::TIME,
|
||||
@@ -460,6 +476,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgSuppCooling_, DeviceValueType::ULONG, FL_(nrgSuppCooling), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgSuppPool_, DeviceValueType::ULONG, FL_(nrgSuppPool), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpPower_, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpPower), DeviceValueUOM::KW);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hpMaxPower_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(hpMaxPower),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_hpMaxPower));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpCompOn_, DeviceValueType::BOOL, FL_(hpCompOn), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpActivity_, DeviceValueType::ENUM, FL_(enum_hpactivity), FL_(hpActivity), DeviceValueUOM::NONE);
|
||||
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpHeatingOn_, DeviceValueType::BOOL, FL_(hpHeatingOn), DeviceValueUOM::NONE);
|
||||
@@ -720,6 +742,13 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_elHeatStep3));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpEA0_, DeviceValueType::BOOL, FL_(hpEA0), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hpPumpMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_hpPumpMode),
|
||||
FL_(hpPumpMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_hpPumpMode));
|
||||
// heatpump DHW settings
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wwAlternatingOper_,
|
||||
@@ -944,7 +973,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
EMSESP::send_read_request(0xC2, device_id); // read last errorcode on start (only published on errors)
|
||||
|
||||
|
||||
if (model() != EMS_DEVICE_FLAG_HEATPUMP && model() != EMS_DEVICE_FLAG_HIU) {
|
||||
if (model() != EMSdevice::EMS_DEVICE_FLAG_HEATPUMP && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
||||
register_telegram_type(0x04, "UBAFactory", true, MAKE_PF_CB(process_UBAFactory));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nomPower_, DeviceValueType::UINT, FL_(nomPower), DeviceValueUOM::KW, MAKE_CF_CB(set_nomPower));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
@@ -1065,7 +1094,7 @@ void Boiler::check_active() {
|
||||
}
|
||||
|
||||
// calculate energy for boiler 0x08 from stored modulation an time in units of 0.01 Wh
|
||||
if (model() != EMS_DEVICE_FLAG_HEATPUMP) {
|
||||
if (model() != EMSdevice::EMS_DEVICE_FLAG_HEATPUMP && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
||||
// remember values from last call
|
||||
static uint32_t powLastReadTime_ = uuid::get_uptime();
|
||||
static uint8_t heatBurnPow = 0;
|
||||
@@ -1308,10 +1337,10 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram
|
||||
|
||||
// at this point do a quick check to see if the hot water or heating is active
|
||||
uint8_t state = EMS_VALUE_UINT_NOTSET;
|
||||
if (telegram->read_value(state, 11)) {
|
||||
boilerState_ = state & 0x01 ? 0x08 : 0;
|
||||
boilerState_ |= state & 0x02 ? 0x01 : 0;
|
||||
boilerState_ |= state & 0x04 ? 0x02 : 0;
|
||||
if (telegram->read_value(state, 11) && model() != EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
||||
boilerState_ = state & 0x01 ? 0x08 : 0; // burnGas
|
||||
boilerState_ |= state & 0x02 ? 0x01 : 0; // heatingPump
|
||||
boilerState_ |= state & 0x04 ? 0x02 : 0; // 3-way-valve
|
||||
}
|
||||
|
||||
if (telegram->offset <= 10 && telegram->offset + telegram->message_length > 11) {
|
||||
@@ -1347,6 +1376,17 @@ void Boiler::process_UBAMonitorSlow(std::shared_ptr<const Telegram> telegram) {
|
||||
*/
|
||||
void Boiler::process_UBAMonitorSlowPlus2(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, absBurnPow_, 13); // current burner absolute power (percent of rating plate power)
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_HIU) {
|
||||
uint8_t state = EMS_VALUE_UINT_NOTSET;
|
||||
boilerState_ = 0;
|
||||
if (telegram->read_value(state, 2)) {
|
||||
boilerState_ |= state == 1 ? 0x09 : 0; // heating 0/1
|
||||
}
|
||||
state = EMS_VALUE_UINT_NOTSET;
|
||||
if (telegram->read_value(state, 5)) {
|
||||
boilerState_ |= state == 1 ? 0x0A : 0; // dhw 0/1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1800,6 +1840,7 @@ void Boiler::process_HpSilentMode(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, hpHystCool_, 35); // is / 5, maybe offset swapped with pool
|
||||
has_update(telegram, hpHystPool_, 33); // is / 5
|
||||
has_update(telegram, hpCircPumpWw_, 46);
|
||||
has_update(telegram, hpMaxPower_, 31);
|
||||
has_update(telegram, silentFrom_, 52); // in steps of 15 min
|
||||
has_update(telegram, silentTo_, 53); // in steps of 15 min
|
||||
}
|
||||
@@ -1815,6 +1856,7 @@ void Boiler::process_HpValve(std::shared_ptr<const Telegram> telegram) {
|
||||
void Boiler::process_HpPumps(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, tempDiffHeat_, 4); // is * 10
|
||||
has_update(telegram, tempDiffCool_, 3); // is * 10
|
||||
has_update(telegram, hpPumpMode_, 18);
|
||||
}
|
||||
|
||||
// Boiler(0x08) -> All(0x00), ?(0x0491), data: 03 01 00 00 00 02 64 00 00 14 01 2C 00 0A 00 1E 00 1E 00 00 1E 0A 1E 05 05
|
||||
@@ -1871,6 +1913,7 @@ void Boiler::process_HpMeters(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, meterTotal_, 0);
|
||||
has_update(telegram, meterComp_, 4);
|
||||
has_update(telegram, meterEHeat_, 8);
|
||||
has_update(telegram, meterHeat_, 24);
|
||||
}
|
||||
|
||||
// HIU unit
|
||||
@@ -2001,7 +2044,7 @@ bool Boiler::set_ww_temp(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
// write_command(EMS_TYPE_UBAFlags, 3, v, EMS_TYPE_UBAParameterWWPlus); // test for #96
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 6, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
@@ -2054,7 +2097,7 @@ bool Boiler::set_ww_disinfect_temp(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 12, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 8, v, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2104,7 +2147,7 @@ bool Boiler::set_ww_flowTempOffset(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 9, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 5, v, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2120,7 +2163,7 @@ bool Boiler::set_heating_activated(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 0, v ? 0x01 : 0, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 0, v ? 0xFF : 0, EMS_TYPE_UBAParameters);
|
||||
@@ -2136,7 +2179,7 @@ bool Boiler::set_heating_temp(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 1, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 1, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2152,7 +2195,7 @@ bool Boiler::set_min_power(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 5, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 3, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2168,7 +2211,7 @@ bool Boiler::set_max_power(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 4, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 2, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2184,7 +2227,7 @@ bool Boiler::set_ww_hyst_on(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 7, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 3, v, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2200,7 +2243,7 @@ bool Boiler::set_ww_hyst_off(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 8, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 4, v, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2216,7 +2259,7 @@ bool Boiler::set_ww_chargeOptimization(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 25, v ? 1 : 0, EMS_TYPE_UBAParameterWWPlus);
|
||||
}
|
||||
|
||||
@@ -2254,7 +2297,7 @@ bool Boiler::set_min_pump(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 14, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 10, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2270,7 +2313,7 @@ bool Boiler::set_max_pump(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 13, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 9, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2295,7 +2338,7 @@ bool Boiler::set_hyst_on(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 9, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, id == 2 ? 13 : 5, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2311,7 +2354,7 @@ bool Boiler::set_hyst_off(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 8, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, id == 2 ? 12 : 4, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2327,7 +2370,7 @@ bool Boiler::set_burn_period(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParametersPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParametersPlus)) {
|
||||
write_command(EMS_TYPE_UBAParametersPlus, 10, v, EMS_TYPE_UBAParametersPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameters, 6, v, EMS_TYPE_UBAParameters);
|
||||
@@ -2343,7 +2386,7 @@ bool Boiler::set_pump_delay(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameters)) {
|
||||
if (is_received(EMS_TYPE_UBAParameters)) {
|
||||
write_command(EMS_TYPE_UBAParameters, 8, v, EMS_TYPE_UBAParameters);
|
||||
return true;
|
||||
}
|
||||
@@ -2359,7 +2402,7 @@ bool Boiler::set_ww_mode(const char * value, const int8_t id) {
|
||||
uint8_t set;
|
||||
uint8_t comfort[] = {0x00, 0xD8, 0xEC}; // heat, eco, intelligent
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_comfort1))) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 13, comfort[set], EMS_TYPE_UBAParameterWWPlus);
|
||||
write_command(0x05, 70, set ? 0xAA : 0x55); //
|
||||
@@ -2383,7 +2426,7 @@ bool Boiler::set_ww_activated(const char * value, const int8_t id) {
|
||||
|
||||
// https://github.com/emsesp/EMS-ESP/issues/268
|
||||
// 08 for HT3 seems to be wrong, see https://github.com/emsesp/EMS-ESP32/issues/89
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 5, v ? 1 : 0, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 1, v ? 0xFF : 0, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2441,7 +2484,7 @@ bool Boiler::set_ww_onetime(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x22 : 0x02), 0xE9); // not sure if this is in flags
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x23 : 0x03), 0x34);
|
||||
@@ -2457,7 +2500,7 @@ bool Boiler::set_ww_disinfect(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x44 : 0x04), 0xE9); // not sure if this is in flags
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAFlags, 0, (v ? 0x44 : 0x04), 0x34);
|
||||
@@ -2474,7 +2517,7 @@ bool Boiler::set_ww_circulation(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAFlags, 1, (v ? 0x22 : 0x02), 0xE9); // not sure if this is in flags
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAFlags, 1, (v ? 0x22 : 0x02), 0x34);
|
||||
@@ -2490,7 +2533,7 @@ bool Boiler::set_ww_circulation_pump(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 10, v ? 0x01 : 0x00, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 6, v ? 0xFF : 0x00, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2507,7 +2550,7 @@ bool Boiler::set_ww_circulation_mode(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_fetch(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
if (is_received(EMS_TYPE_UBAParameterWWPlus)) {
|
||||
write_command(EMS_TYPE_UBAParameterWWPlus, 11, v, EMS_TYPE_UBAParameterWWPlus);
|
||||
} else {
|
||||
write_command(EMS_TYPE_UBAParameterWW, 7, v, EMS_TYPE_UBAParameterWW);
|
||||
@@ -2854,6 +2897,24 @@ bool Boiler::set_hpCircPumpWw(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Boiler::set_hpPumpMode(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (Helpers::value2enum(value, v, FL_(enum_hpPumpMode))) {
|
||||
write_command(0x48B, 18, v, 0x48B);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Boiler::set_hpMaxPower(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (Helpers::value2number(value, v)) {
|
||||
write_command(0x484, 31, v, 0x484);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Boiler::set_vp_cooling(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (Helpers::value2bool(value, v)) {
|
||||
|
||||
@@ -101,21 +101,22 @@ class Boiler : public EMSdevice {
|
||||
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
|
||||
|
||||
// main
|
||||
uint8_t reset_; // for reset command
|
||||
uint8_t heatingActive_; // Central heating is on/off
|
||||
uint8_t tapwaterActive_; // Hot tap water is on/off
|
||||
uint8_t selFlowTemp_; // Selected flow temperature
|
||||
uint8_t selBurnPow_; // Burner max power % (can be > 100%)
|
||||
uint8_t absBurnPow_; // absolute burner power in % of rating plate
|
||||
uint8_t heatingPumpMod_; // Pump modulation %
|
||||
int16_t outdoorTemp_; // Outside temperature
|
||||
uint16_t curFlowTemp_; // Current flow temperature
|
||||
uint16_t retTemp_; // Return temperature
|
||||
uint16_t switchTemp_; // Switch temperature
|
||||
uint8_t sysPress_; // System pressure
|
||||
uint16_t boilTemp_; // Boiler temperature
|
||||
uint16_t exhaustTemp_; // Exhaust temperature published
|
||||
uint16_t exhaustTemp1_; // read from E4
|
||||
uint8_t reset_; // for reset command
|
||||
uint8_t heatingActive_; // Central heating is on/off
|
||||
uint8_t tapwaterActive_; // Hot tap water is on/off
|
||||
uint8_t selFlowTemp_; // Selected flow temperature
|
||||
uint8_t selBurnPow_; // Burner max power % (can be > 100%)
|
||||
uint8_t absBurnPow_; // absolute burner power in % of rating plate
|
||||
uint8_t heatingPumpMod_; // Pump modulation %
|
||||
int16_t outdoorTemp_; // Outside temperature
|
||||
uint16_t curFlowTemp_; // Current flow temperature
|
||||
uint16_t retTemp_; // Return temperature
|
||||
uint16_t switchTemp_; // Switch temperature
|
||||
uint8_t sysPress_; // System pressure
|
||||
uint16_t boilTemp_; // Boiler temperature
|
||||
uint16_t exhaustTemp_; // Exhaust temperature published
|
||||
// read second value from E4 and initialize it
|
||||
uint16_t exhaustTemp1_ = EMS_VALUE_USHORT_NOTSET;
|
||||
uint8_t burnGas_; // Gas on/off
|
||||
uint8_t burnGas2_; // Gas stage 2 on/off
|
||||
uint16_t flameCurr_; // Flame current in micro amps
|
||||
@@ -218,7 +219,9 @@ class Boiler : public EMSdevice {
|
||||
uint32_t meterTotal_;
|
||||
uint32_t meterComp_;
|
||||
uint32_t meterEHeat_;
|
||||
uint32_t meterHeat_;
|
||||
uint8_t hpEA0_;
|
||||
uint8_t hpPumpMode_;
|
||||
|
||||
// Pool unit
|
||||
int8_t poolSetTemp_;
|
||||
@@ -233,6 +236,7 @@ class Boiler : public EMSdevice {
|
||||
uint8_t maxHeatComp_;
|
||||
uint8_t maxHeatHeat_;
|
||||
uint8_t maxHeatDhw_;
|
||||
uint8_t hpMaxPower_;
|
||||
|
||||
uint8_t pvCooling_;
|
||||
uint8_t manDefrost_;
|
||||
@@ -430,6 +434,8 @@ class Boiler : public EMSdevice {
|
||||
bool set_manDefrost(const char * value, const int8_t id);
|
||||
bool set_pvCooling(const char * value, const int8_t id);
|
||||
bool set_hpCircPumpWw(const char * value, const int8_t id);
|
||||
bool set_hpPumpMode(const char * value, const int8_t id);
|
||||
bool set_hpMaxPower(const char * value, const int8_t id);
|
||||
|
||||
bool set_auxLimit(const char * value, const int8_t id);
|
||||
inline bool set_auxMaxLimit(const char * value, const int8_t id) {
|
||||
|
||||
@@ -25,7 +25,7 @@ REGISTER_FACTORY(Controller, EMSdevice::DeviceType::CONTROLLER);
|
||||
Controller::Controller(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// IVT broadcasts Thermostat time from controller (0x09) if display is off.
|
||||
if ((flags & 0x0F) == EMS_DEVICE_FLAG_IVT) {
|
||||
if ((flags & 0x0F) == EMSdevice::EMS_DEVICE_FLAG_IVT) {
|
||||
register_telegram_type(0x06, "RCTime", false, MAKE_PF_CB(process_dateTime));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ class Extension : public EMSdevice {
|
||||
|
||||
int16_t headerTemp_; // T0
|
||||
uint8_t input_; // IO1
|
||||
uint8_t errorState_; // OE1
|
||||
uint8_t errorPump_; // IE0
|
||||
uint8_t outPower_; // IO1
|
||||
uint8_t setPower_; // request
|
||||
// uint8_t errorState_; // OE1
|
||||
// uint8_t errorPump_; // IE0
|
||||
uint8_t outPower_; // IO1
|
||||
uint8_t setPower_; // request
|
||||
uint8_t setPoint_;
|
||||
uint8_t dip_; // dip switch
|
||||
uint8_t minV_;
|
||||
|
||||
@@ -33,6 +33,8 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
|
||||
register_telegram_type(0x9A0, "HPTemperature", false, MAKE_PF_CB(process_HPTemperature));
|
||||
register_telegram_type(0x99B, "HPFlowTemp", false, MAKE_PF_CB(process_HPFlowTemp));
|
||||
register_telegram_type(0x99C, "HPComp", false, MAKE_PF_CB(process_HPComp));
|
||||
register_telegram_type(0x4AE, "HPEnergy", true, MAKE_PF_CB(process_HpEnergy));
|
||||
register_telegram_type(0x4AF, "HPMeters", true, MAKE_PF_CB(process_HpMeters));
|
||||
|
||||
// device values
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT, FL_(airHumidity), DeviceValueUOM::PERCENT);
|
||||
@@ -146,6 +148,33 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_heatDrainPan));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCable_, DeviceValueType::BOOL, FL_(heatCable), DeviceValueUOM::NONE, MAKE_CF_CB(set_heatCable));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgTotal_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgTotal), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &nrgWw_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgWw), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &nrgHeat_, DeviceValueType::ULONG, DeviceValueNumOp::DV_NUMOP_DIV100, FL_(nrgHeat), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&meterTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||
FL_(meterTotal),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&meterComp_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||
FL_(meterComp),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&meterEHeat_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||
FL_(meterEHeat),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&meterHeat_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV100,
|
||||
FL_(meterHeat),
|
||||
DeviceValueUOM::KWH);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -226,6 +255,24 @@ void Heatpump::process_HPFunctionTest(std::shared_ptr<const Telegram> telegram)
|
||||
has_update(telegram, heatCable_, 10);
|
||||
}
|
||||
|
||||
// boiler(0x08) -W-> Me(0x0B), ?(0x04AE), data: 00 00 BD C4 00 00 5B 6A 00 00 00 24 00 00 62 59 00 00 00 00 00 00 00 00
|
||||
// boiler(0x08) -W-> Me(0x0B), ?(0x04AE), data: 00 00 00 00 00 00 00 00 (offset 24)
|
||||
void Heatpump::process_HpEnergy(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, nrgTotal_, 0);
|
||||
has_update(telegram, nrgHeat_, 4);
|
||||
has_update(telegram, nrgWw_, 12);
|
||||
}
|
||||
|
||||
// boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 48 B2 00 00 48 55 00 00 00 5D 00 00 01 78 00 00 00 00 00 00 07 61
|
||||
// boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 24 B0 00 00 00 12 00 00 23 A5 00 00 00 4B 00 00 00 00 00 00 00 00 (offset 24)
|
||||
// boiler(0x08) -W-> Me(0x0B), ?(0x04AF), data: 00 00 00 00 00 00 00 00 (offset 48)
|
||||
void Heatpump::process_HpMeters(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, meterTotal_, 0);
|
||||
has_update(telegram, meterComp_, 4);
|
||||
has_update(telegram, meterEHeat_, 8);
|
||||
has_update(telegram, meterHeat_, 24);
|
||||
}
|
||||
|
||||
/*
|
||||
* Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C
|
||||
* Broadcast (0x099B), data: 80 00 80 00 01 3C 01 38 80 00 80 00 80 00 01 37 00 00 00 00 64
|
||||
|
||||
@@ -67,6 +67,15 @@ class Heatpump : public EMSdevice {
|
||||
int16_t hpJr0_; // low pressure sensor
|
||||
int16_t hpJr1_; // high pressure sensor
|
||||
|
||||
uint32_t nrgTotal_;
|
||||
uint32_t nrgWw_;
|
||||
uint32_t nrgHeat_;
|
||||
uint32_t meterTotal_;
|
||||
uint32_t meterComp_;
|
||||
uint32_t meterEHeat_;
|
||||
uint32_t meterHeat_;
|
||||
|
||||
|
||||
void process_HPMonitor1(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPMonitor2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPSettings(std::shared_ptr<const Telegram> telegram);
|
||||
@@ -74,6 +83,8 @@ class Heatpump : public EMSdevice {
|
||||
void process_HPTemperature(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPFlowTemp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPComp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpEnergy(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpMeters(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
bool set_controlStrategy(const char * value, const int8_t id);
|
||||
bool set_lowNoiseMode(const char * value, const int8_t id);
|
||||
|
||||
@@ -26,61 +26,16 @@ uuid::log::Logger Mixer::logger_{F_(mixer), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// Pool module
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_MP) {
|
||||
register_telegram_type(0x5BA, "HpPoolStatus", true, MAKE_PF_CB(process_HpPoolStatus));
|
||||
type_ = Type::MP;
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&poolTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(poolTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShuntStatus_, DeviceValueType::ENUM, FL_(enum_shunt), FL_(poolShuntStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShunt_, DeviceValueType::UINT, FL_(poolShunt), DeviceValueUOM::PERCENT);
|
||||
}
|
||||
|
||||
// EMS+
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
if (device_id >= 0x20 && device_id <= 0x27) {
|
||||
register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage_HC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
|
||||
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
|
||||
type_ = Type::HC;
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
} else if (device_id >= 0x28 && device_id <= 0x29) {
|
||||
register_telegram_type(device_id - 0x28 + 0x0331, "MMPLUSStatusMessage_WWC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC));
|
||||
register_telegram_type(device_id - 0x28 + 0x0313, "MMPLUSConfigMessage_WWC", true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC));
|
||||
// register_telegram_type(device_id - 0x28 + 0x033B, "MMPLUSSetMessage_WWC", true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC));
|
||||
type_ = Type::WWC;
|
||||
hc_ = device_id - 0x28 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_WWC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(wwPumpStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(wwTempStatus), DeviceValueUOM::NONE);
|
||||
|
||||
register_device_value(tag, &wwMaxTemp_, DeviceValueType::UINT, FL_(wwMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(tag, &wwDiffTemp_, DeviceValueType::INT, FL_(wwDiffTemp), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwDiffTemp));
|
||||
register_device_value(tag,
|
||||
&wwDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(tag, &wwReducedTemp_, DeviceValueType::UINT, FL_(wwRedTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwReducedTemp));
|
||||
register_device_value(tag, &wwRequiredTemp_, DeviceValueType::UINT, FL_(wwRequiredTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRequiredTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwCircPump_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(wwCircPump),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwCircPump));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
}
|
||||
register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage_HC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
|
||||
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::UINT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
}
|
||||
|
||||
// EMS 1.0
|
||||
@@ -88,7 +43,6 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_telegram_type(0x00AA, "MMConfigMessage", true, MAKE_PF_CB(process_MMConfigMessage));
|
||||
register_telegram_type(0x00AB, "MMStatusMessage", false, MAKE_PF_CB(process_MMStatusMessage));
|
||||
register_telegram_type(0x00AC, "MMSetMessage", false, MAKE_PF_CB(process_MMSetMessage));
|
||||
type_ = Type::HC;
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
@@ -109,48 +63,16 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
|
||||
// HT3
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
if (device_id >= 0x40) { // special DHW pos 10
|
||||
register_telegram_type(0x34, "UBAMonitorWW", false, MAKE_PF_CB(process_IPMMonitorWW));
|
||||
register_telegram_type(0x1E, "HydrTemp", false, MAKE_PF_CB(process_IPMHydrTemp));
|
||||
register_telegram_type(0x33, "UBAParameterWW", true, MAKE_PF_CB(process_IPMParameterWW));
|
||||
// register_telegram_type(0x10D, "wwNTCStatus", false, MAKE_PF_CB(process_wwNTCStatus));
|
||||
type_ = Type::WWC;
|
||||
hc_ = device_id - 0x40 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_WWC9 + hc_ - 1;
|
||||
register_device_value(tag, &wwSelTemp_, DeviceValueType::UINT, FL_(wwSelTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(tag, &wwCurTemp_1_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwCurTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwCurTemp_2_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwCurTemp2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &HydrTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hydrTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwFlowTempOffset_, DeviceValueType::UINT, FL_(wwFlowTempOffset), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwFlowTempOffset));
|
||||
register_device_value(tag, &wwHystOn_, DeviceValueType::INT, FL_(wwHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOn));
|
||||
register_device_value(tag, &wwHystOff_, DeviceValueType::INT, FL_(wwHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOff));
|
||||
register_device_value(tag,
|
||||
&wwDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwCircPump_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(wwCircPump),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwCircPump));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
} else {
|
||||
register_telegram_type(0x010C, "IPMStatusMessage", false, MAKE_PF_CB(process_IPMStatusMessage));
|
||||
register_telegram_type(0x011E, "IPMTempMessage", false, MAKE_PF_CB(process_IPMTempMessage));
|
||||
// register_telegram_type(0x0123, "IPMSetMessage", false, MAKE_PF_CB(process_IPMSetMessage));
|
||||
type_ = Type::HC;
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &flowTempVf_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempVf), DeviceValueUOM::DEGREES);
|
||||
}
|
||||
register_telegram_type(0x010C, "IPMStatusMessage", false, MAKE_PF_CB(process_IPMStatusMessage));
|
||||
register_telegram_type(0x011E, "IPMTempMessage", false, MAKE_PF_CB(process_IPMTempMessage));
|
||||
// register_telegram_type(0x0123, "IPMSetMessage", false, MAKE_PF_CB(process_IPMSetMessage));
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::UINT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &flowTempVf_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempVf), DeviceValueUOM::DEGREES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,15 +86,6 @@ void Mixer::process_MMPLUSStatusMessage_HC(std::shared_ptr<const Telegram> teleg
|
||||
has_update(telegram, status_, 2); // valve status
|
||||
}
|
||||
|
||||
// Mixer warm water loading/DHW - 0x0331, 0x0332
|
||||
// e.g. A9 00 FF 00 02 32 02 6C 00 3C 00 3C 3C 46 02 03 03 00 3C // on 0x28
|
||||
// A8 00 FF 00 02 31 02 35 00 3C 00 3C 3C 46 02 03 03 00 3C // in 0x29
|
||||
void Mixer::process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, flowTempHc_, 0); // is * 10
|
||||
has_bitupdate(telegram, pumpStatus_, 2, 0);
|
||||
has_update(telegram, status_, 11); // temp status
|
||||
}
|
||||
|
||||
// Mixer IPM - 0x010C
|
||||
// e.g. A0 00 FF 00 00 0C 01 00 00 00 00 00 54
|
||||
// A1 00 FF 00 00 0C 02 04 00 01 1D 00 82
|
||||
@@ -200,15 +113,6 @@ void Mixer::process_IPMTempMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, flowTempVf_, 0); // TC1, is * 10
|
||||
}
|
||||
|
||||
// Mixer MP100 for pools - 0x5BA
|
||||
void Mixer::process_HpPoolStatus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, poolTemp_, 0);
|
||||
has_update(telegram, poolShunt_, 3); // 0-100% how much is the shunt open?
|
||||
telegram->read_value(poolShuntStatus__, 2);
|
||||
uint8_t pss = poolShunt_ == 100 ? 3 : (poolShunt_ == 0 ? 4 : poolShuntStatus__);
|
||||
has_update(poolShuntStatus_, pss);
|
||||
}
|
||||
|
||||
// Mixer on a MM10 - 0xAB
|
||||
// e.g. Mixer Module -> All, type 0xAB, telegram: 21 00 AB 00 2D 01 BE 64 04 01 00 (CRC=15) #data=7
|
||||
// see also https://github.com/emsesp/EMS-ESP/issues/386
|
||||
@@ -235,43 +139,6 @@ void Mixer::process_MMConfigMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, setValveTime_, 1); // valve runtime in 10 sec, max 120 s
|
||||
}
|
||||
|
||||
// Config message 0x313, has to be fetched
|
||||
void Mixer::process_MMPLUSConfigMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwRequiredTemp_, 4);
|
||||
has_update(telegram, wwReducedTemp_, 5);
|
||||
has_update(telegram, wwDiffTemp_, 7);
|
||||
has_update(telegram, wwDisinfectionTemp_, 9);
|
||||
has_update(telegram, wwMaxTemp_, 10);
|
||||
}
|
||||
|
||||
// 0x34 only 8 bytes long
|
||||
// Mixer(0x41) -> All(0x00), UBAMonitorWW(0x34), data: 37 02 1E 02 1E 00 00 00 00
|
||||
void Mixer::process_IPMMonitorWW(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwSelTemp_, 0);
|
||||
has_update(telegram, wwCurTemp_1_, 1);
|
||||
has_update(telegram, wwCurTemp_2_, 3);
|
||||
has_bitupdate(telegram, pumpStatus_, 5, 3);
|
||||
}
|
||||
|
||||
// Mixer(0x41) -> Me(0x0B), UBAParameterWW(0x33), data: 08 FF 46 FB FF 28 FF 07 46 00 FF 00
|
||||
void Mixer::process_IPMParameterWW(std::shared_ptr<const Telegram> telegram) {
|
||||
// has_update(telegram, wwActivated_, 1); // 0xFF means on
|
||||
// has_update(telegram, wwSelTemp_, 2);
|
||||
has_update(telegram, wwHystOn_, 3); // Hyst on (default -5)
|
||||
has_update(telegram, wwHystOff_, 4); // Hyst off (default -1)
|
||||
has_update(telegram, wwFlowTempOffset_, 5); // default 40
|
||||
has_update(telegram, wwCircPump_, 6); // 0xFF means on
|
||||
has_update(telegram, wwCircMode_, 7); // 1=1x3min 6=6x3min 7=continuous
|
||||
has_update(telegram, wwDisinfectionTemp_, 8);
|
||||
// has_bitupdate(telegram, wwChargeType_, 10, 0); // 0 = charge pump, 0xff = 3-way valve
|
||||
}
|
||||
|
||||
|
||||
// 0x1E, only16 bit temperature
|
||||
// Mixer(0x41) -> Boiler(0x08), HydrTemp(0x1E), data: 01 D8
|
||||
void Mixer::process_IPMHydrTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, HydrTemp_, 0);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
@@ -284,16 +151,6 @@ void Mixer::process_MMPLUSSetMessage_HC(std::shared_ptr<const Telegram> telegram
|
||||
// pos2: pump
|
||||
}
|
||||
|
||||
// unknown, 2 examples from older threads
|
||||
// Thermostat(0x10) -> Mixer(0x28), ?(0x33B), data: 01 01 00
|
||||
// Thermostat -> Mixing Module, type 0x023B, telegram: 90 28 FF 00 02 3B 00 02 00 (CRC=68)
|
||||
void Mixer::process_MMPLUSSetMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
}
|
||||
|
||||
// MMPLUS telegram 0x345 unknown
|
||||
// Solar Module -> Mixing Module, type 0x0245, telegram: B0 28 FF 00 02 45 64 01 01 (CRC=36)
|
||||
// ?
|
||||
|
||||
// Mixer on a MM10 - 0xAC
|
||||
// e.g. Thermostat -> Mixer Module, type 0xAC, telegram: 10 21 AC 00 1E 64 01 AB
|
||||
void Mixer::process_MMSetMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -311,15 +168,6 @@ void Mixer::process_IPMSetMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
bool Mixer::set_wwSelTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x35, 3, (uint8_t)temperature, 0x34);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_flowSetTemp(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
@@ -389,113 +237,4 @@ bool Mixer::set_setValveTime(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwMaxTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x313 + wwc, 10, (uint8_t)v, 0x313 + wwc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwDiffTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x313 + wwc, 7, (int8_t)(v * 10), 0x313 + wwc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwReducedTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x313 + wwc, 5, (uint8_t)v, 0x313 + wwc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwRequiredTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x313 + wwc, 4, (uint8_t)v, 0x313 + wwc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwDisinfectionTemp(const char * value, const int8_t id) {
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x33, 8, (uint8_t)v, 0x33);
|
||||
} else {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
write_command(0x313 + wwc, 9, (uint8_t)v, 0x313 + wwc);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwCircPump(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x33, 6, v ? 0xFF : 0x00, 0x33);
|
||||
} else {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
write_command(0x33B + wwc, 0, v ? 0x01 : 0x00, 0x33B + wwc);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwCircMode(const char * value, const int8_t id) {
|
||||
uint8_t n;
|
||||
if (!Helpers::value2enum(value, n, FL_(enum_wwCircMode))) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x33, 7, n, 0x33);
|
||||
} else {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
write_command(0x313 + wwc, 0, n, 0x313 + wwc);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwFlowTempOffset(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33, 5, n, 0x33);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwHystOn(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33, 3, n, 0x33);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mixer::set_wwHystOff(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33, 4, n, 0x33);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -32,46 +32,18 @@ class Mixer : public EMSdevice {
|
||||
|
||||
void process_MMPLUSStatusMessage_HC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMPLUSSetMessage_HC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMPLUSSetMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMPLUSConfigMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMStatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMTempMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMSetMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMStatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMConfigMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMSetMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpPoolStatus(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_IPMMonitorWW(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMHydrTemp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMParameterWW(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
bool set_flowSetTemp(const char * value, const int8_t id);
|
||||
bool set_pump(const char * value, const int8_t id);
|
||||
bool set_activated(const char * value, const int8_t id);
|
||||
bool set_setValveTime(const char * value, const int8_t id);
|
||||
|
||||
bool set_wwMaxTemp(const char * value, const int8_t id);
|
||||
bool set_wwDiffTemp(const char * value, const int8_t id);
|
||||
bool set_wwReducedTemp(const char * value, const int8_t id);
|
||||
bool set_wwRequiredTemp(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectionTemp(const char * value, const int8_t id);
|
||||
bool set_wwCircPump(const char * value, const int8_t id);
|
||||
bool set_wwCircMode(const char * value, const int8_t id);
|
||||
|
||||
bool set_wwSelTemp(const char * value, const int8_t id);
|
||||
bool set_wwFlowTempOffset(const char * value, const int8_t id);
|
||||
bool set_wwHystOn(const char * value, const int8_t id);
|
||||
bool set_wwHystOff(const char * value, const int8_t id);
|
||||
|
||||
enum class Type {
|
||||
NONE,
|
||||
HC, // heating circuit
|
||||
WWC, // warm water circuit
|
||||
MP // pool
|
||||
};
|
||||
|
||||
private:
|
||||
uint16_t flowTempHc_;
|
||||
uint16_t flowTempVf_;
|
||||
@@ -81,31 +53,7 @@ class Mixer : public EMSdevice {
|
||||
uint8_t activated_;
|
||||
uint8_t setValveTime_;
|
||||
|
||||
// MM100wwParam - 0x0313, 0x033B
|
||||
uint8_t wwMaxTemp_;
|
||||
uint8_t wwRequiredTemp_;
|
||||
uint8_t wwReducedTemp_;
|
||||
uint8_t wwDiffTemp_;
|
||||
uint8_t wwDisinfectionTemp_;
|
||||
uint8_t wwCircPump_;
|
||||
uint8_t wwCircMode_;
|
||||
|
||||
// MP100 pool
|
||||
int16_t poolTemp_;
|
||||
uint8_t poolShuntStatus_;
|
||||
uint8_t poolShunt_;
|
||||
|
||||
Type type_ = Type::NONE;
|
||||
uint16_t hc_ = EMS_VALUE_USHORT_NOTSET;
|
||||
uint8_t poolShuntStatus__ = EMS_VALUE_UINT_NOTSET; // temp value
|
||||
|
||||
uint8_t wwSelTemp_;
|
||||
uint16_t wwCurTemp_1_;
|
||||
uint16_t wwCurTemp_2_;
|
||||
uint16_t HydrTemp_;
|
||||
int8_t wwHystOn_; // Hyst on (default -5)
|
||||
int8_t wwHystOff_; // Hyst off (default -1)
|
||||
uint8_t wwFlowTempOffset_; // default 40
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
50
src/devices/pool.cpp
Normal file
50
src/devices/pool.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020-2023 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pool.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Pool, EMSdevice::DeviceType::POOL);
|
||||
|
||||
uuid::log::Logger Pool::logger_{F_(pool), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Pool::Pool(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// Pool module
|
||||
register_telegram_type(0x5BA, "HpPoolStatus", true, MAKE_PF_CB(process_HpPoolStatus));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&poolTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(poolTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShuntStatus_, DeviceValueType::ENUM, FL_(enum_shunt), FL_(poolShuntStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShunt_, DeviceValueType::UINT, FL_(poolShunt), DeviceValueUOM::PERCENT);
|
||||
}
|
||||
|
||||
// Mixer MP100 for pools - 0x5BA
|
||||
void Pool::process_HpPoolStatus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, poolTemp_, 0);
|
||||
has_update(telegram, poolShunt_, 3); // 0-100% how much is the shunt open?
|
||||
telegram->read_value(poolShuntStatus__, 2);
|
||||
uint8_t pss = poolShunt_ == 100 ? 3 : (poolShunt_ == 0 ? 4 : poolShuntStatus__);
|
||||
has_update(poolShuntStatus_, pss);
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
46
src/devices/pool.h
Normal file
46
src/devices/pool.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020-2023 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_POOL_H
|
||||
#define EMSESP_POOL_H
|
||||
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
class Pool : public EMSdevice {
|
||||
public:
|
||||
Pool(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
void process_HpPoolStatus(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
private:
|
||||
// MP100 pool
|
||||
int16_t poolTemp_;
|
||||
uint8_t poolShuntStatus_;
|
||||
uint8_t poolShunt_;
|
||||
|
||||
uint8_t poolShuntStatus__ = EMS_VALUE_UINT_NOTSET; // temp value
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
#endif
|
||||
@@ -34,32 +34,22 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
}
|
||||
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) {
|
||||
if (device_id == 0x2A) { // SM100 DHW
|
||||
register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
|
||||
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
|
||||
register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand));
|
||||
register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc));
|
||||
register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam));
|
||||
register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm));
|
||||
register_telegram_type(0x07E0, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2));
|
||||
} else {
|
||||
// F9 is not a telegram type, it's a flag for configure
|
||||
// register_telegram_type(0xF9, "ParamCfg", false, MAKE_PF_CB(process_SM100ParamCfg));
|
||||
register_telegram_type(0x0358, "SM100SystemConfig", true, MAKE_PF_CB(process_SM100SystemConfig));
|
||||
register_telegram_type(0x035A, "SM100CircuitConfig", true, MAKE_PF_CB(process_SM100CircuitConfig));
|
||||
register_telegram_type(0x035D, "SM100Circuit2Config", true, MAKE_PF_CB(process_SM100Circuit2Config));
|
||||
register_telegram_type(0x0362, "SM100Monitor", false, MAKE_PF_CB(process_SM100Monitor));
|
||||
register_telegram_type(0x0363, "SM100Monitor2", false, MAKE_PF_CB(process_SM100Monitor2));
|
||||
register_telegram_type(0x0366, "SM100Config", false, MAKE_PF_CB(process_SM100Config));
|
||||
register_telegram_type(0x0364, "SM100Status", false, MAKE_PF_CB(process_SM100Status));
|
||||
register_telegram_type(0x036A, "SM100Status2", false, MAKE_PF_CB(process_SM100Status2));
|
||||
register_telegram_type(0x0380, "SM100CollectorConfig", true, MAKE_PF_CB(process_SM100CollectorConfig));
|
||||
register_telegram_type(0x038E, "SM100Energy", true, MAKE_PF_CB(process_SM100Energy));
|
||||
register_telegram_type(0x0391, "SM100Time", true, MAKE_PF_CB(process_SM100Time));
|
||||
register_telegram_type(0x035F, "SM100Config1", true, MAKE_PF_CB(process_SM100Config1));
|
||||
register_telegram_type(0x035C, "SM100HeatAssist", true, MAKE_PF_CB(process_SM100HeatAssist));
|
||||
register_telegram_type(0x0361, "SM100Differential", true, MAKE_PF_CB(process_SM100Differential));
|
||||
}
|
||||
// F9 is not a telegram type, it's a flag for configure
|
||||
// register_telegram_type(0xF9, "ParamCfg", false, MAKE_PF_CB(process_SM100ParamCfg));
|
||||
register_telegram_type(0x0358, "SM100SystemConfig", true, MAKE_PF_CB(process_SM100SystemConfig));
|
||||
register_telegram_type(0x035A, "SM100CircuitConfig", true, MAKE_PF_CB(process_SM100CircuitConfig));
|
||||
register_telegram_type(0x035D, "SM100Circuit2Config", true, MAKE_PF_CB(process_SM100Circuit2Config));
|
||||
register_telegram_type(0x0362, "SM100Monitor", false, MAKE_PF_CB(process_SM100Monitor));
|
||||
register_telegram_type(0x0363, "SM100Monitor2", false, MAKE_PF_CB(process_SM100Monitor2));
|
||||
register_telegram_type(0x0366, "SM100Config", false, MAKE_PF_CB(process_SM100Config));
|
||||
register_telegram_type(0x0364, "SM100Status", false, MAKE_PF_CB(process_SM100Status));
|
||||
register_telegram_type(0x036A, "SM100Status2", false, MAKE_PF_CB(process_SM100Status2));
|
||||
register_telegram_type(0x0380, "SM100CollectorConfig", true, MAKE_PF_CB(process_SM100CollectorConfig));
|
||||
register_telegram_type(0x038E, "SM100Energy", true, MAKE_PF_CB(process_SM100Energy));
|
||||
register_telegram_type(0x0391, "SM100Time", true, MAKE_PF_CB(process_SM100Time));
|
||||
register_telegram_type(0x035F, "SM100Config1", true, MAKE_PF_CB(process_SM100Config1));
|
||||
register_telegram_type(0x035C, "SM100HeatAssist", true, MAKE_PF_CB(process_SM100HeatAssist));
|
||||
register_telegram_type(0x0361, "SM100Differential", true, MAKE_PF_CB(process_SM100Differential));
|
||||
}
|
||||
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_ISM) {
|
||||
@@ -69,94 +59,6 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
}
|
||||
|
||||
// device values...
|
||||
// special case for a SM100 DHW device_id with 0x2A where it's not actual a solar module
|
||||
if (device_id == 0x2A) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_1_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp1),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_3_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp3),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_4_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp4),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_5_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp5),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_7_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp7),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwPump_, DeviceValueType::BOOL, FL_(wwPump), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwMaxTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwMaxTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwSelTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwSelTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwRedTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwRedTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwRedTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwDailyTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwDailyTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDailyTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(wwDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwCirc_, DeviceValueType::BOOL, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwCircMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_wwCircMode),
|
||||
FL_(wwCircMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwCircMode));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwKeepWarm_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(wwKeepWarm),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwKeepWarm));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwStatus2_, DeviceValueType::ENUM, FL_(enum_wwStatus2), FL_(wwStatus2), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwPumpMod_, DeviceValueType::UINT, FL_(wwPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwFlow_,
|
||||
DeviceValueType::UINT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwFlow),
|
||||
DeviceValueUOM::LMIN);
|
||||
return;
|
||||
}
|
||||
|
||||
// common solar values for all modules (except dhw)
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collectorTemp_,
|
||||
@@ -318,8 +220,6 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylPumpMod_, DeviceValueType::UINT, FL_(cylPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &valveStatus_, DeviceValueType::BOOL, FL_(valveStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &vs1Status_, DeviceValueType::BOOL, FL_(vs1Status), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylHeated_, DeviceValueType::BOOL, FL_(cylHeated), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collectorShutdown_, DeviceValueType::BOOL, FL_(collectorShutdown), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collectorMaxTemp_,
|
||||
DeviceValueType::UINT,
|
||||
@@ -690,58 +590,6 @@ void Solar::process_SM100Monitor(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, retHeatAssist_, 10); // is *10 - TS15: return temperature heating assistance
|
||||
}
|
||||
|
||||
// SM100wwTemperature - 0x07D6
|
||||
// Solar Module(0x2A) -> (0x00), (0x7D6), data: 01 C1 00 00 02 5B 01 AF 01 AD 80 00 01 90
|
||||
void Solar::process_SM100wwTemperature(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwTemp_1_, 0); // is *10
|
||||
has_update(telegram, wwTemp_3_, 4); // is *10
|
||||
has_update(telegram, wwTemp_4_, 6); // is *10
|
||||
has_update(telegram, wwTemp_5_, 8); // is *10
|
||||
has_update(telegram, wwTemp_7_, 12); // is *10
|
||||
}
|
||||
|
||||
// SM100wwStatus - 0x07AA
|
||||
// Solar Module(0x2A) -> (0x00), (0x7AA), data: 64 00 04 00 03 00 28 01 0F
|
||||
void Solar::process_SM100wwStatus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwPump_, 0);
|
||||
}
|
||||
|
||||
// SM100wwParam - 0x07A6, Solar Module(0x2A) -> (0x00)
|
||||
// data: FF 05 0F 5F 00 01 3C 3C 3C 3C 28 12 46 01 3C 1E 03 07 3C 00 0F 00 05
|
||||
void Solar::process_SM100wwParam(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwMaxTemp_, 8);
|
||||
has_update(telegram, wwSelTemp_, 9);
|
||||
has_update(telegram, wwRedTemp_, 10);
|
||||
has_update(telegram, wwDailyTemp_, 6);
|
||||
has_update(telegram, wwDisinfectionTemp_, 12);
|
||||
// (daily heating time thermostat 2F5, offset 9, offset 8 on/off)
|
||||
}
|
||||
|
||||
// SM100wwCirc - 0x07A5
|
||||
// Solar Module(0x2A) -> (0x00), (0x7A5), data:
|
||||
void Solar::process_SM100wwCirc(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwCirc_, 0);
|
||||
has_update(telegram, wwCircMode_, 3);
|
||||
}
|
||||
|
||||
// SM100wwKeepWarm - 0x7AE, keepWarm
|
||||
// Thermostat(0x10) -> Solar(0x2A), ?(0x7AE), data: FF
|
||||
void Solar::process_SM100wwKeepWarm(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwKeepWarm_, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
// SM100ww? - 0x7E0, some kind of status
|
||||
// data: 00 00 46 00 00 01 06 0E 06 0E 00 00 00 00 00 03 03 03 03
|
||||
// publishes single values offset 1/2(16bit), offset 5, offset 6, offset 7, offset 8, offset 9,
|
||||
// status2 = 03:"no heat", 06:"heat request", 08:"disinfecting", 09:"hold"
|
||||
*/
|
||||
void Solar::process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwFlow_, 7);
|
||||
has_update(telegram, wwStatus2_, 8);
|
||||
has_update(telegram, wwPumpMod_, 9);
|
||||
}
|
||||
|
||||
// SM100Monitor2 - 0x0363 Heatcounter
|
||||
// e.g. B0 00 FF 00 02 63 80 00 80 00 00 00 80 00 80 00 80 00 00 80 00 5A
|
||||
// Solar(0x30) -> All(0x00), SM100Monitor2(0x363), data: 01 E1 01 6B 00 00 01 5D 02 8E 80 00 0F 80 00
|
||||
@@ -753,17 +601,6 @@ void Solar::process_SM100Monitor2(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram->read_value(swapFlowTemp_, 8)); // is *10
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
|
||||
// SM100wwCommand - 0x07AB
|
||||
// Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01
|
||||
void Solar::process_SM100wwCommand(std::shared_ptr<const Telegram> telegram) {
|
||||
// not implemented yet
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// SM100Config - 0x0366
|
||||
// e.g. B0 00 FF 00 02 66 01 62 00 13 40 14
|
||||
void Solar::process_SM100Config(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -1249,76 +1086,4 @@ bool Solar::set_diffControl(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwSelTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 9, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwMaxTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 8, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwRedTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 10, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwDailyTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 6, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwDisinfectionTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 12, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwCirc(const char * value, const int8_t id) {
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A5, 0, b ? 0xFF : 0x00, 0x7A5);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwCircMode(const char * value, const int8_t id) {
|
||||
uint8_t num;
|
||||
if (!Helpers::value2enum(value, num, FL_(enum_wwCircMode))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A5, 3, num, 0x7A5);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Solar::set_wwKeepWarm(const char * value, const int8_t id) {
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7AE, 0, b ? 0xFF : 0x00, 0x7AE);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -114,35 +114,6 @@ class Solar : public EMSdevice {
|
||||
uint16_t collector2Area_; // Area of collector field 2
|
||||
uint8_t collector2Type_; // Type of collector field 2, 01=flat, 02=vacuum
|
||||
|
||||
// SM100wwTemperature - 0x07D6
|
||||
uint16_t wwTemp_1_;
|
||||
uint16_t wwTemp_3_;
|
||||
uint16_t wwTemp_4_;
|
||||
uint16_t wwTemp_5_;
|
||||
uint16_t wwTemp_7_;
|
||||
|
||||
// SM100wwStatus - 0x07AA
|
||||
uint8_t wwPump_;
|
||||
|
||||
// SM100wwParam - 0x07A6
|
||||
uint8_t wwMaxTemp_;
|
||||
uint8_t wwSelTemp_;
|
||||
uint8_t wwRedTemp_;
|
||||
uint8_t wwDailyTemp_;
|
||||
uint8_t wwDisinfectionTemp_;
|
||||
|
||||
// SM100wwKeepWarm - 0x07AE
|
||||
uint8_t wwKeepWarm_;
|
||||
|
||||
// SM100wwCirc - 0x07A5
|
||||
uint8_t wwCirc_;
|
||||
uint8_t wwCircMode_;
|
||||
|
||||
// SM100wwStatus2 - 0x07E0
|
||||
uint8_t wwFlow_;
|
||||
uint8_t wwPumpMod_;
|
||||
uint8_t wwStatus2_;
|
||||
|
||||
// SM10Config - 0x96
|
||||
uint8_t wwMinTemp_;
|
||||
uint8_t maxFlow_; // set this to calculate power
|
||||
@@ -178,14 +149,6 @@ class Solar : public EMSdevice {
|
||||
void process_SM100HeatAssist(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100Differential(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_SM100wwTemperature(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwStatus(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwCommand(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwCirc(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwParam(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwKeepWarm(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_ISM1StatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_ISM1Set(std::shared_ptr<const Telegram> telegram);
|
||||
void process_ISM2StatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
@@ -226,14 +189,6 @@ class Solar : public EMSdevice {
|
||||
bool set_heatAssist(const char * value, const int8_t id);
|
||||
bool set_diffControl(const char * value, const int8_t id);
|
||||
|
||||
bool set_wwSelTemp(const char * value, const int8_t id);
|
||||
bool set_wwMaxTemp(const char * value, const int8_t id);
|
||||
bool set_wwRedTemp(const char * value, const int8_t id);
|
||||
bool set_wwCirc(const char * value, const int8_t id);
|
||||
bool set_wwCircMode(const char * value, const int8_t id);
|
||||
bool set_wwKeepWarm(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectionTemp(const char * value, const int8_t id);
|
||||
bool set_wwDailyTemp(const char * value, const int8_t id);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -142,7 +142,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
||||
}
|
||||
|
||||
// RC300/RC100
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
monitor_typeids = {0x02A5, 0x02A6, 0x02A7, 0x02A8, 0x02A9, 0x02AA, 0x02AB, 0x02AC};
|
||||
set_typeids = {0x02B9, 0x02BA, 0x02BB, 0x02BC, 0x02BD, 0x02BE, 0x02BF, 0x02C0};
|
||||
set2_typeids = {0x02CC, 0x02CE, 0x02D0, 0x02D2}; // max. 4 heating circuits supported ny RC310
|
||||
@@ -180,7 +180,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
||||
register_telegram_type(monitor_typeids[i], "JunkersMonitor", false, MAKE_PF_CB(process_JunkersMonitor));
|
||||
}
|
||||
|
||||
if (has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
// FR120, FR100
|
||||
set_typeids = {0x0179, 0x017A, 0x017B, 0x017C};
|
||||
for (uint8_t i = 0; i < monitor_typeids.size(); i++) {
|
||||
@@ -477,6 +477,14 @@ uint8_t Thermostat::HeatingCircuit::get_mode() const {
|
||||
} else if (mode == 1) {
|
||||
return HeatingCircuit::Mode::OFF;
|
||||
}
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_BC400) {
|
||||
if (mode == 0) {
|
||||
return HeatingCircuit::Mode::OFF;
|
||||
} else if (mode == 1) {
|
||||
return HeatingCircuit::Mode::MANUAL;
|
||||
} else if (mode == 2) {
|
||||
return HeatingCircuit::Mode::AUTO;
|
||||
}
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
if (mode == 0) {
|
||||
return HeatingCircuit::Mode::MANUAL;
|
||||
@@ -509,7 +517,7 @@ uint8_t Thermostat::HeatingCircuit::get_mode() const {
|
||||
uint8_t Thermostat::HeatingCircuit::get_mode_type() const {
|
||||
uint8_t model = get_model();
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
if (modetype == 2) {
|
||||
return HeatingCircuit::Mode::HEAT;
|
||||
} else if (modetype == 1) {
|
||||
@@ -517,25 +525,25 @@ uint8_t Thermostat::HeatingCircuit::get_mode_type() const {
|
||||
} else if (modetype == 0) {
|
||||
return HeatingCircuit::Mode::NOFROST;
|
||||
}
|
||||
} else if ((model == EMS_DEVICE_FLAG_RC35) || (model == EMS_DEVICE_FLAG_RC30_N)) {
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC35) || (model == EMSdevice::EMS_DEVICE_FLAG_RC30_N)) {
|
||||
if (modetype == 0) {
|
||||
return HeatingCircuit::Mode::NIGHT;
|
||||
} else if (modetype == 1) {
|
||||
return HeatingCircuit::Mode::DAY;
|
||||
}
|
||||
} else if (model == EMS_DEVICE_FLAG_CRF) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_CRF) {
|
||||
if (modetype == 0) {
|
||||
return HeatingCircuit::Mode::OFF;
|
||||
} else if (modetype == 1) {
|
||||
return HeatingCircuit::Mode::ON;
|
||||
}
|
||||
} else if (model == EMS_DEVICE_FLAG_RC300) {
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model == EMSdevice::EMS_DEVICE_FLAG_RC300)) {
|
||||
if (modetype == 0) {
|
||||
return HeatingCircuit::Mode::ECO;
|
||||
} else if (modetype == 1) {
|
||||
return HeatingCircuit::Mode::COMFORT;
|
||||
}
|
||||
} else if (model == EMS_DEVICE_FLAG_RC100) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
return HeatingCircuit::Mode::DAY; // no other modes on these devices
|
||||
}
|
||||
|
||||
@@ -1022,15 +1030,18 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
|
||||
// has_update(telegram, hc->selTemp, 8, 1); // single byte conversion, value is * 2 - auto?
|
||||
// has_update(telegram, hc->selTemp, 10, 1); // single byte conversion, value is * 2 - manual
|
||||
|
||||
has_update(telegram, hc->mode_new, 21); // for BC400
|
||||
has_bitupdate(telegram, hc->mode, 2, 0); // RC300, RC100
|
||||
/*
|
||||
telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto
|
||||
if (hc->mode_new <= 2) {
|
||||
if (Helpers::hasValue(hc->mode_new)) {
|
||||
has_update(hc->mode, hc->mode_new);
|
||||
} else {
|
||||
uint8_t mode = hc->mode == 2 ? 0xFF : 0; // auto : manual
|
||||
if (telegram->read_value(mode, 0)) {
|
||||
has_update(hc->mode, mode == 0xFF ? 2 : 1);
|
||||
}
|
||||
telegram->read_value(mode, 0);
|
||||
has_update(hc->mode, mode == 0xFF ? 2 : 1);
|
||||
}
|
||||
*/
|
||||
has_update(telegram, hc->daytemp, 2); // is * 2
|
||||
has_update(telegram, hc->nighttemp, 4); // is * 2
|
||||
|
||||
@@ -1051,6 +1062,8 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, hc->reducetemp, 9);
|
||||
has_update(telegram, hc->noreducetemp, 12);
|
||||
has_update(telegram, hc->remoteseltemp, 17); // see https://github.com/emsesp/EMS-ESP32/issues/590
|
||||
has_update(telegram, hc->boost, 23);
|
||||
has_update(telegram, hc->boosttime, 24);
|
||||
has_update(telegram, hc->cooling, 28);
|
||||
}
|
||||
|
||||
@@ -1095,6 +1108,9 @@ void Thermostat::process_RC300Summer2(std::shared_ptr<const Telegram> telegram)
|
||||
has_update(hc->summersetmode, EMS_VALUE_UINT_NOTSET);
|
||||
}
|
||||
has_update(telegram, hc->summertemp, 1);
|
||||
has_update(telegram, hc->heatondelay, 2);
|
||||
has_update(telegram, hc->heatoffdelay, 3);
|
||||
has_update(telegram, hc->instantstart, 4);
|
||||
}
|
||||
|
||||
// types 0x29B ff
|
||||
@@ -1130,7 +1146,15 @@ void Thermostat::process_RC300WWmode(std::shared_ptr<const Telegram> telegram) {
|
||||
// circulation pump see: https://github.com/Th3M3/buderus_ems-wiki/blob/master/Einstellungen%20der%20Bedieneinheit%20RC310.md
|
||||
has_update(telegram, wwCircPump_, 1); // FF=off, 0=on ?
|
||||
|
||||
has_update(telegram, wwMode_, 2); // 0=off, 1=low, 2=high, 3=auto, 4=own prog
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400) {
|
||||
const uint8_t modes[] = {0, 5, 1, 2, 4}; // off, eco+, eco, comfort, auto
|
||||
uint8_t wwmode = wwMode_ < sizeof(modes) ? modes[wwMode_] : EMS_VALUE_UINT_NOTSET;
|
||||
telegram->read_value(wwmode, 2);
|
||||
const uint8_t modes1[] = {0, 2, 3, 0, 4, 1};
|
||||
has_update(wwMode_, wwmode < sizeof(modes1) ? modes1[wwmode] : EMS_VALUE_UINT_NOTSET);
|
||||
} else {
|
||||
has_update(telegram, wwMode_, 2); // 0=off, 1=low, 2=high, 3=auto, 4=own prog
|
||||
}
|
||||
has_update(telegram, wwCircMode_, 3); // 0=off, 1=on, 2=auto, 4=own?
|
||||
has_update(telegram, wwChargeDuration_, 10); // value in steps of 15 min
|
||||
has_update(telegram, wwCharge_, 11); // boolv0xFF on
|
||||
@@ -1331,7 +1355,7 @@ void Thermostat::process_RC35Set(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, hc->minflowtemp, 16);
|
||||
|
||||
// RC35 stores values for floorheating in different position
|
||||
if (hc->heatingtype == 3 && model() == EMS_DEVICE_FLAG_RC35) {
|
||||
if (hc->heatingtype == 3 && model() == EMSdevice::EMS_DEVICE_FLAG_RC35) {
|
||||
has_update(telegram, hc->designtemp, 36); // is * 1
|
||||
has_update(telegram, hc->maxflowtemp, 35); // is * 1
|
||||
} else { // radiator/convector
|
||||
@@ -1354,14 +1378,14 @@ void Thermostat::process_RC35Timer(std::shared_ptr<const Telegram> telegram) {
|
||||
char data[sizeof(hc->switchtime1)];
|
||||
uint8_t no = telegram->offset / 2;
|
||||
uint8_t day = telegram->message_data[0] >> 5;
|
||||
uint8_t on = model() == EMS_DEVICE_FLAG_RC30 ? telegram->message_data[0] & 7 : telegram->message_data[0] & 1;
|
||||
uint8_t on = model() == EMSdevice::EMS_DEVICE_FLAG_RC30 ? telegram->message_data[0] & 7 : telegram->message_data[0] & 1;
|
||||
uint8_t time = telegram->message_data[1];
|
||||
|
||||
// we use EN settings for the day abbreviation
|
||||
auto sday = (FL_(enum_dayOfWeek)[day][0]);
|
||||
if (day == 7) {
|
||||
snprintf(data, sizeof(data), "%02d not_set", no);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
snprintf(data, sizeof(data), "%02d %s %02d:%02d T%d", no, sday, time / 6, 10 * (time % 6), on);
|
||||
} else {
|
||||
snprintf(data, sizeof(data), "%02d %s %02d:%02d %s", no, sday, time / 6, 10 * (time % 6), on ? "on" : "off");
|
||||
@@ -1417,7 +1441,7 @@ void Thermostat::process_RCTime(std::shared_ptr<const Telegram> telegram) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags() == EMS_DEVICE_FLAG_EASY) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_EASY) {
|
||||
return; // not supported
|
||||
}
|
||||
|
||||
@@ -1678,9 +1702,9 @@ bool Thermostat::set_minexttemp(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_RC20_N) || (model() == EMS_DEVICE_FLAG_RC25)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC25)) {
|
||||
write_command(0xAD, 14, mt, 0xAD);
|
||||
} else if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
} else if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
write_command(0x240, 10, mt, 0x240);
|
||||
} else {
|
||||
write_command(EMS_TYPE_IBASettings, 5, mt, EMS_TYPE_IBASettings);
|
||||
@@ -1696,7 +1720,7 @@ bool Thermostat::set_clockoffset(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30Settings, 10, co, EMS_TYPE_RC30Settings);
|
||||
} else {
|
||||
write_command(EMS_TYPE_IBASettings, 12, co, EMS_TYPE_IBASettings);
|
||||
@@ -1715,13 +1739,13 @@ bool Thermostat::set_calinttemp(const char * value, const int8_t id) {
|
||||
auto t = (int8_t)(ct * 10);
|
||||
LOG_DEBUG("Calibrating internal temperature to %d.%d C", t / 10, t < 0 ? -t % 10 : t % 10);
|
||||
|
||||
if (model() == EMS_DEVICE_FLAG_RC10) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC10) {
|
||||
write_command(0xB0, 0, t, 0xB0);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30Settings, 1, t, EMS_TYPE_RC30Settings);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC100H) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC100H) {
|
||||
write_command(0x273, 0, t, 0x273);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC100 || model() == EMS_DEVICE_FLAG_RC300) {
|
||||
} else if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || model() == EMSdevice::EMS_DEVICE_FLAG_RC100 || model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
write_command(0x240, 7, t, 0x240);
|
||||
} else {
|
||||
write_command(EMS_TYPE_IBASettings, 2, t, EMS_TYPE_IBASettings);
|
||||
@@ -1776,7 +1800,7 @@ bool Thermostat::set_remotetemp(const char * value, const int8_t id) {
|
||||
Roomctrl::set_remotetemp(Roomctrl::FB10, hc->hc(), hc->remotetemp); // FB10
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) {
|
||||
Roomctrl::set_remotetemp(Roomctrl::RC20, hc->hc(), hc->remotetemp); // RC20
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
} else if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
Roomctrl::set_remotetemp(Roomctrl::RC100H, hc->hc(), hc->remotetemp); // RC100H
|
||||
}
|
||||
|
||||
@@ -1801,7 +1825,7 @@ bool Thermostat::set_remotehum(const char * value, const int8_t id) {
|
||||
hc->remotehum = h;
|
||||
}
|
||||
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
Roomctrl::set_remotehum(Roomctrl::RC100H, hc->hc(), hc->remotehum); // RC100H
|
||||
return true;
|
||||
}
|
||||
@@ -1815,9 +1839,9 @@ bool Thermostat::set_building(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
write_command(0x240, 9, bd + 1, 0x240);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30Settings, 4, bd, EMS_TYPE_RC30Settings);
|
||||
} else {
|
||||
write_command(EMS_TYPE_IBASettings, 6, bd, EMS_TYPE_IBASettings);
|
||||
@@ -1833,9 +1857,9 @@ bool Thermostat::set_heatingpid(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model() == EMS_DEVICE_FLAG_RC10) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC10) {
|
||||
write_command(0xB0, 6, pid, 0xB0);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30Settings, 25, pid, EMS_TYPE_RC30Settings);
|
||||
}
|
||||
|
||||
@@ -1845,7 +1869,7 @@ bool Thermostat::set_heatingpid(const char * value, const int8_t id) {
|
||||
// 0xA5 and 0x0240- Set the damping settings
|
||||
bool Thermostat::set_damping(const char * value, const int8_t id) {
|
||||
bool dmp;
|
||||
if (model() == EMS_DEVICE_FLAG_RC300) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
if (Helpers::value2bool(value, dmp)) {
|
||||
write_command(0x240, 8, dmp ? 0xFF : 0, 0x240);
|
||||
return true;
|
||||
@@ -1863,7 +1887,7 @@ bool Thermostat::set_damping(const char * value, const int8_t id) {
|
||||
bool Thermostat::set_language(const char * value, const int8_t id) {
|
||||
uint8_t lg;
|
||||
|
||||
if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
if (!Helpers::value2enum(value, lg, FL_(enum_ibaLanguage_RC30))) {
|
||||
return false;
|
||||
}
|
||||
@@ -1887,12 +1911,12 @@ bool Thermostat::set_control(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
uint8_t ctrl;
|
||||
if (model() == EMS_DEVICE_FLAG_JUNKERS && !has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS && !has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (Helpers::value2enum(value, ctrl, FL_(enum_j_control))) {
|
||||
write_command(set_typeids[hc->hc()], 1, ctrl);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400 || model() == EMSdevice::EMS_DEVICE_FLAG_RC300 || model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
if (Helpers::value2enum(value, ctrl, FL_(enum_control1))) {
|
||||
write_command(hpmode_typeids[hc->hc()], 3, ctrl);
|
||||
return true;
|
||||
@@ -1914,7 +1938,7 @@ bool Thermostat::set_roomsensor(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
uint8_t ctrl;
|
||||
if (model() == EMS_DEVICE_FLAG_JUNKERS && !has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS && !has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (Helpers::value2enum(value, ctrl, FL_(enum_roomsensor))) {
|
||||
write_command(set_typeids[hc->hc()], 9, ctrl + 1);
|
||||
return true;
|
||||
@@ -1927,17 +1951,23 @@ bool Thermostat::set_roomsensor(const char * value, const int8_t id) {
|
||||
bool Thermostat::set_wwmode(const char * value, const int8_t id) {
|
||||
uint8_t set;
|
||||
|
||||
if (model() == EMS_DEVICE_FLAG_RC10) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC10) {
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_wwMode3))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0xB0, 2, set, 0xB0);
|
||||
} else if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400) {
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_wwMode4))) {
|
||||
return false;
|
||||
}
|
||||
const uint8_t modes[] = {0, 5, 1, 2, 4};
|
||||
write_command(0x02F5, 2, modes[set], 0x02F5);
|
||||
} else if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_wwMode))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x02F5, 2, set, 0x02F5);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_wwMode3))) {
|
||||
return false;
|
||||
}
|
||||
@@ -1995,7 +2025,7 @@ bool Thermostat::set_wwcharge(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_JUNKERS)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS)) {
|
||||
write_command(0x0115, 0, b ? 0xFF : 0x00, 0x01D3);
|
||||
} else {
|
||||
write_command(0x02F5, 11, b ? 0xFF : 0x00, 0x02F5);
|
||||
@@ -2028,7 +2058,7 @@ bool Thermostat::set_wwprio(const char * value, const int8_t id) {
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300)) {
|
||||
write_command(set2_typeids[hc->hc()], 3, b ? 0xFF : 0x00, set2_typeids[hc->hc()]);
|
||||
} else {
|
||||
write_command(set_typeids[hc->hc()], 21, b ? 0xFF : 0x00, set_typeids[hc->hc()]);
|
||||
@@ -2056,7 +2086,7 @@ bool Thermostat::set_cooling(const char * value, const int8_t id) {
|
||||
bool Thermostat::set_wwcircmode(const char * value, const int8_t id) {
|
||||
uint8_t set;
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
if (!Helpers::value2enum(value, set, FL_(enum_wwCircMode))) {
|
||||
return false;
|
||||
}
|
||||
@@ -2088,7 +2118,7 @@ bool Thermostat::set_wwDailyHeatTime(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
uint8_t t = (set + 8) / 15;
|
||||
if (t > 95) {
|
||||
return false;
|
||||
@@ -2105,9 +2135,9 @@ bool Thermostat::set_wwDisinfect(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
write_command(0x2F5, 5, b ? 0xFF : 0x00, 0x2F5);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30wwSettings, 2, b ? 0xFF : 0x00, EMS_TYPE_RC30wwSettings);
|
||||
} else {
|
||||
write_command(0x37, 4, b ? 0xFF : 0x00, 0x37);
|
||||
@@ -2122,9 +2152,9 @@ bool Thermostat::set_wwDisinfectDay(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
write_command(0x2F5, 7, set, 0x2F5);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30wwSettings, 3, set, EMS_TYPE_RC30wwSettings);
|
||||
} else {
|
||||
write_command(0x37, 5, set, 0x37);
|
||||
@@ -2135,12 +2165,12 @@ bool Thermostat::set_wwDisinfectDay(const char * value, const int8_t id) {
|
||||
|
||||
bool Thermostat::set_wwDisinfectHour(const char * value, const int8_t id) {
|
||||
int set;
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_BC400) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
if (!Helpers::value2number(value, set, 0, 1431)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x2F5, 6, (set + 8) / 15, 0x2F5);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
if (!Helpers::value2number(value, set, 0, 23)) {
|
||||
return false;
|
||||
}
|
||||
@@ -2167,7 +2197,7 @@ bool Thermostat::set_wwMaxTemp(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
bool Thermostat::set_wwOneTimeKey(const char * value, const int8_t id) {
|
||||
bool b = false;
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
@@ -2184,7 +2214,7 @@ bool Thermostat::set_backlight(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(EMS_TYPE_RC30Settings, 12, b ? 0xFF : 0x00, EMS_TYPE_RC30Settings);
|
||||
} else {
|
||||
write_command(0xB0, 1, b ? 0xFF : 0x00, 0xB0);
|
||||
@@ -2436,6 +2466,9 @@ bool Thermostat::set_mode(const char * value, const int8_t id) {
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC30_N:
|
||||
mode_list = FL_(enum_mode3);
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_BC400:
|
||||
mode_list = FL_(enum_mode2);
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC300:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC100:
|
||||
mode_list = FL_(enum_mode);
|
||||
@@ -2455,8 +2488,9 @@ bool Thermostat::set_mode(const char * value, const int8_t id) {
|
||||
// check for the mode being a full string name or single digit
|
||||
if (!Helpers::value2enum(value, enum_index, mode_list)) {
|
||||
mode_list = FL_(enum_mode_ha);
|
||||
if (Mqtt::ha_enabled() && !Helpers::value2enum(value, enum_index, mode_list)) {
|
||||
LOG_WARNING("wrong mode: %s", value);
|
||||
if (!Mqtt::ha_enabled() || !Helpers::value2enum(value, enum_index, mode_list)) {
|
||||
// We have logging on fail in command.cpp
|
||||
// LOG_WARNING("wrong mode: %s", value);
|
||||
return false; // not found
|
||||
}
|
||||
}
|
||||
@@ -2558,17 +2592,16 @@ bool Thermostat::set_mode_n(const uint8_t mode, const uint8_t hc_num) {
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC30_N:
|
||||
offset = EMS_OFFSET_RC35Set_mode;
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_BC400:
|
||||
offset = EMS_OFFSET_RCPLUSSet_mode_new;
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC300:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC100:
|
||||
if (Helpers::hasValue(hc->mode_new)) {
|
||||
offset = EMS_OFFSET_RCPLUSSet_mode_new;
|
||||
} else {
|
||||
offset = EMS_OFFSET_RCPLUSSet_mode;
|
||||
set_mode_value = set_mode_value == 2 ? 0xFF : 0;
|
||||
}
|
||||
offset = EMS_OFFSET_RCPLUSSet_mode;
|
||||
set_mode_value = set_mode_value == 2 ? 0xFF : 0;
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_JUNKERS:
|
||||
if (has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
offset = EMS_OFFSET_JunkersSetMessage2_set_mode;
|
||||
} else {
|
||||
offset = EMS_OFFSET_JunkersSetMessage_set_mode;
|
||||
@@ -2596,8 +2629,10 @@ bool Thermostat::set_mode_n(const uint8_t mode, const uint8_t hc_num) {
|
||||
// set hc->mode temporary until validate is received
|
||||
if (model_ == EMSdevice::EMS_DEVICE_FLAG_RC10) {
|
||||
hc->mode = set_mode_value >> 1;
|
||||
} else if (model_ == EMSdevice::EMS_DEVICE_FLAG_BC400) {
|
||||
hc->mode_new = set_mode_value;
|
||||
} else if (model_ == EMSdevice::EMS_DEVICE_FLAG_RC300 || model_ == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
hc->mode = set_mode_value ? 1 : 0;
|
||||
hc->mode = set_mode_value == 0xFF ? 1 : 0;
|
||||
} else if (model_ == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
hc->mode = set_mode_value - 1;
|
||||
} else {
|
||||
@@ -2668,7 +2703,75 @@ bool Thermostat::set_switchonoptimization(const char * value, const int8_t id) {
|
||||
write_command(curve_typeids[hc->hc()], 4, b ? 0xFF : 0x00, curve_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
bool Thermostat::set_boost(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
write_command(set_typeids[hc->hc()], 23, b ? 0xFF : 0x00, set_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Thermostat::set_boosttime(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
return false;
|
||||
}
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(set_typeids[hc->hc()], 24, (uint8_t)v, set_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Thermostat::set_heatondelay(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
return false;
|
||||
}
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(summer2_typeids[hc->hc()], 2, (uint8_t)v, summer2_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Thermostat::set_heatoffdelay(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
return false;
|
||||
}
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(summer2_typeids[hc->hc()], 3, (uint8_t)v, summer2_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Thermostat::set_instantstart(const char * value, const int8_t id) {
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr) {
|
||||
return false;
|
||||
}
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(summer2_typeids[hc->hc()], 4, (uint8_t)v, summer2_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
|
||||
// sets the thermostat reducemode for RC35 and RC310
|
||||
bool Thermostat::set_reducemode(const char * value, const int8_t id) {
|
||||
@@ -2679,7 +2782,7 @@ bool Thermostat::set_reducemode(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
uint8_t set;
|
||||
if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400 || model() == EMSdevice::EMS_DEVICE_FLAG_RC300 || model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_reducemode1))) {
|
||||
write_command(set_typeids[hc->hc()], 5, set + 1, set_typeids[hc->hc()]);
|
||||
return true;
|
||||
@@ -2719,7 +2822,7 @@ bool Thermostat::set_nofrostmode(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
uint8_t set;
|
||||
if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400 || model() == EMSdevice::EMS_DEVICE_FLAG_RC300 || model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_nofrostmode1))) {
|
||||
write_command(curve_typeids[hc->hc()], 5, set + 1, curve_typeids[hc->hc()]);
|
||||
return true;
|
||||
@@ -2743,11 +2846,11 @@ bool Thermostat::set_heatingtype(const char * value, const int8_t id) {
|
||||
|
||||
uint8_t set;
|
||||
if (Helpers::value2enum(value, set, FL_(enum_heatingtype))) {
|
||||
if ((model() == EMS_DEVICE_FLAG_RC20_N) || (model() == EMS_DEVICE_FLAG_RC25)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC25)) {
|
||||
write_command(set_typeids[hc->hc()], 0, set, set_typeids[hc->hc()]);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) {
|
||||
write_command(set_typeids[hc->hc()], 0, set, set_typeids[hc->hc()]);
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(curve_typeids[hc->hc()], 0, set, curve_typeids[hc->hc()]);
|
||||
} else {
|
||||
write_command(curve_typeids[hc->hc()], 1, set, curve_typeids[hc->hc()]);
|
||||
@@ -2767,22 +2870,22 @@ bool Thermostat::set_controlmode(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
uint8_t set;
|
||||
if (model() == EMS_DEVICE_FLAG_RC100) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_controlmode))) {
|
||||
write_command(curve_typeids[hc->hc()], 0, set, curve_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC300) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400 || model() == EMSdevice::EMS_DEVICE_FLAG_RC300) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_controlmode1))) {
|
||||
write_command(curve_typeids[hc->hc()], 0, set + 1, curve_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_controlmode2))) {
|
||||
write_command(curve_typeids[hc->hc()], 1, set, curve_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_controlmode2))) {
|
||||
write_command(set_typeids[hc->hc()], 33, set, set_typeids[hc->hc()]);
|
||||
return true;
|
||||
@@ -2841,7 +2944,7 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char
|
||||
}
|
||||
const char * s_mode = doc["mode"];
|
||||
const char * s_time = doc["time"];
|
||||
if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) {
|
||||
bool b;
|
||||
if (Helpers::value2bool(s_mode, b)) {
|
||||
on = b ? 1 : 0;
|
||||
@@ -2849,7 +2952,7 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char
|
||||
if (strlen(s_time) == 5 && s_time[2] == ':') {
|
||||
time = 6 * ((s_time[0] - '0') * 10 + (s_time[1] - '0')) + (s_time[3] - '0');
|
||||
}
|
||||
} else if ((model() == EMS_DEVICE_FLAG_RC20) || (model() == EMS_DEVICE_FLAG_RC30)) {
|
||||
} else if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC30)) {
|
||||
if (s_mode[0] == 'T') {
|
||||
on = s_mode[1] - '0';
|
||||
} else {
|
||||
@@ -2915,7 +3018,7 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char
|
||||
|
||||
uint8_t min_on = 1;
|
||||
uint8_t max_on = 4;
|
||||
if ((model() == EMS_DEVICE_FLAG_RC35) || (model() == EMS_DEVICE_FLAG_RC30_N)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC35) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N)) {
|
||||
min_on = 0;
|
||||
max_on = 1;
|
||||
}
|
||||
@@ -2927,9 +3030,9 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char
|
||||
if (data[0] != 0xE7) {
|
||||
// we use EN settings for the day abbreviation
|
||||
auto sday = (FL_(enum_dayOfWeek)[day][0]);
|
||||
if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N) {
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N) {
|
||||
snprintf(out, len, "%02d %s %02d:%02d %s", no, sday, time / 6, 10 * (time % 6), on ? "on" : "off");
|
||||
} else if ((model() == EMS_DEVICE_FLAG_RC20) || (model() == EMS_DEVICE_FLAG_RC30)) {
|
||||
} else if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC30)) {
|
||||
snprintf(out, len, "%02d %s %02d:%02d T%d", no, sday, time / 6, 10 * (time % 6), on);
|
||||
} else {
|
||||
auto son = (FL_(enum_switchmode)[on][0]);
|
||||
@@ -3012,24 +3115,24 @@ bool Thermostat::set_program(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
uint8_t set;
|
||||
if ((model() == EMS_DEVICE_FLAG_RC20_N) || (model() == EMS_DEVICE_FLAG_RC25)) {
|
||||
if ((model() == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model() == EMSdevice::EMS_DEVICE_FLAG_RC25)) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_progMode3))) {
|
||||
write_command(set_typeids[hc->hc()], 11, set + 1, set_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N || model() == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_RC35 || model() == EMSdevice::EMS_DEVICE_FLAG_RC30_N || model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_progMode2))) {
|
||||
write_command(timer_typeids[hc->hc()], 84, set, timer_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400 || model() == EMSdevice::EMS_DEVICE_FLAG_RC300 || model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_progMode))) {
|
||||
write_command(set_typeids[hc->hc()], 11, set + 1, set_typeids[hc->hc()]);
|
||||
return true;
|
||||
}
|
||||
} else if (model() == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
} else if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
if (Helpers::value2enum(value, set, FL_(enum_progMode4))) {
|
||||
if (has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
write_command(set_typeids[hc->hc()], 10, set + 1, set_typeids[hc->hc()]);
|
||||
} else {
|
||||
write_command(set_typeids[hc->hc()], 13, set + 1, set_typeids[hc->hc()]);
|
||||
@@ -3055,7 +3158,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
uint16_t validate_typeid = monitor_typeids[hc->hc()];
|
||||
uint16_t set_typeid = set_typeids[hc->hc()];
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_RC10) {
|
||||
if (model == EMSdevice::EMS_DEVICE_FLAG_RC10) {
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::NIGHT:
|
||||
offset = 3;
|
||||
@@ -3074,7 +3177,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (model == EMS_DEVICE_FLAG_RC20) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_RC20) {
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::NIGHT:
|
||||
offset = 3;
|
||||
@@ -3117,7 +3220,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (model == EMS_DEVICE_FLAG_RC30) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::OFF:
|
||||
offset = EMS_OFFSET_RC30Set_temp_off;
|
||||
@@ -3167,7 +3270,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
break;
|
||||
}
|
||||
|
||||
} else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_BC400 || (model == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model == EMSdevice::EMS_DEVICE_FLAG_RC100)) {
|
||||
validate_typeid = set_typeids[hc->hc()];
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::SUMMER:
|
||||
@@ -3269,7 +3372,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
break;
|
||||
}
|
||||
|
||||
} else if ((model == EMS_DEVICE_FLAG_RC20_N) || (model == EMS_DEVICE_FLAG_RC25)) {
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model == EMSdevice::EMS_DEVICE_FLAG_RC25)) {
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::MINFLOW:
|
||||
offset = 15;
|
||||
@@ -3305,7 +3408,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
break;
|
||||
}
|
||||
|
||||
} else if ((model == EMS_DEVICE_FLAG_RC35) || (model == EMS_DEVICE_FLAG_RC30_N)) {
|
||||
} else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC35) || (model == EMSdevice::EMS_DEVICE_FLAG_RC30_N)) {
|
||||
validate_typeid = set_typeids[hc->hc()];
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::NIGHT: // change the night temp
|
||||
@@ -3325,7 +3428,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
factor = 1;
|
||||
break;
|
||||
case HeatingCircuit::Mode::DESIGN:
|
||||
if (hc->heatingtype == 3 && model == EMS_DEVICE_FLAG_RC35) {
|
||||
if (hc->heatingtype == 3 && model == EMSdevice::EMS_DEVICE_FLAG_RC35) {
|
||||
offset = EMS_OFFSET_RC35Set_temp_design_floor;
|
||||
} else {
|
||||
offset = EMS_OFFSET_RC35Set_temp_design;
|
||||
@@ -3364,7 +3467,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
factor = 1;
|
||||
break;
|
||||
case HeatingCircuit::Mode::MAXFLOW:
|
||||
if (hc->heatingtype == 3 && model == EMS_DEVICE_FLAG_RC35) {
|
||||
if (hc->heatingtype == 3 && model == EMSdevice::EMS_DEVICE_FLAG_RC35) {
|
||||
offset = 35;
|
||||
} else {
|
||||
offset = 15;
|
||||
@@ -3379,7 +3482,7 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
offset = EMS_OFFSET_RC35Set_temp_night;
|
||||
} else if (mode_ == HeatingCircuit::Mode::DAY) {
|
||||
offset = EMS_OFFSET_RC35Set_temp_day;
|
||||
} else if (model == EMS_DEVICE_FLAG_RC35) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_RC35) {
|
||||
offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/emsesp/EMS-ESP/issues/310
|
||||
} else {
|
||||
// RC30_N missing temporary auto temperature https://github.com/emsesp/EMS-ESP32/issues/395
|
||||
@@ -3389,10 +3492,10 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
// figure out if we have older or new thermostats, Heating Circuits on 0x65 or 0x79
|
||||
// see https://github.com/emsesp/EMS-ESP/issues/335#issuecomment-593324716)
|
||||
bool old_junkers = (has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD));
|
||||
bool old_junkers = (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD));
|
||||
if (!old_junkers) {
|
||||
switch (mode) {
|
||||
case HeatingCircuit::Mode::NOFROST:
|
||||
@@ -3497,7 +3600,7 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(tag, &tempsensor1_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(RFTemp), DeviceValueUOM::DEGREES);
|
||||
return;
|
||||
}
|
||||
// RC100H remote with humidity, this is also EMS_DEVICE_FLAG_RC100 for set_calinttemp
|
||||
// RC100H remote with humidity, this is also EMSdevice::EMS_DEVICE_FLAG_RC100 for set_calinttemp
|
||||
if (device_id() >= 0x38 && device_id() <= 0x3F) {
|
||||
// each device controls only one hc, so we tag the values
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x38;
|
||||
@@ -3520,8 +3623,9 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &lastCode_, DeviceValueType::STRING, FL_(lastCode), DeviceValueUOM::NONE);
|
||||
|
||||
switch (this->model()) {
|
||||
case EMS_DEVICE_FLAG_RC100:
|
||||
case EMS_DEVICE_FLAG_RC300:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC100:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC300:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_BC400:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&dateTime_,
|
||||
DeviceValueType::STRING,
|
||||
@@ -3564,8 +3668,24 @@ void Thermostat::register_device_values() {
|
||||
MAKE_CF_CB(set_minexttemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &ibaDamping_, DeviceValueType::BOOL, FL_(damping), DeviceValueUOM::NONE, MAKE_CF_CB(set_damping));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwSetTemp_, DeviceValueType::UINT, FL_(wwSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwtemp));
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwMode_, DeviceValueType::ENUM, FL_(enum_wwMode), FL_(wwMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwmode));
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_BC400) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_wwMode4),
|
||||
FL_(wwMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwmode));
|
||||
|
||||
} else {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_wwMode),
|
||||
FL_(wwMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwmode));
|
||||
}
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwSetTempLow_,
|
||||
DeviceValueType::UINT,
|
||||
@@ -3675,7 +3795,7 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &pvLowerCool_, DeviceValueType::INT, FL_(pvLowerCool), DeviceValueUOM::K, MAKE_CF_CB(set_pvLowerCool), -5, 0);
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC10:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC10:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&ibaCalIntTemperature_,
|
||||
DeviceValueType::INT,
|
||||
@@ -3694,8 +3814,8 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwMode_, DeviceValueType::ENUM, FL_(enum_wwMode3), FL_(wwMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwmode));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC20_N:
|
||||
case EMS_DEVICE_FLAG_RC25:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC20_N:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC25:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&ibaMinExtTemperature_,
|
||||
@@ -3704,10 +3824,10 @@ void Thermostat::register_device_values() {
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_minexttemp));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC20:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC20:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC30:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC30:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&ibaClockOffset_,
|
||||
@@ -3794,7 +3914,7 @@ void Thermostat::register_device_values() {
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwVacation));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC30_N:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC30_N:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&ibaMainDisplay_,
|
||||
@@ -3929,7 +4049,7 @@ void Thermostat::register_device_values() {
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwVacation));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC35:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC35:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&dateTime_,
|
||||
DeviceValueType::STRING,
|
||||
@@ -4056,10 +4176,10 @@ void Thermostat::register_device_values() {
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwVacation));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_JUNKERS:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_JUNKERS:
|
||||
// FR100 is not writable, see. https://github.com/emsesp/EMS-ESP32/issues/536
|
||||
// FW500 is not writable, see. https://github.com/emsesp/EMS-ESP32/issues/666
|
||||
if (has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_JUNKERS_OLD)) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(tpl_datetime), FL_(dateTime), DeviceValueUOM::NONE);
|
||||
} else {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
@@ -4130,11 +4250,11 @@ void Thermostat::register_device_values() {
|
||||
99);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwCharge_, DeviceValueType::BOOL, FL_(wwCharge), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwcharge));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_EASY:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_EASY:
|
||||
// Easy TC100 have no date/time, see issue #100, not sure about CT200, so leave it.
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_CRF:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_CRF:
|
||||
default:
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
|
||||
break;
|
||||
@@ -4157,10 +4277,10 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
uint8_t seltemp_divider;
|
||||
uint8_t roomtemp_divider;
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_EASY) {
|
||||
if (model == EMSdevice::EMS_DEVICE_FLAG_EASY) {
|
||||
seltemp_divider = DeviceValueNumOp::DV_NUMOP_DIV100;
|
||||
roomtemp_divider = DeviceValueNumOp::DV_NUMOP_DIV100;
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
seltemp_divider = DeviceValueNumOp::DV_NUMOP_DIV10;
|
||||
roomtemp_divider = DeviceValueNumOp::DV_NUMOP_DIV10;
|
||||
} else {
|
||||
@@ -4168,7 +4288,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
roomtemp_divider = DeviceValueNumOp::DV_NUMOP_DIV10;
|
||||
}
|
||||
|
||||
if (has_flags(EMS_DEVICE_FLAG_NO_WRITE)) {
|
||||
if (has_flags(EMSdevice::EMS_DEVICE_FLAG_NO_WRITE)) {
|
||||
register_device_value(tag, &hc->selTemp, DeviceValueType::SHORT, seltemp_divider, FL_(selRoomTemp), DeviceValueUOM::DEGREES);
|
||||
} else {
|
||||
register_device_value(tag, &hc->selTemp, DeviceValueType::SHORT, seltemp_divider, FL_(selRoomTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_temp), 0, 30);
|
||||
@@ -4177,7 +4297,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(tag, &hc->climate, DeviceValueType::ENUM, FL_(enum_climate), FL_(haclimate), DeviceValueUOM::NONE, nullptr, 5, 30);
|
||||
|
||||
switch (model) {
|
||||
case EMS_DEVICE_FLAG_RC10:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC10:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode6), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(
|
||||
tag, &hc->daytemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(daytemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_daytemp));
|
||||
@@ -4186,9 +4306,14 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(tag, &hc->reducehours, DeviceValueType::UINT, FL_(reducehours), DeviceValueUOM::HOURS, MAKE_CF_CB(set_reducehours));
|
||||
register_device_value(tag, &hc->reduceminutes, DeviceValueType::USHORT, FL_(reduceminutes), DeviceValueUOM::MINUTES);
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC100:
|
||||
case EMS_DEVICE_FLAG_RC300:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC100:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC300:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_BC400:
|
||||
if (model == EMSdevice::EMS_DEVICE_FLAG_BC400) {
|
||||
register_device_value(tag, &hc->mode_new, DeviceValueType::ENUM, FL_(enum_mode2), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
} else {
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
}
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype), FL_(modetype), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
tag, &hc->nighttemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(ecotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_ecotemp));
|
||||
@@ -4270,14 +4395,19 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
-1,
|
||||
101);
|
||||
register_device_value(tag, &hc->remotehum, DeviceValueType::UINT, FL_(remotehum), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_remotehum), -1, 101);
|
||||
register_device_value(tag, &hc->heatondelay, DeviceValueType::UINT, FL_(heatondelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_heatondelay), 1, 48);
|
||||
register_device_value(tag, &hc->heatoffdelay, DeviceValueType::UINT, FL_(heatoffdelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_heatoffdelay), 1, 48);
|
||||
register_device_value(tag, &hc->instantstart, DeviceValueType::UINT, FL_(instantstart), DeviceValueUOM::K, MAKE_CF_CB(set_instantstart), 1, 10);
|
||||
register_device_value(tag, &hc->boost, DeviceValueType::BOOL, FL_(boost), DeviceValueUOM::NONE, MAKE_CF_CB(set_boost));
|
||||
register_device_value(tag, &hc->boosttime, DeviceValueType::UINT, FL_(boosttime), DeviceValueUOM::HOURS, MAKE_CF_CB(set_boosttime));
|
||||
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_CRF:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_CRF:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype5), FL_(modetype), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT, FL_(targetflowtemp), DeviceValueUOM::DEGREES);
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC20:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC20:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode2), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(
|
||||
tag, &hc->manualtemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(manualtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_manualtemp));
|
||||
@@ -4294,7 +4424,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(
|
||||
tag, &hc->switchtime1, DeviceValueType::STRING, FL_(tpl_switchtime1), FL_(switchtime), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchtime1));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC20_N:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC20_N:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode3), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype3), FL_(modetype), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
@@ -4317,7 +4447,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(tag, &hc->summermode, DeviceValueType::ENUM, FL_(enum_summer), FL_(summermode), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->remotetemp, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(remotetemp), DeviceValueUOM::DEGREES);
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC25:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC25:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode3), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype3), FL_(modetype), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
@@ -4339,7 +4469,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(tag, &hc->summertemp, DeviceValueType::UINT, FL_(summertemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_summertemp), 9, 25);
|
||||
register_device_value(tag, &hc->summermode, DeviceValueType::ENUM, FL_(enum_summer), FL_(summermode), DeviceValueUOM::NONE);
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC30:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC30:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode2), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(tag, &hc->holiday, DeviceValueType::STRING, FL_(tpl_holidays), FL_(holidays), DeviceValueUOM::NONE, MAKE_CF_CB(set_holiday));
|
||||
register_device_value(tag, &hc->vacation, DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations), DeviceValueUOM::NONE, MAKE_CF_CB(set_vacation));
|
||||
@@ -4372,8 +4502,8 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(
|
||||
tag, &hc->nofrosttemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(offtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_offtemp));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC30_N:
|
||||
case EMS_DEVICE_FLAG_RC35:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC30_N:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_RC35:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode3), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype3), FL_(modetype), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
@@ -4457,7 +4587,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(
|
||||
tag, &hc->switchtime2, DeviceValueType::STRING, FL_(tpl_switchtime), FL_(switchtime2), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchtime2));
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_JUNKERS:
|
||||
case EMSdevice::EMS_DEVICE_FLAG_JUNKERS:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode4), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype4), FL_(modetype), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
|
||||
@@ -41,7 +41,7 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t tempautotemp;
|
||||
int8_t remoteseltemp;
|
||||
uint8_t mode;
|
||||
uint8_t mode_new = EMS_VALUE_UINT_NOTSET; // not initialized by register_value
|
||||
uint8_t mode_new;
|
||||
uint8_t modetype;
|
||||
uint8_t summermode;
|
||||
uint8_t holidaymode;
|
||||
@@ -98,6 +98,12 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t hpmode;
|
||||
uint8_t cooling;
|
||||
uint8_t coolingon;
|
||||
// RC300
|
||||
uint8_t heatoffdelay; // 1-48h
|
||||
uint8_t heatondelay; // 1-48h
|
||||
uint8_t instantstart; // 1-10K
|
||||
uint8_t boost;
|
||||
uint8_t boosttime; // hours
|
||||
|
||||
uint8_t hc_num() const {
|
||||
return hc_num_;
|
||||
@@ -439,6 +445,11 @@ class Thermostat : public EMSdevice {
|
||||
bool set_wwprio(const char * value, const int8_t id);
|
||||
bool set_fastheatup(const char * value, const int8_t id);
|
||||
bool set_switchonoptimization(const char * value, const int8_t id);
|
||||
bool set_heatondelay(const char * value, const int8_t id);
|
||||
bool set_heatoffdelay(const char * value, const int8_t id);
|
||||
bool set_instantstart(const char * value, const int8_t id);
|
||||
bool set_boost(const char * value, const int8_t id);
|
||||
bool set_boosttime(const char * value, const int8_t id);
|
||||
|
||||
inline bool set_temp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::AUTO);
|
||||
|
||||
458
src/devices/water.cpp
Normal file
458
src/devices/water.cpp
Normal file
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020-2023 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "water.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Water, EMSdevice::DeviceType::WATER);
|
||||
|
||||
uuid::log::Logger Water::logger_{F_(water), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
uint8_t tag = DeviceValueTAG::TAG_WWC1 + device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
|
||||
if (device_id == 0x2A) { // SM100, DHW3
|
||||
wwc_ = 2;
|
||||
// telegram handlers
|
||||
register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
|
||||
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
|
||||
register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand));
|
||||
register_telegram_type(0x07AC, "SM100wwParam1", false, MAKE_PF_CB(process_SM100wwParam2));
|
||||
register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc));
|
||||
register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam));
|
||||
register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm));
|
||||
register_telegram_type(0x07E0, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2));
|
||||
register_telegram_type(0x07AD, "SM100ValveStatus", false, MAKE_PF_CB(process_SM100ValveStatus));
|
||||
// device values...
|
||||
register_device_value(tag, &wwTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwTemp2_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwStorageTemp1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwColdTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwColdTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwTemp_5_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp5), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwRetTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(retTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwPump_, DeviceValueType::BOOL, FL_(wwPump), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwMaxTemp_, DeviceValueType::UINT, FL_(wwMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(tag, &wwSelTemp_, DeviceValueType::UINT, FL_(wwSelTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(tag, &wwRedTemp_, DeviceValueType::UINT, FL_(wwRedTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRedTemp));
|
||||
register_device_value(tag, &wwHotTemp_, DeviceValueType::UINT, FL_(wwHotTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwHotTemp));
|
||||
register_device_value(tag, &wwDailyTemp_, DeviceValueType::UINT, FL_(wwDailyTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwDailyTemp));
|
||||
register_device_value(tag, &wwDisinfectionTemp_, DeviceValueType::UINT, FL_(wwDisinfectionTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(tag, &wwCirc_, DeviceValueType::BOOL, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_freq), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
register_device_value(tag, &wwCircTc_, DeviceValueType::BOOL, FL_(wwCircTc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircTc));
|
||||
register_device_value(tag, &wwKeepWarm_, DeviceValueType::BOOL, FL_(wwKeepWarm), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwKeepWarm));
|
||||
register_device_value(tag, &wwStatus2_, DeviceValueType::ENUM, FL_(enum_wwStatus2), FL_(wwStatus2), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwPumpMod_, DeviceValueType::UINT, FL_(wwPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &wwFlow_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwFlow), DeviceValueUOM::LMIN);
|
||||
register_device_value(tag, &wwRetValve_, DeviceValueType::UINT, FL_(valveReturn), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_wwRetValve));
|
||||
register_device_value(tag, &wwDeltaTRet_, DeviceValueType::UINT, FL_(deltaTRet), DeviceValueUOM::K, MAKE_CF_CB(set_wwDeltaTRet));
|
||||
register_device_value(tag, &errorDisp_, DeviceValueType::ENUM, FL_(enum_errorDisp), FL_(errorDisp), DeviceValueUOM::NONE, MAKE_CF_CB(set_errorDisp));
|
||||
|
||||
} else if (device_id >= EMSdevice::EMS_DEVICE_ID_DHW1 && device_id <= EMSdevice::EMS_DEVICE_ID_DHW2) {
|
||||
wwc_ = device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
|
||||
register_telegram_type(0x331 + wwc_, "MMPLUSStatusMessage_WWC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC));
|
||||
register_telegram_type(0x313 + wwc_, "MMPLUSConfigMessage_WWC", true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC));
|
||||
// register_telegram_type(0x33B + type_offset, "MMPLUSSetMessage_WWC", true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC));
|
||||
// device values...
|
||||
register_device_value(tag, &wwTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwStatus_, DeviceValueType::INT, FL_(wwTempStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwPump_, DeviceValueType::BOOL, FL_(wwPump), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwMaxTemp_, DeviceValueType::UINT, FL_(wwMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(tag, &wwDiffTemp_, DeviceValueType::INT, FL_(wwDiffTemp), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwDiffTemp));
|
||||
register_device_value(tag, &wwDisinfectionTemp_, DeviceValueType::UINT, FL_(wwDisinfectionTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(tag, &wwRedTemp_, DeviceValueType::UINT, FL_(wwRedTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRedTemp));
|
||||
register_device_value(tag, &wwRequiredTemp_, DeviceValueType::UINT, FL_(wwRequiredTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRequiredTemp));
|
||||
register_device_value(tag, &wwCirc_, DeviceValueType::BOOL, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
} else if (device_id == 0x40) { // flags == EMSdevice::EMS_DEVICE_FLAG_IPM, special DHW pos 10
|
||||
wwc_ = 0;
|
||||
tag = DeviceValueTAG::TAG_WWC1;
|
||||
register_telegram_type(0x34, "UBAMonitorWW", false, MAKE_PF_CB(process_IPMMonitorWW));
|
||||
register_telegram_type(0x1E, "HydrTemp", false, MAKE_PF_CB(process_IPMHydrTemp));
|
||||
register_telegram_type(0x33, "UBAParameterWW", true, MAKE_PF_CB(process_IPMParameterWW));
|
||||
// register_telegram_type(0x10D, "wwNTCStatus", false, MAKE_PF_CB(process_wwNTCStatus));
|
||||
// device values...
|
||||
register_device_value(tag, &wwSelTemp_, DeviceValueType::UINT, FL_(wwSelTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(tag, &wwTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwTemp2_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwCurTemp2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &HydrTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hydrTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwPump_, DeviceValueType::BOOL, FL_(wwPump), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwFlowTempOffset_, DeviceValueType::UINT, FL_(wwFlowTempOffset), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwFlowTempOffset));
|
||||
register_device_value(tag, &wwHystOn_, DeviceValueType::INT, FL_(wwHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOn));
|
||||
register_device_value(tag, &wwHystOff_, DeviceValueType::INT, FL_(wwHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOff));
|
||||
register_device_value(tag, &wwDisinfectionTemp_, DeviceValueType::UINT, FL_(wwDisinfectionTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(tag, &wwCirc_, DeviceValueType::BOOL, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
}
|
||||
}
|
||||
|
||||
// SM100wwTemperature - 0x07D6
|
||||
// Solar Module(0x2A) -> (0x00), (0x7D6), data: 01 C1 00 00 02 5B 01 AF 01 AD 80 00 01 90
|
||||
void Water::process_SM100wwTemperature(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwTemp_, 0); // is *10 TS17
|
||||
has_update(telegram, wwFlow_, 2); // is *10 l/min
|
||||
has_update(telegram, wwTemp2_, 4); // is *10 TS21
|
||||
has_update(telegram, wwColdTemp_, 6); // is *10 cold water
|
||||
has_update(telegram, wwTemp_5_, 8); // is *10
|
||||
// has_update(telegram, wwTemp_6_, 10); // is *10 always unset 8000
|
||||
// has_update(telegram, wwTemp_7_, 12); // is *10, same as wwTemp_1_
|
||||
has_update(telegram, wwRetTemp_, 14); // is *10, return temp TS22
|
||||
}
|
||||
|
||||
// SM100wwStatus - 0x07AA
|
||||
// Solar Module(0x2A) -> (0x00), (0x7AA), data: 64 00 04 00 03 00 28 01 0F
|
||||
void Water::process_SM100wwStatus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwPump_, 0);
|
||||
}
|
||||
|
||||
// SM100wwParam - 0x07A6, Solar Module(0x2A) -> (0x00)
|
||||
// data: FF 05 0F 5F 00 01 3C 3C 3C 3C 28 12 46 01 3C 1E 03 07 3C 00 0F 00 05
|
||||
void Water::process_SM100wwParam(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwDailyTemp_, 6);
|
||||
has_update(telegram, wwHotTemp_, 7);
|
||||
has_update(telegram, wwMaxTemp_, 8);
|
||||
has_update(telegram, wwSelTemp_, 9);
|
||||
has_update(telegram, wwRedTemp_, 10);
|
||||
has_update(telegram, wwDisinfectionTemp_, 12);
|
||||
// (daily heating time thermostat 2F5, offset 9, offset 8 on/off)
|
||||
has_update(telegram, errorDisp_, 19);
|
||||
}
|
||||
// SM100wwParam2 - 0x07AC, Solar Module(0x2A) -> (0x00)
|
||||
void Water::process_SM100wwParam2(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwDeltaTRet_, 1);
|
||||
}
|
||||
|
||||
// SM100wwCirc - 0x07A5
|
||||
// Solar Module(0x2A) -> (0x00), (0x7A5), data:
|
||||
void Water::process_SM100wwCirc(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwCirc_, 0);
|
||||
has_update(telegram, wwCircMode_, 3);
|
||||
has_update(telegram, wwCircTc_, 4); // time controled on/off
|
||||
}
|
||||
|
||||
// SM100wwKeepWarm - 0x7AE, keepWarm
|
||||
// Thermostat(0x10) -> Solar(0x2A), ?(0x7AE), data: FF
|
||||
void Water::process_SM100wwKeepWarm(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwKeepWarm_, 0);
|
||||
}
|
||||
|
||||
// SM100ValveStatus - 0x7AD, valveStatus
|
||||
// Thermostat(0x10) -> Solar(0x2A), ?(0x7AD), data:
|
||||
void Water::process_SM100ValveStatus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwRetValve_, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
// SM100ww? - 0x7E0, some kind of status
|
||||
// data: 00 00 46 00 00 01 06 0E 06 0E 00 00 00 00 00 03 03 03 03
|
||||
// publishes single values offset 1/2(16bit), offset 5, offset 6, offset 7, offset 8, offset 9,
|
||||
// status2 = 03:"no heat", 06:"heat request", 08:"disinfecting", 09:"hold"
|
||||
*/
|
||||
void Water::process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram) {
|
||||
// has_update(telegram, wwFlow_, 7); // single byte, wrong see #1387
|
||||
has_update(telegram, wwStatus2_, 8);
|
||||
has_update(telegram, wwPumpMod_, 9);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
// SM100wwCommand - 0x07AB
|
||||
// Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01
|
||||
void Water::process_SM100wwCommand(std::shared_ptr<const Telegram> telegram) {
|
||||
// not implemented yet
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/*
|
||||
* MM100 messages
|
||||
*/
|
||||
|
||||
// Mixer warm water loading/DHW - 0x0331, 0x0332
|
||||
// e.g. A9 00 FF 00 02 32 02 6C 00 3C 00 3C 3C 46 02 03 03 00 3C // on 0x28
|
||||
// A8 00 FF 00 02 31 02 35 00 3C 00 3C 3C 46 02 03 03 00 3C // in 0x29
|
||||
void Water::process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwTemp_, 0); // is * 10
|
||||
has_bitupdate(telegram, wwPump_, 2, 0);
|
||||
has_update(telegram, wwStatus_, 11); // temp status
|
||||
}
|
||||
|
||||
// Config message 0x313, has to be fetched
|
||||
void Water::process_MMPLUSConfigMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwRequiredTemp_, 4);
|
||||
has_update(telegram, wwRedTemp_, 5);
|
||||
has_update(telegram, wwDiffTemp_, 7);
|
||||
has_update(telegram, wwDisinfectionTemp_, 9);
|
||||
has_update(telegram, wwMaxTemp_, 10);
|
||||
}
|
||||
|
||||
// unknown, 2 examples from older threads
|
||||
// Thermostat(0x10) -> Mixer(0x28), ?(0x33B), data: 01 01 00
|
||||
// Thermostat -> Mixing Module, type 0x023B, telegram: 90 28 FF 00 02 3B 00 02 00 (CRC=68)
|
||||
void Water::process_MMPLUSSetMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
}
|
||||
|
||||
// MMPLUS telegram 0x345 unknown
|
||||
// Solar Module -> Mixing Module, type 0x0245, telegram: B0 28 FF 00 02 45 64 01 01 (CRC=36)
|
||||
// ?
|
||||
|
||||
/*
|
||||
* IPM messages
|
||||
*/
|
||||
|
||||
// 0x34 only 8 bytes long
|
||||
// Mixer(0x41) -> All(0x00), UBAMonitorWW(0x34), data: 37 02 1E 02 1E 00 00 00 00
|
||||
void Water::process_IPMMonitorWW(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, wwSelTemp_, 0);
|
||||
has_update(telegram, wwTemp_, 1);
|
||||
has_update(telegram, wwTemp2_, 3);
|
||||
has_bitupdate(telegram, wwPump_, 5, 3);
|
||||
}
|
||||
|
||||
// Mixer(0x41) -> Me(0x0B), UBAParameterWW(0x33), data: 08 FF 46 FB FF 28 FF 07 46 00 FF 00
|
||||
void Water::process_IPMParameterWW(std::shared_ptr<const Telegram> telegram) {
|
||||
// has_update(telegram, wwActivated_, 1); // 0xFF means on
|
||||
// has_update(telegram, wwSelTemp_, 2);
|
||||
has_update(telegram, wwHystOn_, 3); // Hyst on (default -5)
|
||||
has_update(telegram, wwHystOff_, 4); // Hyst off (default -1)
|
||||
has_update(telegram, wwFlowTempOffset_, 5); // default 40
|
||||
has_update(telegram, wwCirc_, 6); // 0xFF means on
|
||||
has_update(telegram, wwCircMode_, 7); // 1=1x3min 6=6x3min 7=continuous
|
||||
has_update(telegram, wwDisinfectionTemp_, 8);
|
||||
// has_bitupdate(telegram, wwChargeType_, 10, 0); // 0 = charge pump, 0xff = 3-way valve
|
||||
}
|
||||
|
||||
|
||||
// 0x1E, only16 bit temperature
|
||||
// Mixer(0x41) -> Boiler(0x08), HydrTemp(0x1E), data: 01 D8
|
||||
void Water::process_IPMHydrTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, HydrTemp_, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Settings
|
||||
*/
|
||||
|
||||
bool Water::set_wwSelTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x35, 3, (uint8_t)temperature, 0x34);
|
||||
} else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
return false;
|
||||
} else { // SM100
|
||||
write_command(0x7A6, 9, (uint8_t)temperature, 0x7A6);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwMaxTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
return false;
|
||||
} else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x313 + wwc_, 10, (uint8_t)temperature, 0x313 + wwc_);
|
||||
} else { // SM100
|
||||
write_command(0x7A6, 8, (uint8_t)temperature, 0x7A6);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwRedTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
return false;
|
||||
} else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x313 + wwc_, 5, (uint8_t)temperature, 0x313 + wwc_);
|
||||
} else { // SM100
|
||||
write_command(0x7A6, 10, (uint8_t)temperature, 0x7A6);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwHotTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 7, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwDailyTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 6, (uint8_t)temperature, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwDisinfectionTemp(const char * value, const int8_t id) {
|
||||
int temperature;
|
||||
if (!Helpers::value2temperature(value, temperature)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x33, 8, (uint8_t)temperature, 0x33);
|
||||
} else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x313 + wwc_, 9, (uint8_t)temperature, 0x313 + wwc_);
|
||||
} else { // SM100
|
||||
write_command(0x7A6, 12, (uint8_t)temperature, 0x7A6);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwCirc(const char * value, const int8_t id) {
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x33, 6, b ? 0xFF : 0x00, 0x33);
|
||||
} else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x33B + wwc_, 0, b ? 0x01 : 0x00, 0x33B + wwc_);
|
||||
} else { // SM100
|
||||
write_command(0x7A5, 0, b ? 0xFF : 0x00, 0x7A5);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwCircMode(const char * value, const int8_t id) {
|
||||
uint8_t num;
|
||||
if (!Helpers::value2enum(value, num, FL_(enum_wwCircMode))) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
write_command(0x33, 7, num, 0x33);
|
||||
} else if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x313 + wwc_, 0, num, 0x313 + wwc_);
|
||||
} else { // SM100
|
||||
write_command(0x7A5, 3, num, 0x7A5);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// set time controled mode on/off
|
||||
bool Water::set_wwCircTc(const char * value, const int8_t id) {
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33B + wwc_, 4, b ? 0x01 : 0x00, 0x33B + wwc_);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwKeepWarm(const char * value, const int8_t id) {
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7AE, 0, b ? 0xFF : 0x00, 0x7AE);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwDiffTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x313 + wwc, 7, (int8_t)(v * 10), 0x313 + wwc);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Water::set_wwRequiredTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
write_command(0x313 + wwc, 4, (uint8_t)v, 0x313 + wwc);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Water::set_wwFlowTempOffset(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33, 5, n, 0x33);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwHystOn(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33, 3, n, 0x33);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwHystOff(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x33, 4, n, 0x33);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwRetValve(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7AD, 1, n, 0x7AD);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_errorDisp(const char * value, const int8_t id) {
|
||||
uint8_t n;
|
||||
if (!Helpers::value2enum(value, n, FL_(enum_errorDisp))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7A6, 19, n, 0x7A6);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Water::set_wwDeltaTRet(const char * value, const int8_t id) {
|
||||
int n;
|
||||
if (!Helpers::value2number(value, n)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x7AC, 1, n, 0x7AC);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
129
src/devices/water.h
Normal file
129
src/devices/water.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020-2023 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_WATER_H
|
||||
#define EMSESP_WATER_H
|
||||
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
class Water : public EMSdevice {
|
||||
public:
|
||||
Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
uint8_t wwc_;
|
||||
|
||||
// SM100wwTemperature - 0x07D6
|
||||
uint16_t wwTemp_;
|
||||
uint16_t wwFlow_;
|
||||
uint16_t wwTemp2_;
|
||||
uint16_t wwColdTemp_;
|
||||
uint16_t wwTemp_5_;
|
||||
uint16_t wwRetTemp_;
|
||||
|
||||
// SM100ValveStatus - 0x07AD
|
||||
uint8_t wwRetValve_; // VS5
|
||||
|
||||
// SM100wwStatus - 0x07AA
|
||||
uint8_t wwPump_;
|
||||
|
||||
// SM100wwParam2 - 0x07AC
|
||||
uint8_t wwDeltaTRet_;
|
||||
|
||||
// SM100wwParam - 0x07A6
|
||||
uint8_t wwMaxTemp_;
|
||||
uint8_t wwSelTemp_;
|
||||
uint8_t wwRedTemp_;
|
||||
uint8_t wwDailyTemp_;
|
||||
uint8_t wwDisinfectionTemp_;
|
||||
uint8_t wwHotTemp_;
|
||||
uint8_t errorDisp_; // error display off/normal/inverted
|
||||
|
||||
// SM100wwKeepWarm - 0x07AE
|
||||
uint8_t wwKeepWarm_;
|
||||
|
||||
// SM100wwCirc - 0x07A5
|
||||
uint8_t wwCirc_;
|
||||
uint8_t wwCircMode_;
|
||||
uint8_t wwCircTc_;
|
||||
|
||||
// SM100wwStatus2 - 0x07E0
|
||||
uint8_t wwPumpMod_;
|
||||
uint8_t wwStatus2_;
|
||||
|
||||
// mixer
|
||||
uint8_t wwStatus_;
|
||||
int8_t wwDiffTemp_;
|
||||
uint8_t wwRequiredTemp_;
|
||||
|
||||
// IPM
|
||||
uint16_t HydrTemp_;
|
||||
int8_t wwHystOn_; // Hyst on (default -5)
|
||||
int8_t wwHystOff_; // Hyst off (default -1)
|
||||
uint8_t wwFlowTempOffset_; // default 40
|
||||
|
||||
|
||||
void process_SM100wwTemperature(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwStatus(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwCommand(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwCirc(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwParam(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwParam2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100wwKeepWarm(std::shared_ptr<const Telegram> telegram);
|
||||
void process_SM100ValveStatus(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMPLUSSetMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMPLUSConfigMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_IPMMonitorWW(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMHydrTemp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_IPMParameterWW(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
|
||||
bool set_wwSelTemp(const char * value, const int8_t id);
|
||||
bool set_wwMaxTemp(const char * value, const int8_t id);
|
||||
bool set_wwRedTemp(const char * value, const int8_t id);
|
||||
bool set_wwHotTemp(const char * value, const int8_t id);
|
||||
bool set_wwCirc(const char * value, const int8_t id);
|
||||
bool set_wwCircMode(const char * value, const int8_t id);
|
||||
bool set_wwCircTc(const char * value, const int8_t id);
|
||||
bool set_wwKeepWarm(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectionTemp(const char * value, const int8_t id);
|
||||
bool set_wwDailyTemp(const char * value, const int8_t id);
|
||||
|
||||
bool set_wwDiffTemp(const char * value, const int8_t id);
|
||||
bool set_wwRequiredTemp(const char * value, const int8_t id);
|
||||
|
||||
bool set_wwFlowTempOffset(const char * value, const int8_t id);
|
||||
bool set_wwHystOn(const char * value, const int8_t id);
|
||||
bool set_wwHystOff(const char * value, const int8_t id);
|
||||
|
||||
bool set_wwDeltaTRet(const char * value, const int8_t id);
|
||||
bool set_wwRetValve(const char * value, const int8_t id);
|
||||
bool set_errorDisp(const char * value, const int8_t id);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
#endif
|
||||
@@ -107,6 +107,8 @@ const char * EMSdevice::device_type_2_device_name(const uint8_t device_type) {
|
||||
return F_(system);
|
||||
case DeviceType::SCHEDULER:
|
||||
return F_(scheduler);
|
||||
case DeviceType::CUSTOM:
|
||||
return F_(custom);
|
||||
case DeviceType::BOILER:
|
||||
return F_(boiler);
|
||||
case DeviceType::THERMOSTAT:
|
||||
@@ -135,10 +137,12 @@ const char * EMSdevice::device_type_2_device_name(const uint8_t device_type) {
|
||||
return F_(extension);
|
||||
case DeviceType::HEATSOURCE:
|
||||
return F_(heatsource);
|
||||
case DeviceType::CUSTOM:
|
||||
return F_(custom);
|
||||
case DeviceType::VENTILATION:
|
||||
return F_(ventilation);
|
||||
case DeviceType::WATER:
|
||||
return F_(water);
|
||||
case DeviceType::POOL:
|
||||
return F_(pool);
|
||||
default:
|
||||
return Helpers::translated_word(FL_(unknown), true);
|
||||
}
|
||||
@@ -174,6 +178,10 @@ const char * EMSdevice::device_type_2_device_name_translated() {
|
||||
return Helpers::translated_word(FL_(heatsource_device));
|
||||
case DeviceType::VENTILATION:
|
||||
return Helpers::translated_word(FL_(ventilation_device));
|
||||
case DeviceType::WATER:
|
||||
return Helpers::translated_word(FL_(water_device));
|
||||
case DeviceType::POOL:
|
||||
return Helpers::translated_word(FL_(pool_device));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -241,6 +249,12 @@ uint8_t EMSdevice::device_name_2_device_type(const char * topic) {
|
||||
if (!strcmp(lowtopic, F_(ventilation))) {
|
||||
return DeviceType::VENTILATION;
|
||||
}
|
||||
if (!strcmp(lowtopic, F_(water))) {
|
||||
return DeviceType::WATER;
|
||||
}
|
||||
if (!strcmp(lowtopic, F_(pool))) {
|
||||
return DeviceType::POOL;
|
||||
}
|
||||
|
||||
return DeviceType::UNKNOWN;
|
||||
}
|
||||
@@ -827,7 +841,7 @@ std::string EMSdevice::get_value_uom(const std::string & shortname) const {
|
||||
return std::string{}; // not found
|
||||
}
|
||||
|
||||
bool EMSdevice::export_values(uint8_t unique_id, JsonObject & output, const int8_t id, const uint8_t output_target) {
|
||||
bool EMSdevice::export_values(uint8_t device_type, JsonObject & output, const int8_t id, const uint8_t output_target) {
|
||||
bool has_value = false;
|
||||
uint8_t tag;
|
||||
if (id >= 1 && id <= (1 + DeviceValueTAG::TAG_HS16 - DeviceValueTAG::TAG_HC1)) {
|
||||
@@ -840,7 +854,7 @@ bool EMSdevice::export_values(uint8_t unique_id, JsonObject & output, const int8
|
||||
|
||||
if (id > 0 || output_target == EMSdevice::OUTPUT_TARGET::API_VERBOSE) {
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->unique_id() == unique_id) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type)) {
|
||||
has_value |= emsdevice->generate_values(output, tag, (id < 1), output_target); // use nested for id -1 and 0
|
||||
}
|
||||
}
|
||||
@@ -852,7 +866,7 @@ bool EMSdevice::export_values(uint8_t unique_id, JsonObject & output, const int8
|
||||
JsonObject output_hc = output;
|
||||
bool nest_created = false;
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->unique_id() == unique_id) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type)) {
|
||||
if (!nest_created && emsdevice->has_tags(tag)) {
|
||||
output_hc = output.createNestedObject(EMSdevice::tag_to_mqtt(tag));
|
||||
nest_created = true;
|
||||
@@ -969,19 +983,15 @@ void EMSdevice::generate_values_web(JsonObject & output) {
|
||||
}
|
||||
// handle INTs
|
||||
else {
|
||||
// add step if it's not 1
|
||||
if (dv.numeric_operator > 0) {
|
||||
obj["s"] = (float)1 / dv.numeric_operator;
|
||||
} else if (dv.numeric_operator < 0) {
|
||||
obj["s"] = (float)(-1) * dv.numeric_operator;
|
||||
}
|
||||
|
||||
// add min and max values, if available
|
||||
int16_t dv_set_min;
|
||||
uint32_t dv_set_max;
|
||||
if (dv.get_min_max(dv_set_min, dv_set_max)) {
|
||||
obj["m"] = dv_set_min;
|
||||
obj["x"] = dv_set_max;
|
||||
// add steps to numeric values as rendered string to avoid rounding floats in js
|
||||
char s[10];
|
||||
obj["s"] = Helpers::render_value(s, (uint32_t)1, dv.numeric_operator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,9 @@ class EMSdevice {
|
||||
SYSTEM = 0, // this is us (EMS-ESP)
|
||||
TEMPERATURESENSOR, // for internal temperature sensors
|
||||
ANALOGSENSOR, // for internal analog sensors
|
||||
SCHEDULER,
|
||||
SCHEDULER, // for internal schedule
|
||||
CUSTOM, // for user defined entities
|
||||
|
||||
BOILER,
|
||||
THERMOSTAT,
|
||||
MIXER,
|
||||
@@ -356,8 +358,9 @@ class EMSdevice {
|
||||
EXTENSION,
|
||||
GENERIC,
|
||||
HEATSOURCE,
|
||||
CUSTOM,
|
||||
VENTILATION,
|
||||
WATER,
|
||||
POOL,
|
||||
UNKNOWN
|
||||
};
|
||||
|
||||
@@ -382,8 +385,11 @@ class EMSdevice {
|
||||
static constexpr uint8_t EMS_DEVICE_ID_MODEM = 0x48;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RFSENSOR = 0x40; // RF sensor only sending, no reply
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RFBASE = 0x50;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_ROOMTHERMOSTAT = 0x17; // TADO using this with no version reply
|
||||
static constexpr uint8_t EMS_DEVICE_ID_TADO_OLD = 0x19; // TADO using this with no broadcast and version
|
||||
static constexpr uint8_t EMS_DEVICE_ID_ROOMTHERMOSTAT = 0x17; // TADO using this with no version reply #174
|
||||
static constexpr uint8_t EMS_DEVICE_ID_TADO_OLD = 0x19; // older TADO using this with no version reply, #1031
|
||||
static constexpr uint8_t EMS_DEVICE_ID_DHW1 = 0x28; // MM100 module as water station
|
||||
static constexpr uint8_t EMS_DEVICE_ID_DHW2 = 0x29; // MM100 module as water station
|
||||
static constexpr uint8_t EMS_DEVICE_ID_DHW8 = 0x2F; // last DHW module id?
|
||||
|
||||
// generic type IDs
|
||||
static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices.
|
||||
@@ -430,6 +436,7 @@ class EMSdevice {
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_JUNKERS = 11;
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_CRF = 12; // CRF200 only monitor
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_RC100H = 13; // with humidity
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_BC400 = 14; // mostly like RC300, but some changes
|
||||
|
||||
uint8_t count_entities();
|
||||
bool has_entities() const;
|
||||
|
||||
@@ -484,6 +484,7 @@ void EMSESP::publish_all(bool force) {
|
||||
publish_device_values(EMSdevice::DeviceType::THERMOSTAT);
|
||||
publish_device_values(EMSdevice::DeviceType::SOLAR);
|
||||
publish_device_values(EMSdevice::DeviceType::MIXER);
|
||||
publish_device_values(EMSdevice::DeviceType::WATER);
|
||||
publish_other_values(); // switch and heat pump, ...
|
||||
publish_sensor_values(true); // includes temperature and analog sensors
|
||||
system_.send_heartbeat();
|
||||
@@ -515,12 +516,15 @@ void EMSESP::publish_all_loop() {
|
||||
publish_device_values(EMSdevice::DeviceType::MIXER);
|
||||
break;
|
||||
case 5:
|
||||
publish_other_values(); // switch and heat pump
|
||||
publish_device_values(EMSdevice::DeviceType::WATER);
|
||||
break;
|
||||
case 6:
|
||||
publish_sensor_values(true, true);
|
||||
publish_other_values(); // switch and heat pump
|
||||
break;
|
||||
case 7:
|
||||
publish_sensor_values(true, true);
|
||||
break;
|
||||
case 8:
|
||||
if (Mqtt::ha_enabled()) {
|
||||
Mqtt::ha_status();
|
||||
}
|
||||
@@ -602,6 +606,7 @@ void EMSESP::publish_other_values() {
|
||||
publish_device_values(EMSdevice::DeviceType::VENTILATION);
|
||||
publish_device_values(EMSdevice::DeviceType::EXTENSION);
|
||||
publish_device_values(EMSdevice::DeviceType::ALERT);
|
||||
publish_device_values(EMSdevice::DeviceType::POOL);
|
||||
// other devices without values yet
|
||||
// publish_device_values(EMSdevice::DeviceType::GATEWAY);
|
||||
// publish_device_values(EMSdevice::DeviceType::CONNECT);
|
||||
@@ -1081,7 +1086,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
auto device_type = device_p->device_type;
|
||||
auto flags = device_p->flags;
|
||||
|
||||
// check for integrated modules with same product id
|
||||
// check for integrated modules with same product id, but different function (device_id)
|
||||
if (device_type == DeviceType::HEATPUMP) {
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_MODEM) {
|
||||
device_type = DeviceType::GATEWAY;
|
||||
@@ -1091,6 +1096,9 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
name = "Wireless sensor base";
|
||||
}
|
||||
}
|
||||
if (device_id >= EMSdevice::EMS_DEVICE_ID_DHW1 && device_id <= EMSdevice::EMS_DEVICE_ID_DHW8) {
|
||||
device_type = DeviceType::WATER;
|
||||
}
|
||||
|
||||
// empty reply to version, read a generic device from database
|
||||
if (product_id == 0) {
|
||||
|
||||
@@ -102,6 +102,8 @@ MAKE_WORD(heatsource)
|
||||
MAKE_WORD(scheduler)
|
||||
MAKE_WORD(custom)
|
||||
MAKE_WORD(ventilation)
|
||||
MAKE_WORD(water)
|
||||
MAKE_WORD(pool)
|
||||
|
||||
// brands
|
||||
MAKE_WORD_CUSTOM(bosch, "Bosch")
|
||||
@@ -283,6 +285,7 @@ MAKE_ENUM(enum_flow, FL_(off), FL_(flow), FL_(bufferedflow), FL_(buffer), FL_(la
|
||||
MAKE_ENUM(enum_reset, FL_(dash), FL_(maintenance), FL_(error))
|
||||
MAKE_ENUM(enum_maxHeat, FL_(0kW), FL_(2kW), FL_(3kW), FL_(4kW), FL_(6kW), FL_(9kW))
|
||||
MAKE_ENUM(enum_pumpMode, FL_(proportional), FL_(deltaP1), FL_(deltaP2), FL_(deltaP3), FL_(deltaP4))
|
||||
MAKE_ENUM(enum_hpPumpMode, FL_(auto), FL_(continuous))
|
||||
|
||||
// thermostat lists
|
||||
MAKE_ENUM(enum_ibaMainDisplay, FL_(internal_temperature), FL_(internal_setpoint), FL_(external_temperature), FL_(burner_temperature), FL_(ww_temperature), FL_(functioning_mode), FL_(time), FL_(date), FL_(smoke_temperature))
|
||||
@@ -291,10 +294,11 @@ MAKE_ENUM(enum_ibaLanguage_RC30, FL_(german), FL_(dutch))
|
||||
MAKE_ENUM(enum_floordrystatus, FL_(off), FL_(start), FL_(heat), FL_(hold), FL_(cool), FL_(end))
|
||||
MAKE_ENUM(enum_ibaBuildingType, FL_(light), FL_(medium), FL_(heavy))
|
||||
MAKE_ENUM(enum_PID, FL_(fast), FL_(medium), FL_(slow))
|
||||
MAKE_ENUM(enum_wwMode, FL_(off), FL_(normal), FL_(comfort), FL_(auto), FL_(own_prog), FL_(eco))
|
||||
MAKE_ENUM(enum_wwMode, FL_(off), FL_(normal), FL_(comfort), FL_(auto), FL_(own_prog))
|
||||
MAKE_ENUM(enum_wwCircMode, FL_(off), FL_(on), FL_(auto), FL_(own_prog))
|
||||
MAKE_ENUM(enum_wwMode2, FL_(off), FL_(on), FL_(auto))
|
||||
MAKE_ENUM(enum_wwMode3, FL_(on), FL_(off), FL_(auto))
|
||||
MAKE_ENUM(enum_wwMode4, FL_(off), FL_(ecoplus), FL_(eco), FL_(comfort), FL_(auto))
|
||||
MAKE_ENUM(enum_heatingtype, FL_(off), FL_(radiator), FL_(convector), FL_(floor))
|
||||
MAKE_ENUM(enum_summermode, FL_(summer), FL_(auto), FL_(winter))
|
||||
MAKE_ENUM(enum_hpoperatingmode, FL_(off), FL_(auto), FL_(heating), FL_(cooling))
|
||||
@@ -302,8 +306,8 @@ MAKE_ENUM(enum_summer, FL_(winter), FL_(summer))
|
||||
MAKE_ENUM(enum_operatingstate, FL_(heating), FL_(off), FL_(cooling))
|
||||
MAKE_ENUM(enum_hpmode, FL_(heating), FL_(cooling), FL_(heatandcool))
|
||||
|
||||
MAKE_ENUM(enum_mode, FL_(off), FL_(manual), FL_(auto)) // RC100, RC300, RC310
|
||||
MAKE_ENUM(enum_mode2, FL_(off), FL_(manual), FL_(auto)) // RC20, RC30
|
||||
MAKE_ENUM(enum_mode, FL_(manual), FL_(auto)) // RC100, RC300, RC310
|
||||
MAKE_ENUM(enum_mode2, FL_(off), FL_(manual), FL_(auto)) // RC20, RC30, BC400
|
||||
MAKE_ENUM(enum_mode3, FL_(night), FL_(day), FL_(auto)) // RC35, RC30_N, RC25, RC20_N
|
||||
MAKE_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS
|
||||
MAKE_ENUM(enum_mode5, FL_(auto), FL_(off)) // CRF
|
||||
@@ -362,6 +366,9 @@ MAKE_ENUM(enum_blockTerm, FL_(n_o), FL_(n_c))
|
||||
// Ventilation
|
||||
MAKE_ENUM(enum_ventMode, FL_(auto), FL_(off), FL_(L1), FL_(L2), FL_(L3), FL_(L4), FL_(demand), FL_(sleep), FL_(intense), FL_(bypass), FL_(partymode), FL_(fireplace))
|
||||
|
||||
// water
|
||||
MAKE_ENUM(enum_errorDisp, FL_(off), FL_(normal), FL_(inverted))
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// clang-format on
|
||||
|
||||
@@ -54,7 +54,8 @@ MAKE_WORD_TRANSLATION(unknown_device, "Unknown", "Unbekannt", "Onbekend", "Okän
|
||||
MAKE_WORD_TRANSLATION(custom_device, "Custom", "Nutzerdefiniert", "Aangepast", "", "Niestandardowe", "", "", "Özel", "Personalizzato") // TODO translate
|
||||
MAKE_WORD_TRANSLATION(custom_device_name, "User defined entities", "Nutzer deklarierte Entitäten", "Gebruiker gedefineerd", "", "Encje zdefiniowane przez użytkownika", "", "", "Kullanıcı tarafından tanımlanmış varlıklar", "Entità definita da utente") // TODO translate
|
||||
MAKE_WORD_TRANSLATION(ventilation_device, "Ventilation", "Lüftung", "Ventilatie", "", "Wentylacja", "", "", "Havalandırma", "Ventilazione") // TODO translate
|
||||
|
||||
MAKE_WORD_TRANSLATION(water_device, "Water Module", "Wassermodul", "", "", "Moduł wodny", "", "", "", "") // TODO translate
|
||||
MAKE_WORD_TRANSLATION(pool_device, "Pool Module", "Poolmodul", "", "", "Moduł basenu", "", "", "", "") // TODO translate
|
||||
|
||||
// commands
|
||||
MAKE_WORD_TRANSLATION(info_cmd, "lists all values", "Liste aller Werte", "lijst van alle waardes", "", "wyświetl wszystkie wartości", "Viser alle verdier", "", "Tüm değerleri listele", "elenca tutti i valori") // TODO translate
|
||||
@@ -165,6 +166,7 @@ MAKE_WORD_TRANSLATION(intern, "intern", "intern", "intern", "intern", "wewnętrz
|
||||
MAKE_WORD_TRANSLATION(lower, "lower", "niedirger", "lager", "lägre", "mniejszy", "nedre", "inférieur", "daha düşük", "basso")
|
||||
MAKE_WORD_TRANSLATION(error, "error", "Fehler", "error", "Fel", "błąd", "feil", "erreur", "Hata", "errore")
|
||||
MAKE_WORD_TRANSLATION(na, "n/a", "n/a", "n/a", "n/a", "nd.", "n/a", "n/c", "mevcut değil", "n/a")
|
||||
MAKE_WORD_TRANSLATION(inverted, "inverted", "invertiert", "", "", "", "", "", "", "")
|
||||
|
||||
// boiler
|
||||
MAKE_WORD_TRANSLATION(time, "time", "Zeit", "tijd", "Tid", "godzina", "tid", "heure", "zaman", "ora")
|
||||
@@ -175,6 +177,7 @@ MAKE_WORD_TRANSLATION(chargepump, "chargepump", "Ladepumpe", "laadpomp", "laddpu
|
||||
MAKE_WORD_TRANSLATION(hot, "hot", "Heiß", "heet", "Het", "gorący", "het", "chaud", "sıcak", "caldo")
|
||||
MAKE_WORD_TRANSLATION(high_comfort, "high comfort", "gehobener Komfort", "verhoogd comfort", "Förhöjd komfort", "wysoki komfort", "høy komfort", "comfort", "komfor", "comfort alto")
|
||||
MAKE_WORD_TRANSLATION(eco, "eco", "Eco", "Eco", "Eko", "eko", "øko", "éco", "eko", "Eco")
|
||||
MAKE_WORD_TRANSLATION(ecoplus, "eco+", "Eco+", "Eco+", "Eko+", "eko+", "øko+", "éco+", "eko+", "Eco+")
|
||||
MAKE_WORD_TRANSLATION(intelligent, "intelligent", "Intelligent", "intelligent", "Intelligent", "inteligentny", "intelligent", "intelligent", "akıllı", "intelligente")
|
||||
MAKE_WORD_TRANSLATION(flow, "flow", "Durchfluss", "volumestroom", "Flöde", "przepływ", "strømme", "débit", "akım", "flusso")
|
||||
MAKE_WORD_TRANSLATION(manual, "manual", "Manuell", "handmatig", "Manuell", "ręczny", "manuell", "manuel", "manuel", "manuale")
|
||||
@@ -386,6 +389,7 @@ MAKE_TRANSLATION(hpBrineOut, "hpbrineout", "brine out/condenser", "Sole aus/Kond
|
||||
MAKE_TRANSLATION(hpSwitchValve, "hpswitchvalve", "switch valve", "Schaltventil", "schakelklep", "Växelventil", "zawór przełączający", "skifteventil", "valve de commutation", "ısı pompası aktivitesi", "valvola commutazione pompa di calore")
|
||||
MAKE_TRANSLATION(hpActivity, "hpactivity", "compressor activity", "Kompressor-Betriebsmodus", "Compressoractiviteit", "Kompressoraktivitet", "pompa ciepła, aktywność sprężarki", "kompressoraktivitet", "", "hp ısı pompası", "attività compressore")
|
||||
|
||||
MAKE_TRANSLATION(hpMaxPower, "hpmaxpower", "compressor max power", "max. Kompressorleistung", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(hpPower, "hppower", "compressor power output", "Kompressorleistung", "Compressorvermogen", "Kompressoreffekt", "moc wyjściowa sprężarki", "kompressoreffekt", "puissance de sortie compresseur", "ısı pompası güç çıkışı", "potenza uscita compressore")
|
||||
MAKE_TRANSLATION(hpTc0, "hptc0", "heat carrier return (TC0)", "Kältemittel Rücklauf (TC0)", "Koudemiddel retour (TC0)", "Värmebärare Retur (TC0)", "temperatura nośnika ciepła na powrocie (TC0)", "kjølemiddel retur (TC0)", "retour caloporteur (TC0)", "sıcak su dönüşü (TC0)", "ritorno del refrigerante (TC0)")
|
||||
MAKE_TRANSLATION(hpTc1, "hptc1", "heat carrier forward (TC1)", "Kältemittel Vorlauf (TC1)", "Koudemiddel aanvoer (TC1)", "Värmebärare Framledning (TC1)", "temperatura nośnika ciepła pierwotna (TC1)", "kjølemiddel tur (TC1)", "avance caloporteur (TC1)", "sıcak su çıkışı (TC1)", "flusso di refrigerante (TC1)")
|
||||
@@ -453,6 +457,12 @@ MAKE_TRANSLATION(wwAlternatingOper, "wwalternatingop", "alternating operation",
|
||||
MAKE_TRANSLATION(wwAltOpPrioHeat, "wwaltopprioheat", "prioritise heating during dhw", "Heizen bevorzugt vor WW", "Proriteit verwarming boven ww", "", "czas na ogrzewanie w trakcie c.w.u", "prioritert oppvarmning", "", "sıcak kullanım suyu esnasında ısıtmayı öne al", "dare la priorità al riscaldamento durante l'ACS") // TODO translate
|
||||
MAKE_TRANSLATION(wwAltOpPrioWw, "wwaltopprioww", "prioritise dhw during heating", "WW bevorzugt vor Heizen", "Prioriteit ww boven verwarming", "", "czas na c.w.u w trakcie ogrzewania", "prioritert varmtvann", "", "ısıtma esnasında sıcak kullanım suyunu öne al", "dare priorità all'acqua calda durante il riscaldamento") // TODO translate
|
||||
MAKE_TRANSLATION(hpEA0, "hpea0", "condensate reservoir heating (EA0)", "Heizung Kondensatwanne (EA0)", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(boost, "boost", "boost mode", "Boost", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(boosttime, "boosttime", "boost time", "Boost Dauer", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(hpPumpMode, "hppumpmode", "primary heatpump mode", "Modus Hauptpumpe", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(instantstart, "instantstart", "instant start", "Sofortstart", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(heatondelay, "heatondelay", "heat-on delay", "Einschaltverzögerung Heizen", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(heatoffdelay, "heatoffdelay", "heat-off delay", "Ausschaltverzögerung Heizen", "", "", "", "", "", "", "") // TODO translate
|
||||
|
||||
// hybrid heatpump
|
||||
MAKE_TRANSLATION(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride", "hibrit kontrol stratejisi", "strategia comtrollo ibrido")
|
||||
@@ -520,6 +530,7 @@ MAKE_TRANSLATION(nomPower, "nompower", "nominal Power", "Brennerleistung", "", "
|
||||
MAKE_TRANSLATION(meterTotal, "metertotal", "meter total", "Messung gesamt", "", "", "licznik całkowity", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(meterComp, "metercomp", "meter compressor", "Messung Kompressor", "", "", "licznik sprężarki", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(meterEHeat, "metereheat", "meter e-heater", "Messung E-Heizer", "", "", "licznik e-heater", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(meterHeat, "meterheat", "meter heating", "Messung Heizen", "", "", "licznik grzania", "", "", "", "") // TODO translate
|
||||
|
||||
// HIU
|
||||
MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp", "System Vorlauftemperatur", "Netto aanvoertemperatuur", "", "temp. zasilania sieci cieplnej", "", "", "ısıtma şebekesi akış derecesi", "temperatura di mandata della rete di riscaldamento") // TODO translate
|
||||
@@ -695,10 +706,6 @@ MAKE_TRANSLATION(pumpStatus, "pumpstatus", "pump status (PC1)", "Pumpenstatus HK
|
||||
MAKE_TRANSLATION(mixerStatus, "valvestatus", "mixing valve actuator (VC1)", "Mischerventil Position (VC1)", "positie mixerklep (VC1)", "Shuntventil Status (VC1)", "siłownik zaworu mieszającego (VC1)", "shuntventil status (VC1)", "actionnement vanne mélangeur (VC1)", "karışım vanası aktüatörü (VC1)", "posizione valvola miscela (VC1)")
|
||||
MAKE_TRANSLATION(flowTempVf, "flowtempvf", "flow temperature in header (T0/Vf)", "Vorlauftemperatur am Verteiler (T0/Vf)", "aanvoertemperatuur verdeler (T0/Vf)", "Flödestemperatur Fördelare (T0/Vf)", "temperatura zasilania na rozdzielaczu (T0/Vf)", "turtemperatur ved fordeleren (T0/Vf)", "température départ collecteur (T0/Vf)", "başlıkta akış sıcaklığı", "Temperatura di mandata al distributore (T0/Vf)")
|
||||
MAKE_TRANSLATION(mixerSetTime, "valvesettime", "time to set valve", "Zeit zum Einstellen des Ventils", "Inschakeltijd mengklep", "Inställningstid Ventil", "czas na ustawienie zaworu", "instillningstid ventil", "délai activation vanne", "vana ayar zamanı", "ritardo attivazione valvola")
|
||||
// mixer prefixed with wwc
|
||||
MAKE_TRANSLATION(wwPumpStatus, "pumpstatus", "pump status in assigned wwc (PC1)", "Pumpenstatus des wwk (PC1)", "Pompstatus in WW circuit (PC1)", "Pumpstatus i VV-krets (PC1)", "stan pompy w obwodzie c.w.u. (PC1)", "Pumpestatus i VV-krets (PC1)", "état pompe wwc (PC1)", "Kullanım suyu devresindeki(PC1) pompa durumu", "stato pompa assegnato nel ciruito WW (PC1)")
|
||||
MAKE_TRANSLATION(wwTempStatus, "wwtempstatus", "temperature switch in assigned wwc (MC1)", "Temperaturschalter des wwk (MC1)", "Temperatuurschakeling in WW circuit (MC1)", "Temperaturventil i VV-krets (MC1)", "temperatura w obwodzie c.w.u. (MC1)", "temperaturventil i VV-krets (MC1)", "température bascule wwc (MC1).", "atanmış sıcak su devresinde sıcaklık", "interruttore di temperatura del wwk (MC1)")
|
||||
MAKE_TRANSLATION(wwTemp, "wwtemp", "current temperature", "aktuelle Temperatur", "huidige temperatuur", "Aktuell Temperatur", "temperatura c.w.u.", "aktuell temperatur", "température actuelle", "güncel sıcaklık", "temperatura attuale")
|
||||
// mixer pool
|
||||
MAKE_TRANSLATION(poolSetTemp, "poolsettemp", "pool set temperature", "Pool Solltemperatur", "Streeftemperatuur zwembad", "Pool Temperatur Börvärde", "zadana temperatura basenu", "valgt temp basseng", "température consigne piscine", "hedef havuz sıcaklığı", "temperatura nominale piscina")
|
||||
MAKE_TRANSLATION(poolTemp, "pooltemp", "pool temperature", "Pool Temperatur", "Zwembadtemperatuur", "Pooltemperatur", "temperatura basenu", "bassengtemperatur", "température piscine", "havuz sıcaklığı", "temperatura piscina")
|
||||
@@ -744,24 +751,30 @@ MAKE_TRANSLATION(energyTotal, "energytotal", "total energy", "Gesamtenergie", "T
|
||||
MAKE_TRANSLATION(energyToday, "energytoday", "total energy today", "Energie heute", "Energie vandaag", "Total Energi Idag", "energia całkowita dzisiaj", "total energi i dag", "énergie totale aujourd'hui", "bugün toplam enerji", "totale energia giornaliera")
|
||||
|
||||
// solar ww
|
||||
MAKE_TRANSLATION(wwTemp1, "wwtemp1", "temperature 1(TS17)", "Temperatur 1", "Temperatuur 1", "Temperatur 1", "temperatura 1", "temperatur 1", "température 1", "sıcaklık 1", "Temperatura 1")
|
||||
MAKE_TRANSLATION(wwTemp3, "wwtemp3", "temperature 3 (TS21)", "Temperatur 3", "Temperatuur 3", "Temperatur 3", "temperatura 3", "Temperatur 3", "température 3", "sıcaklık 3", "Temperatura 3")
|
||||
MAKE_TRANSLATION(wwTemp4, "wwtemp4", "cold water", "Temperatur 4", "Temperatuur 4", "Temperatur 4", "temperatura 4", "Temperatur 4", "température 4", "sıcaklık 4", "Temperatura 4")
|
||||
MAKE_TRANSLATION(wwColdTemp, "wwcoldtemp", "cold water", "Kaltwasser", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(wwTemp5, "wwtemp5", "temperature 5", "Temperatur 5", "Temperatuur 5", "Temperatur 5", "temperatura 5", "Temperatur 5", "température 5", "sıcaklık 5", "Temperatura 5")
|
||||
|
||||
MAKE_TRANSLATION(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 7", "temperatura 7", "Temperatur 7", "température 7", "sıcaklık 7", "Temperatura 7")
|
||||
MAKE_TRANSLATION(wwTemp6, "wwtemp6", "temperature 6", "Temperatur 6", "Temperatuur 6", "Temperatur 6", "temperatura 6", "temperatur 6", "température 6", "sıcaklık 6", "Temperatura 6")
|
||||
// MAKE_TRANSLATION(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 7", "temperatura 7", "Temperatur 7", "température 7", "sıcaklık 7", "Temperatura 7")
|
||||
MAKE_TRANSLATION(wwPump, "wwpump", "pump", "Pumpe", "Pomp", "Pump", "pompa", "pumpe", "pompe", "pompa", "Pompa")
|
||||
MAKE_TRANSLATION(wwCircTc, "wwcirctc", "circulation time controled", "zeitgesteuerte Zirkulation", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(errorDisp, "errordisp", "error display", "Fehleranzeige", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(deltaTRet, "deltatret", "temp. diff. return valve", "Temperaturdifferenz Rücklaufventil", "", "", "", "", "", "", "") // TODO translate
|
||||
// solar ww and mixer wwc
|
||||
MAKE_TRANSLATION(wwMinTemp, "wwmintemp", "minimum temperature", "minimale Temperatur", "Minimale temperatuur", "Min Temperatur", "temperatura minimalna", "min temperatur", "température min", "minimum sıcaklık", "temperatura minima")
|
||||
MAKE_TRANSLATION(wwRedTemp, "wwredtemp", "reduced temperature", "reduzierte Temperatur", "Gereduceerde temperatuur", "Reducerad Temperatur", "temperatura zredukowana", "reducert temperatur", "température réduite", "düşürülmüş sıcaklık", "temperatura ridotta")
|
||||
MAKE_TRANSLATION(wwDailyTemp, "wwdailytemp", "daily temperature", "tägl. Temperatur", "Dagelijkse temperatuur", "Daglig temperatur", "temperatura dzienna", "dagtemperatur", "température en journée", "günlük sıcaklık", "temperatura giornaliera")
|
||||
MAKE_TRANSLATION(wwHotTemp, "wwhottemp", "extra hot temperature", "sehr heiße Temperatur", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_TRANSLATION(wwKeepWarm, "wwkeepwarm", "keep warm", "Warmhalten", "Warm houde", "Varmhållning", "utrzymywanie ciepła", "holde varmen", "maintenir chaleur", "ılık tut", "mantenimento calore")
|
||||
MAKE_TRANSLATION(wwStatus2, "wwstatus2", "status 2", "Status 2", "Status 2", "Status 2", "status 2", "status 2", "statut 2", "durum 2", "Status 2")
|
||||
MAKE_TRANSLATION(wwPumpMod, "wwpumpmod", "pump modulation", "Pumpen Modulation", "Pompmodulatie", "Pumpmodulering", "modulacja pompy", "pumpemodulering", "modulation de pompe", "pompa modülasyonu", "modulazione pompa")
|
||||
MAKE_TRANSLATION(wwFlow, "wwflow", "flow rate", "Volumenstrom", "Doorstroomsnelheid", "Flöde", "przepływ", "strømningshastighet", "débit", "akış hızı", "portata flusso")
|
||||
// MAKE_TRANSLATION(wwRetValve, "wwretvalve", "return valve (VS5)", "Rücklauf Ventil (VS5)", "(VS5)", "(VS5)", "(VS5)", "(VS5)", "(VS5)", "(VS5)", "(VS5)") // TODO translate
|
||||
// extra mixer ww
|
||||
MAKE_TRANSLATION(wwRequiredTemp, "wwrequiredtemp", "required temperature", "benötigte Temperatur", "Benodigde temperatuur", "Nödvändig Temperatur", "temperatura wymagana", "nødvendig temperatur", "température requise", "gerekli sıcaklık", "temperatura richiesta")
|
||||
MAKE_TRANSLATION(wwDiffTemp, "wwdifftemp", "start differential temperature", "Start Differential Temperatur", "Start differentiele temperatuur", "Start Differentialtemperatur", "start temperatury różnicowej", "start differensialtemperatur", "température différentielle de départ", "diferansiyel sıcaklık", "avvia temperatura differenziale")
|
||||
MAKE_TRANSLATION(wwPumpStatus, "pumpstatus", "pump status in assigned wwc (PC1)", "Pumpenstatus des wwk (PC1)", "Pompstatus in WW circuit (PC1)", "Pumpstatus i VV-krets (PC1)", "stan pompy w obwodzie c.w.u. (PC1)", "Pumpestatus i VV-krets (PC1)", "état pompe wwc (PC1)", "Kullanım suyu devresindeki(PC1) pompa durumu", "stato pompa assegnato nel ciruito WW (PC1)")
|
||||
MAKE_TRANSLATION(wwTempStatus, "wwtempstatus", "temperature switch in assigned wwc (MC1)", "Temperaturschalter des wwk (MC1)", "Temperatuurschakeling in WW circuit (MC1)", "Temperaturventil i VV-krets (MC1)", "temperatura w obwodzie c.w.u. (MC1)", "temperaturventil i VV-krets (MC1)", "température bascule wwc (MC1).", "atanmış sıcak su devresinde sıcaklık", "interruttore di temperatura del wwk (MC1)")
|
||||
MAKE_TRANSLATION(wwTemp, "wwtemp", "current temperature", "aktuelle Temperatur", "huidige temperatuur", "Aktuell Temperatur", "temperatura c.w.u.", "aktuell temperatur", "température actuelle", "güncel sıcaklık", "temperatura attuale")
|
||||
|
||||
// SM100
|
||||
MAKE_TRANSLATION(heatTransferSystem, "heattransfersystem", "heattransfer system", "Wärmeübertragungs-System", "Warmteoverdrachtssysteem", "Värmeöverföringssystem", "system wymiany ciepła", "varmeoverføringssystem", "système de transfert de chaleur", "ıs transfer sistemi", "sistema di trasferimento del calore")
|
||||
|
||||
24
src/mqtt.cpp
24
src/mqtt.cpp
@@ -34,6 +34,7 @@ uint32_t Mqtt::publish_time_boiler_;
|
||||
uint32_t Mqtt::publish_time_thermostat_;
|
||||
uint32_t Mqtt::publish_time_solar_;
|
||||
uint32_t Mqtt::publish_time_mixer_;
|
||||
uint32_t Mqtt::publish_time_water_;
|
||||
uint32_t Mqtt::publish_time_sensor_;
|
||||
uint32_t Mqtt::publish_time_other_;
|
||||
uint32_t Mqtt::publish_time_heartbeat_;
|
||||
@@ -170,6 +171,11 @@ void Mqtt::loop() {
|
||||
EMSESP::publish_device_values(EMSdevice::DeviceType::MIXER);
|
||||
} else
|
||||
|
||||
if (publish_time_water_ && (currentMillis - last_publish_water_ > publish_time_water_)) {
|
||||
last_publish_water_ = (currentMillis / publish_time_water_) * publish_time_water_;
|
||||
EMSESP::publish_device_values(EMSdevice::DeviceType::WATER);
|
||||
} else
|
||||
|
||||
if (publish_time_other_ && (currentMillis - last_publish_other_ > publish_time_other_)) {
|
||||
last_publish_other_ = (currentMillis / publish_time_other_) * publish_time_other_;
|
||||
EMSESP::publish_other_values(); // switch and heatpump
|
||||
@@ -350,6 +356,7 @@ void Mqtt::load_settings() {
|
||||
publish_time_thermostat_ = mqttSettings.publish_time_thermostat * 1000;
|
||||
publish_time_solar_ = mqttSettings.publish_time_solar * 1000;
|
||||
publish_time_mixer_ = mqttSettings.publish_time_mixer * 1000;
|
||||
publish_time_water_ = mqttSettings.publish_time_water * 1000;
|
||||
publish_time_other_ = mqttSettings.publish_time_other * 1000;
|
||||
publish_time_sensor_ = mqttSettings.publish_time_sensor * 1000;
|
||||
publish_time_heartbeat_ = mqttSettings.publish_time_heartbeat * 1000;
|
||||
@@ -413,6 +420,10 @@ void Mqtt::set_publish_time_mixer(uint16_t publish_time) {
|
||||
publish_time_mixer_ = publish_time * 1000; // convert to milliseconds
|
||||
}
|
||||
|
||||
void Mqtt::set_publish_time_water(uint16_t publish_time) {
|
||||
publish_time_water_ = publish_time * 1000; // convert to milliseconds
|
||||
}
|
||||
|
||||
void Mqtt::set_publish_time_other(uint16_t publish_time) {
|
||||
publish_time_other_ = publish_time * 1000; // convert to milliseconds
|
||||
}
|
||||
@@ -445,6 +456,10 @@ bool Mqtt::get_publish_onchange(uint8_t device_type) {
|
||||
if (!publish_time_mixer_) {
|
||||
return true;
|
||||
}
|
||||
} else if (device_type == EMSdevice::DeviceType::WATER) {
|
||||
if (!publish_time_water_) {
|
||||
return true;
|
||||
}
|
||||
} else if (!publish_time_other_) {
|
||||
return true;
|
||||
}
|
||||
@@ -922,7 +937,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
||||
// we add the command topic parameter for commands
|
||||
if (has_cmd) {
|
||||
// add category
|
||||
doc["ent_cat"] = "config"; // for writeable entities, like switch, number, text, select
|
||||
// doc["ent_cat"] = "config"; // for writeable entities, like switch, number, text, select
|
||||
|
||||
char command_topic[MQTT_TOPIC_MAX_SIZE];
|
||||
// add command topic
|
||||
@@ -1050,8 +1065,11 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
||||
|
||||
// Add the state class, device class and sometimes the icon. Used only for read-only sensors Sensor and Binary Sensor
|
||||
if (readonly_sensors) {
|
||||
// first set the catagory
|
||||
doc["ent_cat"] = "diagnostic";
|
||||
// first set the catagory for System entities
|
||||
// https://github.com/emsesp/EMS-ESP32/discussions/1459#discussioncomment-7694873
|
||||
if (device_type == EMSdevice::DeviceType::SYSTEM) {
|
||||
doc["ent_cat"] = "diagnostic";
|
||||
}
|
||||
|
||||
const char * dc_ha = "dev_cla"; // device class
|
||||
const char * sc_ha = "stat_cla"; // state class
|
||||
|
||||
@@ -47,6 +47,7 @@ class Mqtt {
|
||||
void set_publish_time_thermostat(uint16_t publish_time);
|
||||
void set_publish_time_solar(uint16_t publish_time);
|
||||
void set_publish_time_mixer(uint16_t publish_time);
|
||||
void set_publish_time_water(uint16_t publish_time);
|
||||
void set_publish_time_other(uint16_t publish_time);
|
||||
void set_publish_time_sensor(uint16_t publish_time);
|
||||
void set_publish_time_heartbeat(uint16_t publish_time);
|
||||
@@ -253,6 +254,7 @@ class Mqtt {
|
||||
uint32_t last_publish_thermostat_ = 0;
|
||||
uint32_t last_publish_solar_ = 0;
|
||||
uint32_t last_publish_mixer_ = 0;
|
||||
uint32_t last_publish_water_ = 0;
|
||||
uint32_t last_publish_other_ = 0;
|
||||
uint32_t last_publish_sensor_ = 0;
|
||||
uint32_t last_publish_heartbeat_ = 0;
|
||||
@@ -279,6 +281,7 @@ class Mqtt {
|
||||
static uint32_t publish_time_thermostat_;
|
||||
static uint32_t publish_time_solar_;
|
||||
static uint32_t publish_time_mixer_;
|
||||
static uint32_t publish_time_water_;
|
||||
static uint32_t publish_time_other_;
|
||||
static uint32_t publish_time_sensor_;
|
||||
static uint32_t publish_time_heartbeat_;
|
||||
|
||||
@@ -51,7 +51,7 @@ void Roomctrl::set_remotehum(const uint8_t type, const uint8_t hc, const int8_t
|
||||
return;
|
||||
}
|
||||
type_ = type;
|
||||
if (remotehum_[hc] != EMS_VALUE_UINT_NOTSET && hum == EMS_VALUE_UINT_NOTSET) {
|
||||
if (remotehum_[hc] != EMS_VALUE_UINT_NOTSET && (uint8_t)hum == EMS_VALUE_UINT_NOTSET) {
|
||||
switch_off_[hc] = true;
|
||||
}
|
||||
if (remotehum_[hc] != hum) {
|
||||
|
||||
@@ -238,7 +238,7 @@ void Shower::set_shower_state(bool state, bool force) {
|
||||
doc["unit_of_meas"] = "s";
|
||||
doc["stat_cla"] = "measurement";
|
||||
doc["dev_cla"] = "duration";
|
||||
doc["ent_cat"] = "diagnostic";
|
||||
// doc["ent_cat"] = "diagnostic";
|
||||
|
||||
JsonObject dev2 = doc.createNestedObject("dev");
|
||||
dev2["name"] = "EMS-ESP";
|
||||
@@ -265,7 +265,7 @@ void Shower::set_shower_state(bool state, bool force) {
|
||||
|
||||
doc["name"] = "Shower Timestamp";
|
||||
doc["val_tpl"] = "{{value_json.timestamp if value_json.timestamp is defined else 0}}";
|
||||
doc["ent_cat"] = "diagnostic";
|
||||
// doc["ent_cat"] = "diagnostic";
|
||||
|
||||
JsonObject dev3 = doc.createNestedObject("dev");
|
||||
dev3["name"] = "EMS-ESP";
|
||||
|
||||
@@ -115,7 +115,7 @@ bool System::command_allvalues(const char * value, const int8_t id, JsonObject &
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
std::string title = emsdevice->device_type_2_device_name_translated() + std::string(" ") + emsdevice->to_string();
|
||||
device_output = output.createNestedObject(title);
|
||||
emsesp::EMSdevice::export_values(emsdevice->unique_id(), device_output, id, EMSdevice::OUTPUT_TARGET::API_VERBOSE);
|
||||
emsdevice->generate_values(device_output, DeviceValueTAG::TAG_NONE, true, EMSdevice::OUTPUT_TARGET::API_VERBOSE); // use nested for id -1 and 0
|
||||
}
|
||||
|
||||
// Custom entities
|
||||
@@ -178,6 +178,9 @@ bool System::command_publish(const char * value, const int8_t id) {
|
||||
} else if (value_s == (F_(mixer))) {
|
||||
EMSESP::publish_device_values(EMSdevice::DeviceType::MIXER);
|
||||
return true;
|
||||
} else if (value_s == (F_(water))) {
|
||||
EMSESP::publish_device_values(EMSdevice::DeviceType::WATER);
|
||||
return true;
|
||||
} else if (value_s == "other") {
|
||||
EMSESP::publish_other_values(); // switch and heat pump
|
||||
return true;
|
||||
@@ -1096,7 +1099,7 @@ bool System::check_upgrade(bool factory_settings) {
|
||||
missing_version = (settingsVersion.empty() || (settingsVersion.length() < 5));
|
||||
if (missing_version) {
|
||||
LOG_WARNING("No version information found (%s)", settingsVersion.c_str());
|
||||
settingsVersion = "3.6.2"; // this was the last stable version
|
||||
settingsVersion = "3.6.4"; // this was the last stable version
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1306,6 +1309,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
|
||||
node["publish time thermostat"] = settings.publish_time_thermostat;
|
||||
node["publish time solar"] = settings.publish_time_solar;
|
||||
node["publish time mixer"] = settings.publish_time_mixer;
|
||||
node["publish time water"] = settings.publish_time_water;
|
||||
node["publish time other"] = settings.publish_time_other;
|
||||
node["publish time sensor"] = settings.publish_time_sensor;
|
||||
node["publish single"] = settings.publish_single;
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.6.4-test.0"
|
||||
#define EMSESP_APP_VERSION "3.6.5-test.3"
|
||||
|
||||
Reference in New Issue
Block a user