Closed Justdigit closed 3 months ago
Here a piece of the live debug log in Home Assistant.
In this part i have pressed the Add light Button.
024-07-09 23:17:32,826 - werkzeug - INFO - 192.168.1.166 - - [09/Jul/2024 23:17:32] "GET /lights HTTP/1.1" 200 -
2024-07-09 23:17:34,812 - werkzeug - INFO - 192.168.1.166 - - [09/Jul/2024 23:17:34] "GET /lights HTTP/1.1" 200 -
2024-07-09 23:17:36,813 - werkzeug - INFO - 192.168.1.166 - - [09/Jul/2024 23:17:36] "GET /lights HTTP/1.1" 200 -
2024-07-09 23:17:37,814 - werkzeug - INFO - 192.168.1.166 - - [09/Jul/2024 23:17:37] "GET /api/0d5a1ca83e3111efae18e45f015ca97f/config/swupdate2 HTTP/1.1" 200 -
2024-07-09 23:17:37,820 - werkzeug - INFO - 192.168.1.166 - - [09/Jul/2024 23:17:37] "GET /api/0d5a1ca83e3111efae18e45f015ca97f/groups/0 HTTP/1.1" 200 -
2024-07-09 23:17:38,812 - werkzeug - INFO - 192.168.1.166 - - [09/Jul/2024 23:17:38] "GET /lights HTTP/1.1" 200 -
2024-07-09 23:17:39,924 - services.stateFetch - INFO - start lights sync
2024-07-09 23:17:39,925 - services.stateFetch - DEBUG - fetch tasmota-1A039E-0926
2024-07-09 23:17:39,925 - lights.protocols.tasmota - DEBUG - tasmota:
Hi, on my setup i can add lights via the webui, including milight(i dont have them) and i get a added notification.
2024-07-09 23:16:26,271 - flaskUI.restful - INFO - {'protocol': 'milight', 'ip': '192.168.1.200', 'config': {'lightName': 'test', 'lightModelID': 'LOM001', 'miID': '0x1234', 'miModes': 'rgbw', 'miGroups': '1'}}
2024-07-09 23:16:26,273 - werkzeug - INFO - 192.168.1.3 - - [09/Jul/2024 23:16:26] "POST /api/xxx/lights HTTP/1.1" 200 -
Can you change other things on the webui? like search for updates(pres the bell on the top right and then on no update) or change the sw version?
Hi, on my setup i can add lights via the webui, including milight(i dont have them) and i get a added notification.
2024-07-09 23:16:26,271 - flaskUI.restful - INFO - {'protocol': 'milight', 'ip': '192.168.1.200', 'config': {'lightName': 'test', 'lightModelID': 'LOM001', 'miID': '0x1234', 'miModes': 'rgbw', 'miGroups': '1'}} 2024-07-09 23:16:26,273 - werkzeug - INFO - 192.168.1.3 - - [09/Jul/2024 23:16:26] "POST /api/xxx/lights HTTP/1.1" 200 -
Can you change other things on the webui? like search for updates(pres the bell on the top right and then on no update) or change the sw version?
Yes i can change everything and see the status message. It finds the WLED lights automatically.
Only manual adding lights not. I have tried with other Webbrowsers and incognito mode. Is there a URL which I can try which simulates "add light"?
that is strange. it is a post url so you cant do it in a browser, you need to use postman or something. what does the console of the browser say? right click on screen > inspect > console.
Is see some errors??? But i dont know how to handle. I removed The Chrome extension
This is the log for the webui.
Strange thing is preventdefault
is not used anymore.
I will look into it.
When i know more i will let you know.
I think i found the issue, please update en let me know if it works now. You can update via the webui on the top right or rebuild the HA addon.
I think i found the issue, please update en let me know if it works now. You can update via the webui on the top right or rebuild the HA addon.
Nope unfortunatly it didnt fix the problem. I have fired up a VM and tried on other Browser Edge. Its still the same. Here a screenshot.
So you still have the same error in the console of the browser? Can you click on the AddLight.jsx 23:9
and send a screen?
`import { useState } from "react";
import axios from "axios"; import { toast } from "react-hot-toast";
import GenericButton from "../GenericButton/GenericButton"; import GenericText from "../GenericText/GenericText"; import SelectMenu from "../SelectMenu/SelectMenu";
const AddLight = ({ HOST_IP, API_KEY }) => { const [lightData, setLightData] = useState({ protocol: "auto", });
const handleChange = (key, value) => { setLightData({ ...lightData,
});
};
const handleForm = (evt) => {
evt.preventDefault();
const { protocol: lightproto, ip: lightip, ...rest } = lightData;
const formattedData = {
protocol: lightproto,
ip: lightip,
config: rest,
};
axios
.post(${HOST_IP}/api/${API_KEY}/lights
, formattedData)
.then(() => {
toast.success("Light added!");
})
.catch((error) => {
console.error(error);
toast.error(Error occurred: ${error.message}
);
});
};
const protocols = [ { value: "auto", label: "Autodetect" }, { value: "domoticz", label: "Domoticz" }, { value: "flex", label: "Flex" }, { value: "jeedom", label: "Jeedom" }, { value: "milight", label: "MiLight" }, { value: "mibox", label: "Mi Box" }, { value: "wiz", label: "Wiz" }, ];
const milightGroups = [ { value: "1", label: "1" }, { value: "2", label: "2" }, { value: "3", label: "3" }, { value: "4", label: "4" }, ];
const milightModes = [ { value: "rgbw", label: "RGBW" }, { value: "cct", label: "CCT" }, { value: "rgb_cct", label: "RGB-CCT" }, { value: "rgb", label: "RGB" }, ];
const lightModelIds = [ { value: "LOM001", label: "On/Off Plug" }, { value: "LWB010", label: "Dimmable Light" }, { value: "LTW001", label: "Color temperature Light" }, { value: "LCT015", label: "Color Light" }, { value: "LST002", label: "Color Strip" }, ];
return (<> <SelectMenu label="Protocol:" defaultValue={protocols[0]} options={protocols} placeholder={lightData.protocol} onChange={(e) => handleChange("protocol", e)} />
{lightData.protocol !== "auto" && (
<>
<div className="form-control">
<GenericText
label="Name"
type="text"
placeholder="Name used on diyhue"
value={lightData.lightName}
onChange={(e) => handleChange("lightName", e)}
/>
</div>
<div className="form-control">
<SelectMenu
label="Emulated light type:"
options={lightModelIds}
placeholder={lightData.lightModelID}
onChange={(e) => handleChange("lightModelID", e)}
/>
</div>
</>
)}
{(lightData.protocol === "milight" || lightData.protocol === "mibox") && (
<>
<div className="form-control">
<GenericText
label="Device ID"
type="text"
placeholder="0x1234"
value={lightData.miID}
onChange={(e) => handleChange("miID", e)}
/>
</div>
<div className="form-control">
<SelectMenu
label="Choose light mode:"
options={milightModes}
placeholder={lightData.miModes}
onChange={(e) => handleChange("miModes", e)}
/>
</div>
<div className="form-control">
<SelectMenu
label="Choose light group:"
options={milightGroups}
placeholder={lightData.miGroups}
onChange={(e) => handleChange("miGroups", e)}
/>
</div>
</>
)}
{lightData.protocol === "mibox" && (
<div className="form-control">
<GenericText
label="Port"
type="number"
placeholder="Mi Box port"
value={lightData.miBoxPort}
onChange={(e) => handleChange("miboxPort", e)}
/>
</div>
)}
{lightData.protocol === "domoticz" && (
<div className="form-control">
<GenericText
label="Device ID"
type="text"
placeholder="Device ID"
value={lightData.domoticzID}
onChange={(e) => handleChange("domoticzID", e)}
/>
</div>
)}
{lightData.protocol === "jeedom" && (
<>
<div className="form-control">
<GenericText
label="Light Api"
type="text"
placeholder="Light Api"
value={lightData.jeedomlightAPI}
onChange={(e) => handleChange("jeedomlightAPI", e)}
/>
</div>
<div className="form-control">
<GenericText
label="Light ID"
type="text"
placeholder="Light ID"
value={lightData.jeedomlightID}
onChange={(e) => handleChange("jeedomlightID", e)}
/>
</div>
</>
)}
<div className="form-control">
<GenericButton
value="Add Light"
color="blue"
size=""
type="submit"
onClick={() => handleForm()}
/>
</div>
</>); };
export default AddLight; `
Ok thank you, new release is online, please try again. i already had found this issue but did not push it to the main, sorry.
Ok thank you, new release is online, please try again. i already had found this issue but did not push it to the main, sorry.
Yes!!! i can add the milight lamps again... Thanks for the quick help. Awesome!!
Issue does not already exist?
I have searched and found no existing issue
Select Environment
Docker
Home Assistant related?
No
Description
In the WebUI i cant add a device. I want to add two milight lamps. But when i press the "add Light" button noting happens. Also no error or confirmation notice in the upper right corner.
Looks like the button is not mapped?
Errorlog:
Steps to reproduce
Add Milight light and click "add light"
Please enter your operating system details here
OS: Linux Architecture: aarch64 os_version: '#1 SMP PREEMPT Tue Jun 18 15:11:43 UTC 2024' os_release: 6.6.31-haos-raspi Hue-Emulator Version: '2024-07-09 22:15:19.000000000' WebUI Version: '2024-07-09 22:15:30.000000000'
Upload debug tar