Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Sep 16, 2024
2 parents 1c6464a + 3e9b182 commit 8c1f67a
Show file tree
Hide file tree
Showing 42 changed files with 408 additions and 620 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
- RC310 cooling parameters [#1857](https://github.com/emsesp/EMS-ESP32/issues/1857)
- command `api/device/entities` [#1897](https://github.com/emsesp/EMS-ESP32/issues/1897)
- switchprogmode [#1903]<https://github.com/emsesp/EMS-ESP32/discussions/1903>
- Autodetect and download firmware upgrades via the WebUI
- autodetect and download firmware upgrades via the WebUI
- command 'show log' that lists out the current weblog buffer, showing last messages.
- default web log buffer to 25 lines for ESP32s with no PSRAM
- Try and determine correct board profile if none is set
- Auto Scroll in WebLog UI - reduced delay so incoming logs are faster
- auto Scroll in WebLog UI - reduced delay so incoming logs are faster

## Fixed

Expand Down
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,47 @@

**EMS-ESP** is an open-source firmware for the Espressif ESP32 microcontroller that communicates with **EMS** (Energy Management System) based equipment from manufacturers like Bosch, Buderus, Nefit, Junkers, Worcester and Sieger. It requires a small gateway circuit to interface with the EMS bus which can be purchased from <https://bbqkees-electronics.nl> or custom built.

## **Features**

- A multi-user, multi-language secure web interface to change settings and monitor incoming data
- A console, accessible via Serial and Telnet for more advanced monitoring
- Native support for Home Assistant, Domoticz and openHAB via [MQTT Discovery](https://www.home-assistant.io/docs/mqtt/discovery/)
- Can run standalone as an independent WiFi Access Point or join an existing WiFi network
- Easy first-time configuration via a web Captive Portal
- Support for more than [120+ EMS devices](https://emsesp.org/All-Devices/) (boilers, thermostats, solar modules, mixer modules, heat pumps, gateways, switches, heat sources)
## **Key Features**

- A multi-user, multi-language web interface to change settings and monitor incoming data
- An advanced console, accessible via Serial/USB or Telnet for more operations and monitoring
- Native integration with Home Assistant, Domoticz, openHAB and Modbus
- Easy setup and install with automatic updates
- Supporting over 120 different EMS compatible devices from thermostats, boilers, heat pumps, mixing units, solar modules from brands as Bosch, Buderus, Nefit, Junkers, Worcester and Sieger
- Simulate remote thermostats
- Localized to 10 languages, and customizable to change names to your preference
- Extendable via adding external modules or adding your own custom entities directly within the WebUI
- A powerful scheduler to automate tasks and trigger events based data changes
- A Notification service to alert you of important events

## **Installing**

Go to [install.emsesp.org](https://install.emsesp.org) or look at the documentation link below on the different ways to install EMS-ESP.
For a quick install of the latest stable release go to [https://install.emsesp.org](https://install.emsesp.org). For other methods of installing and upgrading, and switching to the development version go to the section in the [documentation](https://emsesp.org).

## **Documentation**
## **Documentation and Wiki**

For the complete documentation on how to install, configure and get support visit the [documentation at emsesp.org](https://emsesp.org).
Visit [emsesp.org](https://emsesp.org) for details on how to install and configure EMS-ESP.

## **Support**
## **Getting Support**

To chat with the community reach out on our [Discord Server](https://discord.gg/3J3GgnzpyT).

If you like **EMS-ESP**, please give it a star, or fork it and contribute or offer a small donation!
If you like **EMS-ESP**, please give it a ✨ on GitHub, or even better fork it and contribute. You can also offer a small donation. This is an open-source project maintained by volunteers, and your support is greatly appreciated.

## **Demo**
## **Live Demo**

For a live demo of the Web UI click [demo.emsesp.org](https://demo.emsesp.org) and log in with any username/password, and change the language to English.
For a live demo go to [demo.emsesp.org](https://demo.emsesp.org). Pick a language from the sign on page and log in with any username or password. Note not all features are operational as it's based on static data.

## **Contributors**
## **Contributors**

EMS-ESP is a project owned and maintained by [proddy](https://github.com/proddy) and [MichaelDvP](https://github.com/MichaelDvP).
EMS-ESP is a project created by [proddy](https://github.com/proddy) and owned and maintained by both [proddy](https://github.com/proddy) and [MichaelDvP](https://github.com/MichaelDvP) with support from [BBQKees Electronics](https://bbqkees-electronics.nl).

## **Libraries used**

- [esp8266-react](https://github.com/rjwats/esp8266-react) by @rjwats for the framework that provides the core of the Web UI
- [uuid-\*](https://github.com/nomis/mcu-uuid-console) from @nomis. The console, syslog, telnet and logging are based off these open source libraries
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson) for all the JSON
- [espMqttClient](https://github.com/bertmelis/espMqttClient) for the MQTT client, with custom modifications from @MichaelDvP and @proddy
- [esp8266-react](https://github.com/rjwats/esp8266-react) by @rjwats for the core framework that provides the Web UI, which has been heavily modified
- [uuid-\*](https://github.com/nomis/mcu-uuid-console) from @nomis. The console, syslog, telnet and logging are based off these awesome open source libraries
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson) for all the JSON processing
- [espMqttClient](https://github.com/bertmelis/espMqttClient) for the MQTT client
- ESPAsyncWebServer and AsyncTCP for the Web server and TCP backends, with custom modifications for performance

## **License**
Expand Down
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
}
],
"dictionaries": ["project-words"],
"ignorePaths": ["node_modules", "**/venv/**", "lib/eModbus", "lib/ESPAsyncWebServer", "lib/espMqttClient", "analyse.html", "dist", "**/*.csv", "locale_translations.h", "TZ.tsx", "**/*.txt","build/**", "**/i18n/**", "/project-words.txt"]
"ignorePaths": ["node_modules", "WWWData.h", "**/venv/**", "lib/eModbus", "lib/ESPAsyncWebServer", "lib/espMqttClient", "analyse.html", "dist", "**/*.csv", "locale_translations.h", "TZ.tsx", "**/*.txt","build/**", "**/i18n/**", "/project-words.txt"]
}
10 changes: 5 additions & 5 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"async-validator": "^4.2.5",
"jwt-decode": "^4.0.0",
"mime-types": "^2.1.35",
"preact": "^10.23.2",
"preact": "^10.24.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
Expand All @@ -44,10 +44,10 @@
"@babel/core": "^7.25.2",
"@eslint/js": "^9.10.0",
"@preact/compat": "^18.3.1",
"@preact/preset-vite": "^2.9.0",
"@preact/preset-vite": "^2.9.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/formidable": "^3",
"@types/node": "^22.5.4",
"@types/node": "^22.5.5",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@types/react-router-dom": "^5.3.3",
Expand All @@ -59,9 +59,9 @@
"rollup-plugin-visualizer": "^5.12.0",
"terser": "^5.32.0",
"typescript-eslint": "8.5.0",
"vite": "^5.4.4",
"vite": "^5.4.5",
"vite-plugin-imagemin": "^0.6.1",
"vite-tsconfig-paths": "^5.0.1"
},
"packageManager": "yarn@4.4.1"
"packageManager": "yarn@4.5.0"
}
10 changes: 3 additions & 7 deletions interface/src/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type {
CoreData,
DeviceData,
DeviceEntity,
Devices,
Entities,
EntityItem,
ModuleItem,
Expand Down Expand Up @@ -53,11 +52,9 @@ export const readActivity = () => alovaInstance.Get<Activity>('/rest/activity');
// API
export const API = (apiCall: APIcall) => alovaInstance.Post('/api', apiCall);

// UploadFileForm
export const getSettings = () => alovaInstance.Get('/rest/getSettings');
export const getCustomizations = () => alovaInstance.Get('/rest/getCustomizations');
export const getEntities = () => alovaInstance.Get<Entities>('/rest/getEntities');
export const getSchedule = () => alovaInstance.Get('/rest/getSchedule');
// DownloadUpload
export const exportData = (type: string) =>
alovaInstance.Get('/rest/exportData', { params: { type } });

// SettingsCustomization
export const readDeviceEntities = (id: number) =>
Expand All @@ -75,7 +72,6 @@ export const readDeviceEntities = (id: number) =>
}));
}
});
export const readDevices = () => alovaInstance.Get<Devices>('/rest/devices');
export const resetCustomizations = () =>
alovaInstance.Post('/rest/resetCustomizations');
export const writeCustomizationEntities = (data: {
Expand Down
8 changes: 2 additions & 6 deletions interface/src/api/system.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type { HardwareStatus, LogSettings, SystemStatus } from 'types';
import type { LogSettings, SystemStatus } from 'types';

import { alovaInstance, alovaInstanceGH } from './endpoints';

// hardwareStatus - also used to ping in Restart monitor for pinging
export const readHardwareStatus = () =>
alovaInstance.Get<HardwareStatus>('/rest/hardwareStatus');

// SystemStatus
// systemStatus - also used to ping in Restart monitor for pinging
export const readSystemStatus = () =>
alovaInstance.Get<SystemStatus>('/rest/systemStatus');

Expand Down
24 changes: 12 additions & 12 deletions interface/src/app/main/Customizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import { useI18nContext } from 'i18n/i18n-react';

import {
API,
readCoreData,
readDeviceEntities,
readDevices,
resetCustomizations,
writeCustomizationEntities,
writeDeviceName
Expand All @@ -60,7 +60,7 @@ import SettingsCustomizationsDialog from './CustomizationsDialog';
import EntityMaskToggle from './EntityMaskToggle';
import OptionIcon from './OptionIcon';
import { DeviceEntityMask } from './types';
import type { APIcall, DeviceEntity, DeviceShort } from './types';
import type { APIcall, Device, DeviceEntity } from './types';

export const APIURL = window.location.origin + '/api/';

Expand All @@ -81,8 +81,8 @@ const Customizations = () => {

useLayoutTitle(LL.CUSTOMIZATIONS());

// fetch devices first
const { data: devices, send: fetchDevices } = useRequest(readDevices);
// fetch devices first from coreData
const { data: devices, send: fetchCoreData } = useRequest(readCoreData);

const { send: sendAPI } = useRequest((data: APIcall) => API(data), {
immediate: false
Expand Down Expand Up @@ -242,13 +242,13 @@ const Customizations = () => {
useEffect(() => {
if (devices && selectedDevice !== -1) {
void sendDeviceEntities(selectedDevice);
const id = devices.devices.findIndex((d) => d.i === selectedDevice);
if (id === -1) {
const index = devices.devices.findIndex((d) => d.id === selectedDevice);
if (index === -1) {
setSelectedDevice(-1);
setSelectedDeviceTypeNameURL('');
} else {
setSelectedDeviceTypeNameURL(devices.devices[id].url || '');
setSelectedDeviceName(devices.devices[id].s);
setSelectedDeviceTypeNameURL(devices.devices[index].url || '');
setSelectedDeviceName(devices.devices[index].n);
setNumChanges(0);
setRestartNeeded(false);
}
Expand Down Expand Up @@ -414,7 +414,7 @@ const Customizations = () => {
})
.finally(async () => {
setRename(false);
await fetchDevices();
await fetchCoreData();
});
};

Expand Down Expand Up @@ -449,9 +449,9 @@ const Customizations = () => {
<MenuItem disabled key={-1} value={-1}>
{LL.SELECT_DEVICE()}...
</MenuItem>
{devices.devices.map((device: DeviceShort) => (
<MenuItem key={device.i} value={device.i}>
{device.s}&nbsp;({device.tn})
{devices.devices.map((device: Device) => (
<MenuItem key={device.id} value={device.id}>
{device.n}&nbsp;({device.tn})
</MenuItem>
))}
</TextField>
Expand Down
15 changes: 1 addition & 14 deletions interface/src/app/main/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface Device {
p: number; // productid
v: string; // version
e: number; // entities
url?: string; // lowercase type name used in API URL
}

export interface TemperatureSensor {
Expand Down Expand Up @@ -113,20 +114,6 @@ export interface CoreData {
devices: Device[];
}

export interface DeviceShort {
i: number; // id
d?: number; // deviceid
p?: number; // productid
s: string; // shortname
t?: number; // device type id
tn?: string; // device type internal name (translated)
url?: string; // lowercase type name used in API URL
}

export interface Devices {
devices: DeviceShort[];
}

export interface DeviceValue {
id: string; // index, contains mask+name
v: unknown; // value, Number or String
Expand Down
4 changes: 2 additions & 2 deletions interface/src/app/settings/ApplicationSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@mui/material';
import Grid from '@mui/material/Grid2';

import { readHardwareStatus } from 'api/system';
import { readSystemStatus } from 'api/system';

import { useRequest } from 'alova/client';
import RestartMonitor from 'app/status/RestartMonitor';
Expand Down Expand Up @@ -49,7 +49,7 @@ export function boardProfileSelectItems() {
}

const ApplicationSettings = () => {
const { data: hardwareData } = useRequest(readHardwareStatus);
const { data: hardwareData } = useRequest(readSystemStatus);

const {
loadData,
Expand Down
Loading

0 comments on commit 8c1f67a

Please sign in to comment.