Closed Baldhor closed 1 year ago
This enhancement imply a big rework of the application
It's working ...
I made 2 devices with 2 capabilities each based on the same physical device:
The cover is working very well, same for the 3 sensors.
Still many things to test and fix ... but already a lot of functionnalities ... => Connect to new physical device and configure virtual devices, their capabilities and options
More to come: => Modify / Delete existing virtual devices ...
Broken:
For those interrested, I published a test version: https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/
4.0.1 published for test: https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/ Many refacto to make next steps easier. Imply a breaking change, which I could not avoid, sorry. => Need to delete device created with version 4.0.0 through the wizard driver
Anything specific I need to test?
@RoadXY just new device, anything you can think of :)
I'm working on the existing device functions
Published TEST version 0.4.2: https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/
I cannot test every single use case by myself, there are many devices I do not have. Using mock (add random behaviour to the physical device through its firmware configuration) has its limits!
I didn't tested flows yet (trigger, condition, actions), and also need to test if there are several times the same "capability" on a virtual device.
0.4.3 published: Fix: add capability listener Fix: solved a few bugs related to the modification of a capability. If you change the type, it actually means a delete and a add, not a modify. Was missing Homey.done();
0.4.4 published and I asked for certification Seems stable enough.
I also made a community in homey forums
Last commit add support for title, preventInsights and preventTag options for all capabilities. To be honest, I'm unsure who would use preventInsights and preventTag ...
But title allows to distinguish two capability of the same type! Here is an exemple for temperature:
And in flows:
And this is possible because in the wizard, I configured:
(Difficult to make a nice screenshot with this wizard ... who designed it!?)
Published 0.5.1: legacy driver is now deprecated, and only the wizard can be used for new devices.
Current situation
As of current situation, which is actually the default behaviour for all Homey devices, a physical device (real world device) is linked to one and only one device in Homey. All capabilities of the physical device are directly linked to the Homey device.
Let's consider a physical device which include a temperature, humidity and air pressure sensor. In Homey, it will appear as one device which those 3 capabilities.
Above, you can see a Xiaomi sensor. On room view, only the temperature appear. To check the other capabilities, you need to go "inside" the device!
Example with Athom sw03
An ESPhome device can have a lot of entities. For example if you consider the device I use to control my covers:
This device has:
(You can find the configuration I use here: https://github.com/Baldhor/Homey-ESPhome-Enhanced/tree/main/esphome-config)
I could actually modify the configuration to handle the cover with a simple button, and use the 2 others for whatever purpose:
So why those "entities" should all appear in a single "Homey device"!?
Example with Sonoff 4CH
Another example, I'm using many Sonoff 4CH to control all my heaters.
Each physical device control up to 4 heaters which can be in different rooms.
Currently, I have no choice, I'm using virtual device and many many many flows to "copy" the events from the virtual device to the "homey device", and the opposite ...
Here are the flows, just for my ground floor (yes, I have a big house ...)
Remark: they are currently running Tasmota, not ESPhome. If I change to ESPhome, I will need to modify about 50 flows!
What I want
I want during pair time to have the ability to split the physical device entities into different Homey devices
Remark: the user should have the right to handle several entities (capabilities) into the same Homey device, but he should also have the right to split them as he want!
Different kind of entities
In ESPhome, an entity can serve many different use. Let's take the exemple of my Athom SW03 configuration for cover:
When exposed as settings, I should be able to configure it as "read only" or "read/write".
Different kind of entity options
For exemple "open duration", has 3 options configured:
Sensor (like uptime) have many options:
We should be able to modify those options in the device settings screen.
An ESPhome physical device configuration can be modified easily
To make it short: The strengh of ESPhome is the abilioty given to easily modify our device behaviours! Everytime we change such configuration on the physical device, we should not have to delete and pair again the device! We should be able to "update" ...