Comments (18)
With the additions of emsesp/EMS-ESP#506 heap is ~2k lower, not enough to reload web-page if telnet is open on esp8266. I think you can cross out the second option (telnet on web).
from ems-esp32.
I was thinking when you select a device in the EMS Devices web page, it shows the value below and below that show a new form where you can choose a command from a drop-down, a value, and an id. It's a luxury feature and not high-priority but it does kind of round of the Web UI as being a fully functional dashboard & command center.
from ems-esp32.
@MichaelDvP do you still think its a good idea?
from ems-esp32.
With the API it's possible to do a command from web, but not very comfortable in the browser-url.
A input-line in web for a call command would be fine, or like scan-devices a button for a dialogbox to enter a command.
from ems-esp32.
What I dislike about the current API is that it's insecure (if you enable it in the Settings) so anyone can send write commands to the EMS-ESP. Having these calls from the Web UI offers some protection and only accessible via a user with the Administrator role. I like the idea of a button which pops up a dialog window where you select the target (system, boiler, thermostat etc), command (free text) and data and id (both optional). The only worry I have is that we're close to 92% progmem flash so not much space left for new web code.
The Web API really needs to use the JWT token for added security. Something to add onto the list for later.
from ems-esp32.
The better option I'm thinking is
- remove the Device ID, Version and Product ID from the 'Devices' web page as this is too techie and can be hidden in a mouseover tooltip
- Have an editable table so keynames that have an associated command (like
flowtemp
) would be highlighted, the user can click and type in a new value and this will be sent as a command to EMS-ESP - at the same time have a real RESTful API like ems-esp/api/// instead of posting variables with & and ?. I'm using the GitHub API as a reference. The payload will always be JSON.
from ems-esp32.
I did the first implementation of this. Each device value can have an associated command (now I see why we should align the mqtt names with the commands!), and this is shown with a little pencil. Clicking it opens a dialog where a new value can be set and the command sent to EMS-ESP.
I also cleaned up the page a little. The version, productID, deviceID are hidden in the ToolTip hover. And the device values table is denser. @MichaelDvP @bbqkees - let me know what you think, plus names and other UI things that look weird to you.
It's all in the branch called ft_webcallcmd
. You can run it locally on a PC by going to the interface folder and typing npm run dev
.
from ems-esp32.
Very nice, commands working great, but they are accessible and working also from guest account. Was this intended?
The device names are now looking a bit unaligned to the sensors and values. Can you also move the sensor id to a tooltip? And device-names better right aligned.
There are some commands with no published value, like thermostat party, pause, holiday, switchtime. The settings are very rarely used. The first three could be added to publish, but switchtimes are a set of 42 values building a program, the command sets a single switchtime, i think there is no way to implement this to web.
One (maybe a few) other command(s) needs a bit tuning (like maintenance / maintenancetype)
from ems-esp32.
Using register _cmd
and register_device_value
and ensure that both have identical texts and set the has_cmd
is a bit error-prone.
What do you think about combining the commands in emsdevice.cpp and use only a single call for value and command?
void EMSdevice::register_device_value(uint8_t tag, void * value_p, uint8_t type, const __FlashStringHelper * const * options, const __FlashStringHelper * const * name, uint8_t uom, cmdfunction_p f) {
register_device_value(tag, value_p, type, options, name[0], name[1], uom, (f != nullptr));
if (f != nullptr) {
if (tag >= TAG_HC1 && tag <= TAG_HC4) {
Command::add(device_type_, name[0], f, FLAG_HC);
} else {
Command::add(device_type_, name[0], f, 0);
}
}
}
and register the values without command as
register_device_value(TAG_THERMOSTAT_DATA, &errorCode_, DeviceValueType::TEXT, nullptr, FL_(errorCode), DeviceValueUOM::NONE);
and with command and HC-flag as
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode3), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
Then there are only a few register_cmd
left with no published value, but the device values/commands are all in sync.
from ems-esp32.
Yes! I was going to do that next. There only needs to be a single function. This will ensure there is no mis-match between the command names and the MQTT key names.
from ems-esp32.
Should i make a PR to the command branch for this suggestion (i'm testing it actually) or do you have a better idea?
from ems-esp32.
yes please push the change straight into the ft_webcallcmd branch (or do a PR). I've been using this branch for other minor changes too.
from ems-esp32.
@MichaelDvP ok to merge this back into dev? Any feedback on the UI changes and layout?
from ems-esp32.
Yes, it works great.
As metioned in layout i would prefer the device brand/name to be alligned right, but not important.
from ems-esp32.
right aligning like this?
that would look funny on large screens no?
from ems-esp32.
The values for parameters and sensors are also right aligned, For me it looks better, but i think there are different opinions.
from ems-esp32.
BTW: with the extra commands the json gets to small, my boiler cuts after disinfecting. For systems with 4 hc in thermostat we should enlarge to EMSESP_JSON_SIZE_XXLARGE_DYN 8192
(6k is ok for my boiler)
from ems-esp32.
I made the changes
from ems-esp32.
Related Issues (20)
- Moduline 400: Missing holiday settings HOT 15
- MQTT discovery of external temperature sensor for HA is missing "stat_cla" attribute. HOT 1
- MQTT changes on uniq_id and obj_id for dhw entities for HA discovery within 3.7 dev version HOT 24
- Error 'invalid template (TemplateSyntaxError: expected token 'end of print statement', HOT 11
- Improvment: Get the current power consumption of Compress 7001 Heatpumps HOT 39
- Feature: Easy enable/disable PV/SG on Heat pumps HOT 1
- Add fan/ventilation speed support for Bosch compress 3800i/IVT Vent 402 HOT 1
- "manual defrost" on heat pump unexpected behaviour HOT 2
- Dump all supported EMS Telegrams HOT 1
- Status …Loading… HOT 6
- No Temp displayed on HMC 310, HC2 Control Mode is not editable HOT 6
- Improvement: Add holiday mode to bosch compress 3800i ew HOT 21
- Remove OTA feature HOT 3
- Feature: Modbus Support HOT 10
- Automation Homeassistant - boiler disinfection HOT 2
- Platform mqtt does not generate unique IDs. For ID boiler_hysteresis_on_temperature and ID boiler_hysteresis_off_temperature HOT 3
- WebUI data missing on Firefox HOT 8
- boiler.nrgtotal with spikes and wrong value after update HOT 1
- Worcester-Bosch Greenstar Summer Mode temp value upper limit too low HOT 7
- Modbus UI not working correctly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ems-esp32.