Hello,
I built myself a bed occupancy sensor using this guide, but I only use one, larger pad which is about the size of two A4 sheets of paper:
It uses the ESP32 touch sensor component of ESPHome and works really well.
Can I have the raw (numeric) value of such a touch sensor (the number that it shows in the log while using setup_mode: true) in a HA sensor entity and if yes, how?
I want to monitor the readings over longer periods while testing, and a sensor entity would be perfect for that as I could use the built-in average and chart features of HA
How can I export such an entity to HA from ESPHome ?
@orange-assistant
Thanks for your help,
The problem is that I the post you linked is for FSRs but the sensor I use is basically a pressure-dependant capacitor, and I don’t know if (and if yes, how) it’s possible to access the numeric value of the ESP32 touch component in a lambda for use in such an entity
I don’t know top of head. I’d have to sit down and tinker. And I’d probably be asking They Who Shall Not Be Named for help on spitting off the last numeric characters assuming that is available in the message (const char * ) part you can access with on_message.
The approach I’d be trying would roughly be:
Set up the on_message trigger
Set up a template sensor
Use a lambda in the on_message to parse off the value.
Publish the value to the template sensor.
I know that’s not very detailed but it’s all I can offer just now;)