diff --git a/code/espurna/light.cpp b/code/espurna/light.cpp index 8580a033..b9ac83ee 100644 --- a/code/espurna/light.cpp +++ b/code/espurna/light.cpp @@ -2338,7 +2338,7 @@ void _lightWebSocketStatus(JsonObject& root) { } void _lightWebSocketOnVisible(JsonObject& root) { - wsPayloadModule(root, "color"); + wsPayloadModule(root, "light"); } void _lightWebSocketOnConnected(JsonObject& root) { diff --git a/code/html/custom.css b/code/html/custom.css index 8f3dc6c0..89a6e092 100644 --- a/code/html/custom.css +++ b/code/html/custom.css @@ -173,17 +173,13 @@ label { /* removeIf(!curtain) */ -.curtain-div { - text-align: center; -} - .curtain-roller { width: 300px; height: 200px; display: inline-block; } -.curtain-button{ +.curtain-button { margin-left: 10px; margin-right: 10px; text-align: center; diff --git a/code/html/custom.js b/code/html/custom.js index 7f506782..003967be 100644 --- a/code/html/custom.js +++ b/code/html/custom.js @@ -1752,7 +1752,7 @@ function initMagnitudesList(data, callbacks) { function createMagnitudeInfo(id, magnitude) { const container = document.getElementById("magnitudes"); - const info = loadTemplate("magnitude-info-form"); + const info = loadTemplate("magnitude-info"); const label = info.querySelector("label"); label.textContent = magnitude.name; @@ -1997,9 +1997,6 @@ function initCurtain() { return; } - // simple position slider - document.getElementById("curtainSet").addEventListener("change", curtainSetHandler); - // add and init curtain template, prepare multi switches let line = loadConfigTemplate("curtain-control"); line.querySelector(".button-curtain-open").addEventListener("click", curtainButtonHandler); @@ -2007,6 +2004,9 @@ function initCurtain() { line.querySelector(".button-curtain-close").addEventListener("click", curtainButtonHandler); mergeTemplate(container, line); + // simple position slider + document.getElementById("curtainSet").addEventListener("change", curtainSetHandler); + addSimpleEnumerables("curtain", "Curtain", 1); } diff --git a/code/html/index.html b/code/html/index.html index 8751b8e6..e1796942 100644 --- a/code/html/index.html +++ b/code/html/index.html @@ -62,7 +62,7 @@ - + @@ -125,8 +125,8 @@ -
  • - LIGHTS +
  • + LIGHTS
  • @@ -154,7 +154,7 @@
  • - RF + RF BRIDGE
  • @@ -566,7 +566,7 @@ -
    +
    @@ -576,8 +576,7 @@
    -
    - +
    General
    @@ -607,7 +606,6 @@
    -
    @@ -616,8 +614,8 @@ - -
    + +

    LIGHTS

    @@ -647,8 +645,11 @@
    + + (ms) + - (ms) When Save values is enabled, wait for the specified time before the values are actually saved. + When Save values is enabled, wait for the specified time before the values are actually saved.
    @@ -656,7 +657,7 @@
    - Use the first three channels as RGB channels. This will also enable the color picker in the web UI. Will only work if the device has at least 3 dimmable channels.
    Reload the page to update the web interface. + Use the first three channels as RGB channels. This will also enable the color picker in the web UI. Will only work if the device has at least 3 dimmable channels.
    @@ -680,7 +681,7 @@
    - Use a dimmable channel as warm white light and another dimmable channel as cold white light.
    On devices with two dimmable channels the first use used for warm white light and the second for cold white light.
    On color lights the fifth use used for warm white light and the fourth for cold white light.
    Will only work if the device has exactly 2 dimmable channels or at least 5 dimmable channels and "white channel" above is also ON.
    Enabling this will render useless the "Channel 5" slider in the status page.
    Reload the page to update the web interface. + Use a dimmable channel as warm white light and another dimmable channel as cold white light.
    On devices with two dimmable channels the first use used for warm white light and the second for cold white light.
    On color lights the fifth use used for warm white light and the fourth for cold white light.
    Will only work if the device has exactly 2 dimmable channels or at least 5 dimmable channels and "white channel" above is also ON.
    Enabling this will render useless the "Channel 5" slider in the status page.
    @@ -703,21 +704,27 @@
    + + (ms) + - (ms) Time to transition from one color to another + Time to transition from one color to another
    + + (ms) + - (ms) Time to transition from one step to the next. Must be smaller than the transition time. + Time to transition from one step to the next. Must be smaller than the transition time.
    - + Sync channel values between multiple devices. Notice that every device that is subscribed to the topic should be configured to use the same brightness. @@ -814,7 +821,7 @@
    - + This is the authentication token you will have to pass with every HTTP request. All API calls must either contain the Api-Key header or the apikey request parameter with the value above. @@ -884,7 +891,8 @@
    - + + When specified, ESPurna will use these values in place of the hostname (see GENERAL panel) as SSID and device password (see ADMIN panel) as passphrase. @@ -969,7 +977,7 @@ Add schedule - + @@ -1066,9 +1074,10 @@
    + Broker
    - +
    @@ -1083,7 +1092,7 @@
    - +
    Leave blank when broker allows anonymous connections. You can also use the following placeholders: {hostname}, {mac} @@ -1091,36 +1100,25 @@
    - +
    - + - When left empty, the firmware will generate a client ID based on the MAC address of the chip. The following placeholders are also supported: {hostname}, {mac} + When left blank, the firmware will generate a Client ID based on the MAC address of the chip. The following placeholders are also supported: {hostname}, {mac}
    - - -
    - -
    - -
    -
    - -
    - + + + (seconds) +
    @@ -1136,21 +1134,28 @@
    + + +
    + Device settings +
    - + This is the root topic for this device. The following placeholders can be used: {hostname} and {mac} to dynamically set the value to the device hostname and MAC address respectively.
    - - <root>/relay/#/set Send a 0 or a 1 as a payload to this topic to switch it on or off. You can also send a 2 to toggle its current state. Replace # with the switch ID (starting from 0). If the board has only one switch it will be 0.
    + - <root>/relay/#/set Send a 0 or a 1 as a payload to this topic to switch it on or off. You can also send a 2 to toggle its current state. Replace # with the switch ID (starting from 0). If the board has only one switch it will be 0.
    + - <root>/pulse/#/set Toggles the switch # and toggles it back after the specified time. Time is expected as TIME[<UNIT>]. Without the unit, time is interpreted as a number of seconds (floating point). Unit can either be h for hours, m for seconds and s for seconds. Multiple time and unit pairs are allowed, for example 5h4m3s.
    + - <root>/cmd/set Send a command-line string to be executed. Multiple commands can be separated with \r\n - - <root>/curtain/set Set the curtain opening value (0-100), 0 means closed, 100 opened. "on", "off", "pause" pilots buttons.
    + - <root>/curtain/set Set the curtain opening value (0-100), 0 means closed, 100 opened. "on", "off", "pause" pilots buttons.
    - - <root>/rgb/set Set the color using this topic, your can either send an "#RRGGBB" value or "RRR,GGG,BBB" (0-255 each).
    - - <root>/hsv/set Set the color using hue (0-360), saturation (0-100) and value (0-100) values, comma separated.
    - - <root>/brightness/set Set the brighness (0-255).
    - - <root>/channel/#/set Set the value for a single color channel (0-255). Replace # with the channel ID (starting from 0 and up to 4 for RGBWC lights).
    - - <root>/mired/set Set the temperature color in mired.
    + - <root>/rgb/set Set the color using this topic, your can either send an "#RRGGBB" value or "RRR,GGG,BBB" (0-255 each).
    + - <root>/hsv/set Set the color using hue (0-360), saturation (0-100) and value (0-100) values, comma separated.
    + - <root>/brightness/set Set the brighness (0-255).
    + - <root>/channel/#/set Set the value for a single color channel (0-255). Replace # with the channel ID (starting from 0 and up to 4 for RGBWC lights).
    + - <root>/mired/set Set the temperature color in mired.
    - <root>/status The device will report a 1 to this topic every few minutes. When MQTT broker detects that we disconnected, it will be set to 0.
    - Other values reported depend on the build options or the heartbeat settings (for example, firmware, version, hostname, IP, MAC, signal strenth (RSSI), uptime (in seconds), free heap and etc.) @@ -1158,16 +1163,48 @@
    - + + + + Level of assurance for delivery of the outgoing messages. Notice that messages are not (currently) cached on the device, QoS levels >0 only guarantee delivery after the broker receives the message. + +
    + +
    + +
    + + Store the last published message (including the device status) on the server, so it can be delivered to any future subscribers that match the message topic. + +
    +
    + +
    + JSON + +
    +
    - All messages (except the device status) will be included in a JSON payload along with the timestamp and hostname - and sent under the <root>/data topic.
    - Messages will be queued and sent after 100ms, so different messages could be merged into a single payload.
    - Subscriptions will still be done to single topics. + Causes all single <topic> messages published by the device, except the device status, to be sent in a JSON payload. For example:
    + {"relay/0": 1, "hostname": "ESPURNA-123456", "timestamp": "..."}
    + All messages will be queued and sent with a delay (100ms by default). Notice that all nested <topic>: <message> are published as-is, only the heartbeat payload will include all of topics at once. +
    +
    + +
    + + + + JSON message will be sent to <root>/<name> topic (data by default).
    +
    @@ -1260,7 +1297,7 @@
    - +
    @@ -1435,7 +1472,7 @@ -
    +
    @@ -1457,17 +1494,17 @@
    - +
    - +
    -
    +
    Lights (IN messages only)
    @@ -1577,12 +1614,12 @@
    - +
    - +
    @@ -1799,7 +1836,7 @@
    - + second(s) @@ -1873,9 +1910,9 @@
    -
    +
    Units -
    +
    @@ -1903,44 +1940,55 @@
    -

    RADIO FREQUENCY

    -

    - Sonoff 433 RF Bridge & RF Link Configuration

    - This page allows you to configure the RF codes for the Sonoff RFBridge 433 and also for a basic RF receiver.

    +

    RF BRIDGE

    +
    + +
    +
    + + Configuration + + Configure RF code associations for a basic 433 RF recevier, or the device like Sonoff RFBridge 433.

    To learn a new code click LEARN (the Sonoff RFBridge will beep) then press a button on the remote, the new code should show up (and the RFBridge will double beep). If the device double beeps but the code does not update it has not been properly learnt. Keep trying.

    Modify or create new codes manually and then click SAVE to store them in the device memory. If your controlled device uses the same code to switch ON and OFF, learn the code with the ON button and copy paste it to the OFF input box, then click SAVE on the last one to store the value.

    Delete any code clicking the FORGET button.

    You can also specify any RAW code. For reference see possible commands for Sonoff RF Bridge EFM8BB1 (original firmware supports codes from 0xA0 to 0xA5). - -
    + -
    RF Codes
    - Settings + Transmition -
    - -
    -
    -
    -
    Number of times to repeat transmission
    +
    + + + + Number of times to repeat the outgoing transmission +
    +
    -
    -
    Pins used by the receiver (RX) and transmitter (TX). Set to NONE to disable
    +
    + Pin configuration - - -
    +
    + + + + Set to NONE to disable the receiver. + +
    - - -
    +
    + + + + Set to NONE to disable the transmitter. +
    @@ -1950,7 +1998,7 @@ - +
    @@ -1964,11 +2012,13 @@
    -
    - -
    -
    -
    +
    + RF Actions +
    + + +
    +
    @@ -2021,22 +2071,24 @@ - - -