I took a quick look at the repo for Konnected and it should be supportable using the ESPHome library I built by writing a customized driver that exposes each of the zones as a child device (e.g. contact sensor, smoke etc.) and with child button/switch devices to activate any konnected outputs.
You should have no problem connecting to it from HA and Hubitat, ESPHome can support multiple connections to its API.
My suggestion would be to use something like Node-Red and then you can push that out to Hubitat. While the ESPHome library would be able to access the data directly, it is likely to overload the small processor on the Hubitat with that much data streaming in.
Thank you @jonathanb for the great work on this. The one thing I can not figure out is the correct way to create the devices in Hubitat when there is more than one entity that needs control. My use case is a TUYA chip replacement of a RGBCCW light that has one entity for the CCW light and another entity for the RGB light. The CCW Light is the main light and the RGB is a ring t hat lights up the ceiling as ambient light. I have it working in other platforms, but can not figure out the right way to do it in habitat. Since it has the same IP address, I can not create more than one device and choose the entity on each. I also tried my own driver just for RGB and just for CCW, but again, it is the same device, so it can not detect the second one, and the first one gets messed up as well.
You will want to create child component devices from your main driver, in this case, two child components, a Generic Component RGBW and a Generic Component RGB.
You will then send events to those child component devices (using the parse method on them) and receive commands via the 'component' prefix methods that will be called from the child device back to the parent when a command is selected.
Here is an example for a dynamic number of child switches.
Does anyone know how create this function in Esphome?
I want to turn on switch-B if another switch-A has been and stays on for 3sec and the reverse if switch-A has been off and stays off for 3sec then switch-B is set to off.
I have tried script with reset control and 'for condition' with time set. But I cant seem to mimic the action of a latching flip/flop.
I have a sensor that detects distance and when it reaches a target range, it turns on a switch, if it's out of range, then off. I only want the control switch to turn on if the 'ranging' switch has been in a stable state for 3sec or more. I don't want to debounce or throttle filters on the sensor, because the moving action is too fast and it might be missed.
@jonathanb I tried to add an illuminance sensor to your posted example. It seemed simple enough to copy/paste/replace one of components with 'illuminance' and add in with same syntax. I looked up the driver definition for Hubitat and added that capability, following example.
IlluminanceMeasurement
Device Selector
capability.illuminanceMeasurement
Driver Definition
capability "IlluminanceMeasurement"
** Here is the resulting driver code additions (illuminance):
input name: 'Illuminance', // allows the user to select which sensor entity to use
type: 'enum',
title: 'ESPHome Illuminance Entity',
required: state.sensors?.size() > 0,
options: state.sensors?.collectEntries { k, v -> [ k, v.name ] }
...
...
...
case 'illuminance':
// This will populate the cover dropdown with all the entities
// discovered and the entity key which is required when sending commands
state.sensors = (state.sensors ?: [:]) + [ (message.key): message ]
if (!settings.illuminance) {
device.updateSetting('illuminance', message.key)
}
break
...
...
...
if (settings.illuminance as Long == message.key && message.hasState) {
String value = message.state
if (device.currentValue('illuminance') != value) {
sendEvent([
name: 'illuminance',
value: value,
unit: 'lux',
descriptionText: "Illuminance is ${value}"
])
}
return
}
Any chance there would be any way to incorporate the UpsyDesky with your ESPHome integration? The yaml files tjhorner put together to incorporate the UpsyDesky into HA are available on his github... This would be my first time incorporating something with ESPHome into HE, so just curious if anyone has any thoughts before I order one from him to automate my new Uplift desk.