Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ A full list of breaking changes can be found in this [discussion](https://github

## Added

- Bulgarian translation (bg) for the Web UI and device entities
- CS5800i/CS6800i (XCU_THH) and UI800: values from telegrams that were already fetched. Boiler: `hpdefrostpossible` (read only), `buffertank` (read only), `auxheateropmode` (raw mode 3–7, Bosch texts not confirmed yet), `airpurgemode` (off/auto/on), `minsyspress` and `targetsyspress` (bar), `emstoptemp` / `emstarttemp` / `emt7stoptemp`. `pumpdelay` is read and written from telegram 0xE6 on this heat pump. Thermostat heating circuit: `hpminflowwith` and `hpminflowwithout` (the two cooling minimum flow temperatures, 7–35 °C) and `dewpointcontrol`. `hpminflowtemp` still follows the installed control and now refuses values outside 7–35 °C [#3504](https://github.com/emsesp/EMS-ESP32/issues/3504)
- Home Assistant MQTT Update entity for EMS-ESP firmware (notify-only): with MQTT discovery it shows when a newer version is available, using the existing automatic firmware check. There is no Install button yet; update from the EMS-ESP WebUI. Publishes retained `ems-esp/firmware` with `installed_version` / `latest_version`
- boiler and thermostat `errorcode` from telegram 0xBF (the currently active fault, e.g. `" --(5141)"` / `"A11(3221)"`), so heat pumps without `servicecode` show locking alarms while they are active [#3475](https://github.com/emsesp/EMS-ESP32/issues/3475)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ It requires a small circuit to interface with the EMS bus which can be purchased
- A responsive, multi-user web interface for desktop, tablet and phone to monitor live data and change settings
- Native integration with Home Assistant (MQTT Discovery), Domoticz, openHAB, Modbus and a REST API
- Reports EMS devices that go offline, so integrations can mark their entities as unavailable
- Localized in 13 languages, and any device or sensor can be renamed
- Localized in 14 languages, and any device or sensor can be renamed
- Simulates remote room thermostats
- Add your own custom EMS entities, Commands and user-built modules
- A Scheduler to run tasks on a timer or when values change, and Notifications to alert you to important events
Expand Down
4 changes: 3 additions & 1 deletion interface/backtranslate-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ const CORE_LANGS = [
'sk',
'cs',
'hu',
'zh'
'zh',
'bg'
];
const WEBUI_LANGS = [
'bg',
'cs',
'de',
'fr',
Expand Down
1 change: 1 addition & 0 deletions interface/check-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if (casingIssues.length) {

const LANGS = [
'en',
'bg',
'cs',
'de',
'fr',
Expand Down
1 change: 1 addition & 0 deletions interface/progmem-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static constexpr size_t WWW_ASSETS_COUNT = sizeof(WWW_ASSETS) / sizeof(WWW_ASSET
// (e.g. "en,de,nl"). When set, locale chunks outside the list are NOT embedded
// into firmware flash. `en` is always kept as the fallback. Unset => embed all.
const ALL_LOCALES = [
'bg',
'cs',
'de',
'en',
Expand Down
1 change: 1 addition & 0 deletions interface/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const DocumentLanguage = () => {
};

const ALL_LOCALES = [
'bg',
'cs',
'de',
'en',
Expand Down
14 changes: 7 additions & 7 deletions interface/src/app/main/CustomEntities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from 'components/ui';
import type { IconName } from 'components/ui';
import { useI18nContext } from 'i18n/i18n-react';
import { usePendingList } from 'utils';
import { formatNumber, usePendingList } from 'utils';

import './CustomEntities.css';
import EntityDialog from './EntityDialog';
Expand Down Expand Up @@ -93,11 +93,11 @@ const fromForm = (v: EntityItem): EntityItem => ({
factor: isBool(v) ? parseHex(v.factor) : Number(v.factor)
});

const formatValue = (value: unknown, uom: number) => {
const formatValue = (value: unknown, uom: number, locale?: string) => {
if (value === undefined) return '';
const unit = uom === 0 ? '' : ` ${DeviceValueUOM_s[uom]}`;
return typeof value === 'number'
? new Intl.NumberFormat().format(value) + unit
? formatNumber(value, locale) + unit
: `${value as string}${unit}`;
};

Expand All @@ -109,7 +109,7 @@ interface Editing {
}

const CustomEntities = () => {
const { LL } = useI18nContext();
const { LL, locale } = useI18nContext();
const [storage, setStorage] = useState(-1);
const [editing, setEditing] = useState<Editing>();

Expand Down Expand Up @@ -262,7 +262,7 @@ const CustomEntities = () => {
name="edit"
size="xs"
className="lb"
label={LL.WRITEABLE()}
label={LL.WRITEABLE(0)}
/>
)}
<PendingTag state={state} />
Expand All @@ -288,7 +288,7 @@ const CustomEntities = () => {
)}
</td>
<td data-label={LL.VALUE()} className="r num ce-val">
{formatValue(item.value, item.uom)}
{formatValue(item.value, item.uom, locale)}
</td>
<td className="act">
{state === 'del' && (
Expand Down Expand Up @@ -407,7 +407,7 @@ const CustomEntities = () => {
{v.value_type === DeviceValueType.BOOL && (
<TextField label={LL.BITMASK()} mono {...f.text('factor')} />
)}
<Switch label={LL.WRITEABLE()} {...f.check('writeable')} />
<Switch label={LL.WRITEABLE(1)} {...f.check('writeable')} />
</>
) : (
<>
Expand Down
21 changes: 13 additions & 8 deletions interface/src/app/main/Customizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from 'components/ui';
import 'components/ui/Chip.css';
import { useI18nContext } from 'i18n/i18n-react';
import { formatNumber } from 'utils';

import {
readCoreData,
Expand Down Expand Up @@ -69,15 +70,15 @@ const resetEntity = (de: DeviceEntity): DeviceEntity => {

const isCommand = (de: DeviceEntity) => !!de.n && de.n[0] === '!';

const formatValue = (value: unknown) => {
if (typeof value === 'number') return new Intl.NumberFormat().format(value);
const formatValue = (value: unknown, locale?: string) => {
if (typeof value === 'number') return formatNumber(value, locale);
if (value === undefined || value === null) return '';
if (typeof value === 'boolean') return value ? 'true' : 'false';
return value as string;
};

const Customizations = () => {
const { LL } = useI18nContext();
const { LL, locale } = useI18nContext();
const location = useLocation();

const [selectedDevice, setSelectedDevice] = useState<number>(
Expand Down Expand Up @@ -310,7 +311,10 @@ const Customizations = () => {
onClick={() => setMaskFilter((f) => f ^ o.bit)}
>
<Icon name={o.icon} size="xs" className={`b${o.bit}`} />
{o.label(LL)} {count(o.bit)}
{o.bit === DeviceEntityMask.DV_FAVORITE
? LL.FAVORITES()
: o.label(LL, true)}{' '}
{count(o.bit)}
</button>
))}
<button
Expand Down Expand Up @@ -422,10 +426,11 @@ const Customizations = () => {
{isChanged && <PendingTag state="mod" />}
</td>
<td className="r num" data-label={LL.VALUE()}>
{formatValue(de.v)}
{formatValue(de.v, locale)}
</td>
<td className="r num" data-label={`${LL.MIN()} – ${LL.MAX()}`}>
{hasLimit && `${formatValue(de.mi)} – ${formatValue(de.ma)}`}
{hasLimit &&
`${formatValue(de.mi, locale)} – ${formatValue(de.ma, locale)}`}
</td>
</tr>
);
Expand All @@ -450,8 +455,8 @@ const Customizations = () => {
onInput={(e) => setSearch(e.currentTarget.value)}
/>
<span className="cap">
{LL.SHOWING()} {filtered.length}/{entities.length}{' '}
{LL.ENTITIES(entities.length)}
{LL.SHOWING(filtered.length)} {filtered.length}/{entities.length}{' '}
{LL.ENTITIES(filtered.length)}
</span>
</div>
{renderBulk()}
Expand Down
2 changes: 1 addition & 1 deletion interface/src/app/main/CustomizationsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const CustomizationsDialog = ({
},
{ label: LL.DEFAULT_NAME(), value: entity.n },
{
label: LL.WRITEABLE(),
label: LL.WRITEABLE(0),
value: (
<Icon
name={entity.w ? 'check' : 'close'}
Expand Down
11 changes: 6 additions & 5 deletions interface/src/app/main/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const SHOWN_MASKS = MASKS.filter((o) =>

// circuit tags the firmware puts in front of entity names, in every language (tag_* in locale_translations.h)
const TAGGED =
/^((?:hc|hk|vk|og|id|ahs|ahq|avk|aźc|hs|hq|źc|src)\d{1,2}|(?:dhw|wwk|vvk|cwu|sks|tuv|túv|ecs|hmv)\d{0,2}) (.+)$/iu;
/^((?:hc|hk|vk|og|id|ок|ahs|ahq|avk|aźc|hs|hq|źc|src)\d{1,2}|(?:dhw|wwk|vvk|cwu|sks|tuv|túv|ecs|hmv|бгв)\d{0,2}) (.+)$/iu;

const hex = (n: number) => '0x' + n.toString(16).toUpperCase().padStart(2, '0');

Expand Down Expand Up @@ -93,7 +93,7 @@ interface Row {
}

const Devices = () => {
const { LL } = useI18nContext();
const { LL, locale } = useI18nContext();
const { me } = useContext(AuthenticatedContext);
const navigate = useNavigate();
const [params, setParams] = useSearchParams();
Expand Down Expand Up @@ -209,7 +209,7 @@ const Devices = () => {
const shown: Row[] = sort.rows.flatMap((dv) => {
if (onlyFav && !hasMask(dv.id, DeviceEntityMask.DV_FAVORITE)) return [];
const name = dv.id.slice(2);
const value = formatValue(LL, dv.v, dv.u);
const value = formatValue(LL, dv.v, dv.u, locale);
if (q && !name.toLowerCase().includes(q) && !value.toLowerCase().includes(q)) {
return [];
}
Expand Down Expand Up @@ -264,7 +264,7 @@ const Devices = () => {
: ''
],
[
LL.WRITEABLE(),
LL.WRITEABLE(0),
(dv) =>
dv.c && !hasMask(dv.id, DeviceEntityMask.DV_READONLY) ? 'yes' : 'no'
],
Expand Down Expand Up @@ -512,7 +512,8 @@ const Devices = () => {
</ToggleButton>
</ToggleGroup>
<span className="cap dv-count">
{LL.SHOWING()} {shown.length}/{d.e} {LL.ENTITIES(shown.length)}
{LL.SHOWING(shown.length)} {shown.length}/{d.e}{' '}
{LL.ENTITIES(shown.length)}
</span>
</div>

Expand Down
4 changes: 2 additions & 2 deletions interface/src/app/main/DevicesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const DevicesDialog = ({
validator,
progress
}: DevicesDialogProps) => {
const { LL } = useI18nContext();
const { LL, locale } = useI18nContext();
const [editItem, setEditItem] = useState<DeviceValue>(() =>
initialValue(selectedItem)
);
Expand Down Expand Up @@ -147,7 +147,7 @@ const DevicesDialog = ({
if (!writeable) {
return (
<p className="dvd-value full">
{formatValue(LL, selectedItem.v, selectedItem.u)}
{formatValue(LL, selectedItem.v, selectedItem.u, locale)}
</p>
);
}
Expand Down
6 changes: 3 additions & 3 deletions interface/src/app/main/EntityMaskToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { DeviceEntity } from './types';
export interface MaskOption {
bit: DeviceEntityMask;
icon: IconName;
label: (LL: TranslationFunctions) => string;
label: (LL: TranslationFunctions, plural?: boolean) => string;
help: (LL: TranslationFunctions) => string;
}

Expand All @@ -34,13 +34,13 @@ export const MASKS: MaskOption[] = [
{
bit: DeviceEntityMask.DV_WEB_EXCLUDE,
icon: 'visibility_off',
label: (LL) => LL.MASK_HIDDEN(),
label: (LL, plural) => LL.MASK_HIDDEN(plural ? 1 : 0),
help: (LL) => LL.CUSTOMIZATIONS_HELP_5()
},
{
bit: DeviceEntityMask.DV_DELETED,
icon: 'delete_forever',
label: (LL) => LL.MASK_REMOVED(),
label: (LL, plural) => LL.MASK_REMOVED(plural ? 1 : 0),
help: (LL) => LL.CUSTOMIZATIONS_HELP_6()
}
];
Expand Down
4 changes: 2 additions & 2 deletions interface/src/app/main/Scheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const Scheduler = () => {
>
<td className="sch-act" onClick={(e) => e.stopPropagation()}>
<Switch
label={<span className="sr-only">{`${LL.ACTIVE()} ${si.name}`}</span>}
label={<span className="sr-only">{`${LL.ACTIVE(0)} ${si.name}`}</span>}
checked={si.active}
disabled={deleted}
onChange={(active) => list.update(key, { ...si, active })}
Expand Down Expand Up @@ -219,7 +219,7 @@ const Scheduler = () => {
<thead>
<tr>
<SortHeader className="sch-act" {...sort.header('active')}>
{LL.ACTIVE()}
{LL.ACTIVE(0)}
</SortHeader>
<SortHeader {...sort.header('name')}>{LL.NAME(0)}</SortHeader>
<SortHeader {...sort.header('schedule')}>
Expand Down
6 changes: 3 additions & 3 deletions interface/src/app/main/SchedulerDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ const SchedulerDialog = ({

{type === ScheduleFlag.SCHEDULE_DAY && (
<div className={cx('field', 'full', daysError && 'invalid')}>
<span className="seg-label">{LL.SCHEDULE(0)}</span>
<span className="seg-label">{LL.SCHEDULE(1)}</span>
<div className="row wrap sch-days-edit">
<span
className="row sch-pills"
role="group"
aria-label={LL.SCHEDULE(0)}
aria-label={LL.SCHEDULE(1)}
>
{DAY_FLAGS.map((flag, i) => (
<button
Expand Down Expand Up @@ -203,7 +203,7 @@ const SchedulerDialog = ({
{...f.select('cmd_name')}
/>
<TextField label={LL.NAME(0)} mono {...f.text('name')} />
<Switch label={LL.ACTIVE()} {...f.check('active')} />
<Switch label={LL.ACTIVE(0)} {...f.check('active')} />
</>
);
}}
Expand Down
10 changes: 5 additions & 5 deletions interface/src/app/main/Sensors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from 'components/ui';
import { AuthenticatedContext } from 'contexts/authentication';
import { useI18nContext } from 'i18n/i18n-react';
import { useInterval } from 'utils';
import { formatNumber, useInterval } from 'utils';

import {
readSensorData,
Expand Down Expand Up @@ -49,7 +49,7 @@ export const isOnOff = (as: AnalogSensor) =>
(as.t === AnalogType.DIGITAL_OUT && as.g !== 25 && as.g !== 26);

const Sensors = () => {
const { LL } = useI18nContext();
const { LL, locale } = useI18nContext();
const { me } = useContext(AuthenticatedContext);
const [temp, setTemp] = useState<TemperatureSensor>();
const [analog, setAnalog] = useState<AnalogSensor>();
Expand Down Expand Up @@ -145,7 +145,7 @@ const Sensors = () => {
};

const offsetText = (ts: TemperatureSensor) =>
`${ts.o > 0 ? '+' : ''}${ts.o} ${DeviceValueUOM_s[ts.u]}`;
`${ts.o > 0 ? '+' : ''}${formatNumber(ts.o, locale)} ${DeviceValueUOM_s[ts.u]}`;

const empty = (cols: number) => (
<tr>
Expand Down Expand Up @@ -199,7 +199,7 @@ const Sensors = () => {
{offsetText(ts)}
</td>
<td data-label={LL.VALUE()} className="r num">
{formatValue(LL, ts.t, ts.u)}
{formatValue(LL, ts.t, ts.u, locale)}
</td>
</tr>
))}
Expand Down Expand Up @@ -274,7 +274,7 @@ const Sensors = () => {
? as.v
? LL.ON()
: LL.OFF()
: formatValue(LL, as.v, as.u)}
: formatValue(LL, as.v, as.u, locale)}
</td>
</tr>
))}
Expand Down
4 changes: 2 additions & 2 deletions interface/src/app/main/SensorsTemperatureDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SensorsTemperatureDialog = ({
onClose,
onSave
}: SensorsTemperatureDialogProps) => {
const { LL } = useI18nContext();
const { LL, locale } = useI18nContext();
// ±5 °C, the same span in °F when the system shows Fahrenheit
const maxOffset = item.u === DeviceValueUOM.FAHRENHEIT ? 9 : 5;

Expand All @@ -36,7 +36,7 @@ const SensorsTemperatureDialog = ({
<>
<p className="cap full">
{LL.SENSOR_ID()} <span className="mono lb">{item.id}</span>
{item.t !== undefined && ` · ${formatValue(LL, item.t, item.u)}`}
{item.t !== undefined && ` · ${formatValue(LL, item.t, item.u, locale)}`}
</p>
<TextField label={LL.NAME(0)} fullWidth {...f.text('n')} />
<TextField
Expand Down
Loading