Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to integrate EDS #95

Open
domoticasalve opened this issue Nov 26, 2024 · 10 comments
Open

Possibility to integrate EDS #95

domoticasalve opened this issue Nov 26, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@domoticasalve
Copy link

This is not an issue, it is more like if you could add the posibility to add compability to the EDS from circutor, it uses the same variables in the xml file as the WIBEEE.

I am not very into python but when I try to add my EDS in the ip section, it says "couldn't read device info". I have been looking the code and maybe this occurs because there is no macadress,ssid,securekey and ip values in the XML.

I think you can addapt this code or may be do a fork to integrate the EDS because it seems to be very easy. thank you

@luuuis
Copy link
Owner

luuuis commented Dec 14, 2024

@domoticasalve please enable DEBUG logging for the integration and email or attach the log file here so I can have a look.

@luuuis luuuis added the enhancement New feature or request label Dec 14, 2024
@domoticasalve
Copy link
Author

Hi, this is the error i got:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/wibeee/sensor.py", line 217, in async_setup_entry device = await api.async_fetch_device_info(retries=5) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/wibeee/api.py", line 66, in async_fetch_device_info device_id = devices['devices']['id'] ~~~~~~~^^^^^^^^^^^ KeyError: 'devices' 2024-12-18 12:04:21.684 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up wibeee platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/wibeee/sensor.py", line 217, in async_setup_entry device = await api.async_fetch_device_info(retries=5) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/wibeee/api.py", line 66, in async_fetch_device_info device_id = devices['devices']['id'] ~~~~~~~^^^^^^^^^^^ KeyError: 'devices'

The url where I do get the values is this one:

http://ip/services/user/values.xml?id=CVM-A

And the one from I get the id:

http://ip/services/user/devices.xml

and the xml from this page:
<devices> <id>CVM-A</id> </devices>

@luuuis
Copy link
Owner

luuuis commented Dec 19, 2024

@domoticasalve yes that should work, it looks the same as other devices and is tested here.

Send DEBUG logs if you would like me to look into it further.

@domoticasalve
Copy link
Author

domoticasalve commented Dec 19, 2024

Logs:

2024-12-19 12:15:54.518 INFO (MainThread) [custom_components.wibeee.api] Initializing WibeeeAPI with host: 192.168.72.132, timeout 0:00:01, max_wait: 0:00:01

2024-12-19 12:15:54.952 DEBUG (MainThread) [custom_components.wibeee.api] RAW Response from http://192.168.72.132/services/user/devices.xml: b'CVM-A')
eds1

2024-12-19 12:15:55.011 DEBUG (MainThread) [custom_components.wibeee.api] RAW Response from http://192.168.72.132/services/user/values.xml?var=CVM-A.macAddr&CVM-A.softVersion&CVM-A.model&CVM-A.ipAddr: b'')
eds2

@luuuis
Copy link
Owner

luuuis commented Dec 19, 2024

Hey, I rather need the log file (preferably) or otherwise the verbatim text that is in the file that came from hass_wibeee (in which case be extra careful to not modify text or leave things out). It could be an encoding issue in which case screenshots do not contain the information that I need.

In any case, what you show here looks different from your initial error? hass_wibeee has discovered your device id CVM-A and has then requested the values but the device returned nothing.

  1. If you repeat the request http://192.168.72.132/services/user/values.xml?var=CVM-A.macAddr&CVM-A.softVersion&CVM-A.model&CVM-A.ipAddr a few times do you ever get back any values?
  2. What about just http://192.168.72.132/services/user/values.xml? ⚠️ Be careful what you share from here as it might contain sensitive data like WiFi secrets. These are not included in the logs.

@domoticasalve
Copy link
Author

Hi,

I have this set in my configuration.yaml:

logger:
  logs:
    custom_components.wibeee: debug

but the only logs that I get when trying to add the device is the same from last answer:

2024-12-19 13:21:49.692 INFO (MainThread) [custom_components.wibeee.api] Initializing WibeeeAPI with host: 192.168.72.132, timeout 0:00:01, max_wait: 0:00:01
2024-12-19 13:21:49.715 DEBUG (MainThread) [custom_components.wibeee.api] RAW Response from http://192.168.72.132/services/user/devices.xml: b'<devices><id>CVM-A</id></devices>')
2024-12-19 13:21:49.751 DEBUG (MainThread) [custom_components.wibeee.api] RAW Response from http://192.168.72.132/services/user/values.xml?var=CVM-A.macAddr&CVM-A.softVersion&CVM-A.model&CVM-A.ipAddr: b'<values/>')

about your questions:
1- I have repeat the request for 100 times, with alaways the same response: "cant read device info". As I said in the first comment, in the EDS' xml there is no values for MacAddres, IpAddress nor Softversion.

2- For: http://192.168.72.132/services/user/values.xml? there are no values store in it. but there are for: http://192.168.72.132/services/user/values.xml?id=CVM-A. I will attach it in a file:
xml.txt

is there something I'm missing in order to help you out the max possible?

@luuuis
Copy link
Owner

luuuis commented Dec 19, 2024

Logs are good now that they are text rather than screenshot, thanks. 👍

Looking at your values.xml, the variable names for your device are completely different from the home devices. Check the following pdf from page 36 onwards where they describe the available device values, this is what we are using in the integration.

https://docs.circutor.com/docs/M064B01-03.pdf

If you can find similar documentation for your device and you are able to map the id names of your device to the KNOWN_SENSORS (instead of vrms, irms, etc) then we can look at adding support for the ECS.

@domoticasalve
Copy link
Author

Hi yea, the KNOW_SENSORS for my devices are these ones:

AE: Active energy
COSI: Power factor
API: Active Power
CPI: Capacitive Power
IPI: Inductive power
RCPI: Reactive power
RE: Reactive energy
KDVI: Voltaje unbalance
KAVI: Voltaje assimetry
KDAI: Intensity unbalance
KAAI: Intensity assimetry
VI123: Voltaje between L1,L2,L3
HZI: Frequency.

@luuuis
Copy link
Owner

luuuis commented Dec 20, 2024

Thanks. Does EDS have push support (I'm guessing yes) and are you able to override the server that it pushes its data to?

Parameter names for push support are different, at least in the other devices.

@domoticasalve
Copy link
Author

Hi Luis, long time no see.

Yes, the EDS have push support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants