grimmpp / home-assistant-eltako

Integration for Eltako 14 series in Home Assistant
MIT License
28 stars 5 forks source link

Sensors like FABH65 or FBH65TF only support motion but no brightness #69

Closed Pegasus500 closed 4 months ago

Pegasus500 commented 4 months ago

Sensors using the A5-08-01 only show the motion entity in HA, the brightness value is missing. Could this be added somehow? Also, it would be very nice to see the voltage value for these battery or solar operated sensors. I could help with the telegram info of Eltako but I have no clue how to implement this here.

Funk-Telegramme nach EEP A5-08-01 (Exceptions by Eltako) Helligkeitsbereich erweitert, kein Occupancy Button im DB0_Bit0) ORG = 0x07 Data_byte3 = Betriebsspannung 0..5,1 V (0..255) Data_byte2 = Helligkeit 0..510 lux (0..255) Data_byte1 = - Data_byte0 = 0x0D = Bewegung 0x0F = keine Bewegung Lerntelegramm: 0x20080D85

grimmpp commented 4 months ago

Hello @Pegasus500,

jup, that's quite easy and actually already available but not displayed.

Pegasus500 commented 4 months ago

Could you make those values visible? I tried moving the sensor from binary sensor to sensors and adding illuminance, but I could not get a valid configuration. BTW, your Eltako integration is appreciated very much, thank you!

grimmpp commented 4 months ago

Thanks, yes that's what I meant I will do it. Before that I need to fix the cover/shutters. I broke them by introducing the state recovery feature which shows you the values before restarting HA after you restarted it.

grimmpp commented 4 months ago

Hello @Pegasus500, can you please send me an example telegram for testing?

Pegasus500 commented 4 months ago

In PCT14 I get: 0x05,5 FF BA BE 80 DB3: 0x70 Is there a better way to get the raw telegrams?

grimmpp commented 4 months ago

I need to check if it is sufficient.

Because development and testing in HA is very inconvenient, I'm about to develop an app independent of HA (to be meant to run on your PC) which also allows you to inventory, describe, manage your devices + generate HA config automatically. If you are interested in, it would be nice to get feedback if you can use it for managing your devices and generating HA config. You can also receive telegram after you have connected a gateway. FAM14, FGW14-USB, FAM-USB and USB300 are already supported. After you received the first telegram the device is displayed in the table and you can assign the EEP. When further telegrams are received it will show the values corresponding to the EEP in addition. You can also change the EEP in between. Unfortunately, you need to wait always for new incoming telegram after you change EPP but I've planned to change that.

https://github.com/grimmpp/enocean-device-manager

Pegasus500 commented 4 months ago

I tried the app und it looks very promising. But after selecting "detect COM" or selecting FAM-USB I always get "established serial connection" and "ERROR write timeout". This happens after installing in a virtual environment or directly under Windows.

grimmpp commented 4 months ago

I don't understand what the data is of the telegram you've sent earlier. For me it looks like that only data_byte3 is available. I need all 4 from 0 to 3. You could also enable debug logs for the integration and check the logs. And then search for the telegram of your address: FF BA BE 80

Here at the end of the config you see how to switch debug logs on. https://github.com/grimmpp/home-assistant-eltako/blob/main/docs/update_home_assistant_configuration.md

Pegasus500 commented 4 months ago

Ok, I think I got some better telegrams now:

FBH65TF #1: DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <RPSMessage from ff ba be 80, db0 = 70, status = 0x30 (T2, N, 0 repetitions)> DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <Regular4BSMessage from ff ba be 82, data aa 00 00 0d, status = 0x00> DEBUG (SyncWorker_53) [eltako] decoded : {"_supply_voltage": 3.3999999999999995, "_illumination": 0.0, "_temperature": 0.0, "_learn_button": 1, "_pir_status": 0, "_occupancy_button": 1} DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <Regular4BSMessage from ff ba be 81, data aa 80 76 0f, status = 0x30>

FBH65TF #2: DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <RPSMessage from ff 9d a0 80, db0 = 70, status = 0x30 (T2, N, 0 repetitions)> DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <Regular4BSMessage from ff 9d a0 82, data b6 00 00 0d, status = 0x00> DEBUG (SyncWorker_53) [eltako] decoded : {"_supply_voltage": 3.6399999999999997, "_illumination": 0.0, "_temperature": 0.0, "_learn_button": 1, "_pir_status": 0, "_occupancy_button": 1} DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <Regular4BSMessage from ff 9d a0 81, data b6 87 76 0f, status = 0x30>

FABH65: DEBUG (Thread-2) [eltako] [Gateway] [Id: 1] Received message: <Regular4BSMessage from 05 2b 40 0c, data cb 00 00 0d, status = 0x01> DEBUG (SyncWorker_44) [eltako] decoded : {"_supply_voltage": 4.06, "_illumination": 0.0, "_temperature": 0.0, "_learn_button": 1, "_pir_status": 0, "_occupancy_button": 1}

In HA I see the temperatures and humidities of the first sensors, although it shows 0 in the log....

Here some additional log telegrams from FHEM: 2024.02.25 14:37:49 5: TCM FGW14_USB received ESP: A55A0B0570000000FF9DA080306C 2024.02.25 14:37:49 5: FGW14_USB: dispatch EnOcean:1:F6:70:FF9DA080:30:01FFFFFFFF0000 2024.02.25 14:37:49 5: EnOcean received via FGW14_USB: EnOcean:1:F6:70:FF9DA080:30:01FFFFFFFF0000 2024.02.25 14:37:49 5: TCM FGW14_USB received ESP: A55A0B07AE28000DFF9DA08200B3 2024.02.25 14:37:49 5: FGW14_USB: dispatch EnOcean:1:A5:AE28000D:FF9DA082:00:01FFFFFFFF0000 2024.02.25 14:37:49 5: EnOcean received via FGW14_USB: EnOcean:1:A5:AE28000D:FF9DA082:00:01FFFFFFFF0000

2024.02.25 14:37:51 5: TCM FGW14_USB received ESP: A55A0B07AE8D7A0FFF9DA08130C3 2024.02.25 14:37:51 5: FGW14_USB: dispatch EnOcean:1:A5:AE8D7A0F:FF9DA081:30:01FFFFFFFF0000

2024.02.25 14:38:15 5: TCM FGW14_USB received ESP: A55A0B0550000000FFBABE803087 2024.02.25 14:38:15 5: FGW14_USB: dispatch EnOcean:1:F6:50:FFBABE80:30:01FFFFFFFF0000 2024.02.25 14:38:15 5: EnOcean received via FGW14_USB: EnOcean:1:F6:50:FFBABE80:30:01FFFFFFFF0000 2024.02.25 14:38:15 5: TCM FGW14_USB received ESP: A55A0B079E30000DFFBABE8200E6 2024.02.25 14:38:15 5: FGW14_USB: dispatch EnOcean:1:A5:9E30000D:FFBABE82:00:01FFFFFFFF0000 2024.02.25 14:38:15 5: EnOcean received via FGW14_USB: EnOcean:1:A5:9E30000D:FFBABE82:00:01FFFFFFFF0000

grimmpp commented 4 months ago

Oh, man. I don't like exceptions from the standard. Good think about it is, it is already implemented this way. :-) image

Good to know what device you are using. It looks like FBH65TF has 3 addresses (in your case: ff ba be 80, ff ba be 81, ff ba be 82) and you get status update, A5-08-01 and A5-04-02. In that case we just need to display the entities. Personally I tend to display many separate devices. Actually FBH65TF is also a many in one. One the dashboards you could group the entities in a way that it look like one device if you like or use the name in the config that should group the entities together into one device.

grimmpp commented 4 months ago

In your example I haven't found the telegrams for A5-04-02. A5-08-01 is supported now and available under main. Would be cool if you could test it and compare if the displayed values make sense. For your example data = 0xAA80760F it would look like: image A5-04-02 would look like this: image

Pegasus500 commented 4 months ago

Here is one of my sensors after I copied the binary sensors into sensors as well (in configuration.yaml). Screenshot_2024-02-26-12-12-27-340_io homeassistant companion android-edit Screenshot_2024-02-26-12-12-08-544_io homeassistant companion android-edit

The values for humidity and temperature look okay (I already had them before), voltage fits also. The illuminance however seems too low, exactly a factor 3 compared with the FHEM integration. In the motion sensor there is a temperature entity which is too much. Thank you very much for the effort.

grimmpp commented 4 months ago

Regarding temperature: Is is part of the EEP and depends on the sensor if you get a value or not. Same with the other entities. You can just remove unused entities on your dashboard. Regarding illuminance: I took the range Eltako specified. Do you know by accident what range is used by FHEM? image

Pegasus500 commented 4 months ago

Okay, temperature is clear, just wanted to mention it for my sensors. No idea what illuminance range FHEM is using, maybe FHEM is wrong here. In the end the absolute values are not important, i just need the indication.

P.S. found something in the FHEM docs:

Light, Temperatur and Occupancy Sensor (EEP A5-08-01 ... A5-08-03) [Eltako FABH63, FBx5B, FBH55, FBH63, FBH65x, FBHF65SB, FIBH63, Thermokon SR-MDS, PEHA 482 FU-BM DE] M: on|off E: E/lx P: absent|present T: t/°C U: U/V alarm: dead_sensor brightness: E/lx (Sensor Range: E = 0 lx ... 510, 1020, 1530 or 2048 lx) motion: on|off presence: absent|present temperature: t/°C (Sensor Range: t = 0 °C ... 51 °C or -30 °C ... 50 °C) voltage: U/V (Sensor Range: U = 0 V ... 5.1 V) state: M: on|off E: E/lx P: absent|present T: t/°C U: U/V

Eltako and PEHA devices only support Brightness and Motion. The attr subType must be lightTempOccupSensor.<01|02|03> and attr manufID must be 00D for Eltako Devices. This is done if the device was created by autocreate. Set model to Eltako_TF manually for Eltako TF devices or to FBH55SB, FBH65SB, FBHF65SB. signOfLifeInterval ([signOfLifeInterval] = 1320 is default).

grimmpp commented 4 months ago

Hello @Pegasus500,

I've found the code and FHME distinguishes in case of A5-08-01 between devices: All starting with FB data2 and others data8 https://svn.fhem.de/fhem/trunk/fhem/FHEM/10_EnOcean.pm image

grimmpp commented 4 months ago

for easier debugging I've added a EEP Checker in eo-man: image