Ok, I understand Code can seem like a lot of garbled characters.
As such a delta filter would be relatively easy for me to implement, I think I can easily add. Only thing I would be interested in would be the exact use case (it helps a lot if you know what you’re actually try solve). Thanks!
For the ADC I’ve managed to use, until now, LDR (both as general light sensor to be able to trigger automations when bulbs need to be turned on/off using sun light as condition or as a feedback for a light command being sent by HA to bulbs - that is for bulbs that do not send acknowledgment to the commands received; I know that there are digital sensors for luminescence but it is easier, and more fun to put a LDR and a resistor to an ADC pin ), load cell (for building a weighting device or as bed occupancy sensor), MQ-9 for carbon monoxide (at least I think it works as when placed near a glass of beer it immediately reacts ) and sound sensor. Obviously, there are many more different types of analog sensors but at least for these I found an immediate, effective use.
Each of these would require readings being sent to HA both when changes occur (by comparison to the previous stored value) and over a certain schedule (at 1/2/5/10 minutes, etc) - this would also serve as a heartbeat signal.
Hi this is a great project! Do you have any intention to support rotary encoders?
I’m currently using espeasy for an mqtt “dimmer” using rotary encoder. I’d love to move to your solution.
Yes that seems like a fun use-case. I’ve now tried to make a generic “send if … or …” with a special “send if delta or time” filter. I’ll see if I can get it into 1.6.0
Absolute rotary encoders (the ones using a voltage divider circuit) should already be supported by the ADC Sensor (I think I’ll create a “cookbook” for 2nd order components sometime).
Basically, with absolute rotary encoders, you just measure the voltage on the pin between GND and VCC. That voltage you measure will be proportional to the angle. Something like this:
sensor:
- platform: adc
pin: A0
name: "Living Room Dimmer"
filters:
# Convert voltage to angle, depends on input voltage and encoder.
- lambda: (x / 3.3) * 360.0
# Tell Home Assistant the output value is in degrees
unit_of_measurement: "°"
Continuous rotary encoder (with digital signals) are currently not supported, but I’ll try to get it into the automation engine release as it makes most sense there.
Thanks for the info, and for looking into rotary encoder support - meant the digital continuous rotary encoders rather than pot.
These are useful because analogue input on a sonoff basic is not easy.
This configuration will publish new states if either the absolute difference to the last reported value is at least 5.0or if the last sent value is 5 minutes old.
@OttoWinter I have 2 magnetic reed switches connected to 2 pins and set up sensors using esphomeyaml in HA for garage door open or closed. I see that the sensors go unavailable frequently and come back online. See pic below. Is there a way to resolve this?
Jep, that’s a known problem - and I don’t know a “real” solution to it. Somehow some ESP8266 like randomly loosing the WiFi connection and not being able to recover from it.
A few work-arounds that can help:
Use the latest arduino framework version (see this) - something in the low level IP stack (short lwip) seems to be quite broken in older version.
Play around with the MQTT keepalive option. For me, on some nodes reducing this value has helped, on others increasing it helped. I have no idea why
(Apparently, the “cheap” ESP8266/NodeMCU boards are much worse at this. Probably something related to them having a worse WiFi antenna.)
Yes I will support RF signals quite soon. The sending part is now more or less done with the IR Transmitter component (RF signals are really nothing else than a modulated signal like IR). I only need to add support for all the protocols now and create a RF receiver to sniff the codes.
Looks very good so far. I saw your note in the docs “In the future, this integration will be expanded to support reading RSSI values and hopefully support lots more devices like tracking smartphones and reading temperature values from BLE sensors.”
I’d love to put an ESP32 outside to drive a drip irrigation valve and be able to read (Bluetooth) miflora values and publish it on MQTT for HA to use.
Yeah sure it’s on my list, but that list is quite long… The problem is that I don’t own any BLE sensors (which send temperature values) and they seem quite expensive. Do you know of any cheap BLE-enabled sensors (~10$)? I’m thinking of maybe buying one as BLE is an interesting standard
Thank you! Just ordered one from eBay (I’m not a big fan of AliExpress) and will try to add support for it when it arrives - Gotta say that one @Petrica posted really looks quite dope (from a design perspective). So I’m already excited to have it arrive
@OttoWinter is there any chance of including control for digital LED’s? I found this earlier today as linked from another thread on this forum and thought it would be a nice addition to your awesome work to have digital LED control since the NodeMCU’s make such a neat little controller for this type of thing